Kirjoittaja Aihe: 5 second desktop  (Luettu 4598 kertaa)

Jakke77

  • Käyttäjä
  • Viestejä: 3946
  • Oulu (Oinaansuo)
    • Profiili
5 second desktop
« : 11.06.15 - klo:14.45 »
pääpiirteittäin jotenkin selvää tekstiä mullekin, mutta jaksasko joku vääntää tän kokonaan suomeksi :)

Koodia: [Valitse]
#!/bin/sh

# Company:      PowerCraft Technology
# Author:       Copyright Jelle de Jong <jelledejong@powercraft.nl>
# Note:         Please send me an email if you enhanced this document
# System:       Ubuntu Linux and Debian GNU/Linux
# Version:      0.1.1
# Date:         2009-06-23

# purpose:
# I build a lot of different linux systems, some just need fast bootup
# like multimedia devices, easy internet devices, netbooks et cetera.
# one of the requirements is maintainability and stability.
# I don't get maintainability by recompiling my own software, so that is
# not an option. What is an option is to tweak all the configuration
# systems I can find, test them for stability and use them.

# major issues:
# the udev process takes an awful lot of time it just stays for more then
# 7 seconds in the "Waiting for /dev to be fully populated" state probably
# caused by udevadm settle. We need to tune udev to become way faster and
# keep the solution easy to use and maintainable.

# rectification:
# I had a chat with the debian udev maintainer and he said the issue is not with udev.
# The udev process, calls modprobe that show a lot of unint.sleep and its waiting for
# something. modprobe interacts with the kernel modules so the issue is with the kernel
# not udev. It's probably waiting for the kernel initializing the hardware. So we may
# need a better kernel or module loading process? Any ideas?

# I use grub2 and it has no behavior like hiddenmenu, you can see three flashes
# during boot before it comes to the steady "loading system" state.

# sometimes my asus eeepc 901 just won't turn off at the last stages of halt.
# I got the feeling that some hardware (audio, network) is not correctly
# deinitialized and makes the shutdown process hang. SySRq doesn't react in this
# stage anymore so the kernel is probably down already.

# result:
# my boot process is around 13 seconds and 7 á 8 of them are caused by udev.

------------------------------------------------------------------------

http://wiki.debian.org/DebianEeePC/Boot
http://wiki.debian.org/DebianEeePC/TipsAndTricks
http://wiki.debian.org/BootProcessSpeedup
http://wiki.debian.org/From_Naught_to_Sixty_in_5_Seconds
http://wiki.archlinux.org/index.php/Asus_Eee_PC_901
http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
http://wiki.archlinux.org/index.php/Tweaking_for_a_faster_boot_time
http://prasetyams.net/2008/06/27/speedup-arch-boot-process/

sudo apt-get install dash
dpkg-reconfigure dash

sudo apt-get install bootchart bootchart-view imagemagick

vim /etc/default/grub
    GRUB_CMDLINE_LINUX="init=/sbin/bootchartd"
sudo update-grub
cat /boot/grub/grub.cfg

sudo dpkg-reconfigure bootchart
chkconfig --list bootchart

sudo shutdown -r now

ls -hal /var/log/bootchart.tgz
bootchart
display  bootchart.svgz
mv --verbose bootchart.svgz bootchart0.svgz

------------------------------------------------------------------------

sudo apt-get remove --purge readahead
bootchart
display  bootchart.svgz
mv --verbose bootchart.svgz bootchart1.svgz

------------------------------------------------------------------------

sudo apt-get remove --purge logrotate cron sysklogd nfs-common

dpkg -S net.agent
cat /lib/udev/net.agent

grep -n -H sleep /lib/udev/net.agent
/lib/udev/net.agent:30: sleep 1

sudo vim /lib/udev/net.agent
# added exit on top under the
#!/bin/sh
exit

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart2.svgz
display bootchart2.svgz

------------------------------------------------------------------------

# seems without net.agent boot up gets slower, so reverting back

sudo vim /lib/udev/net.agent
# added exit on top under the
#!/bin/sh
exit

------------------------------------------------------------------------

sudo vim /lib/udev/net.agent
:%s/sleep 1/# sleep 1/g

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart4.svgz
display bootchart4.svgz

# saved 2 seconds with the commenting out sleep in /lib/udev/net.agent

------------------------------------------------------------------------

fgrep --recursive pciehp /etc/modprobe.d/
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX="elevator=noop quiet noresume force-hpet init=/sbin/bootchartd"
sudo update-grub

# no pciehp on asus eeepc 901
# grep pciehp /proc/modules
# sudo vim /etc/modprobe.d/pciehp
# options pciehp pciehp_force=1 pciehp_poll_mode=1

find='alias net-pf-10.*'
replace='alias net-pf-10 off'
sudo sed -i -e "s,$find,$replace,g" /etc/modprobe.d/aliases

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart5.svgz
display bootchart5.svgz

# saved an other 2 seconds on that :D

------------------------------------------------------------------------

sudo vim  /etc/X11/xorg.conf
Section "Device"
    Identifier      "Configured Video Device"
    Driver          "intel"
    Option          "XAANoOffScreenPixmaps" "true"
    Option          "AccelMethod"           "XAA"
EndSection

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart6.svgz
display bootchart6.svgz

# hmm two seconds slower again, but don't think this is the reason

------------------------------------------------------------------------

# the debian 2.6.30-1-686 is way slower then the debian 2.6.29-2-486

apt-cache search 2.6.30
sudo apt-get install linux-image-2.6.30-1-686
sudo update-grub
cat /boot/grub/grub.cfg

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart7.svgz
display bootchart7.svgz

$ cat /proc/version
    Linux version 2.6.30-1-686 (Debian 2.6.30-1) (waldi@debian.org) (gcc version 4.3.3 (Debian 4.3.3-11) ) #1 SMP Sun Jun 14 16:11:32 UTC 2009
sudo apt-get remove --purge linux-image-2.6.29-2-486
sudo update-grub
cat /boot/grub/grub.cfg

# installing readahead did not really help
# sudo apt-get install readahead
# sudo touch /etc/readahead/profile-once

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart8.svgz
display bootchart8.svgz

apt-cache search 2.6.30
sudo apt-get install linux-image-2.6.30-1-486
sudo update-grub
cat /boot/grub/grub.cfg

------------------------------------------------------------------------

sudo apt-get install insserv
sudo dpkg-reconfigure insserv

# info: Reordering boot system, log to /var/lib/insserv/run-20090623T0937.log
# info: Recording new boot sequence in /var/lib/insserv/bootscripts-20090623T0937-after.list
# info: Use '/usr/sbin/update-bootsystem-insserv restore' to restore the old boot sequence.

ls /etc/rc*.d/ | cut -f 1 -d " "

echo CONCURRENCY=startpar | sudo tee --append /etc/default/rcS

cat /etc/default/rcS
# TMPTIME=0
# SULOGIN=no
# DELAYLOGIN=no
# UTC=yes
# VERBOSE=no
# FSCKFIX=yes
# RAMRUN=yes
# RAMLOCK=yes
# HWCLOCKPARS="--directisa"
# CONCURRENCY=startpar

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart9.svgz
display bootchart9.svgz


------------------------------------------------------------------------

sudo vim /etc/rc.local
sudo chkconfig rc.local off
sudo chkconfig umountnfs.sh off
sudo chkconfig mountnfs-bootclean.sh off
sudo chkconfig mountnfs.sh off

sudo apt-get install bluez-alsa bluez
sudo /usr/sbin/update-bootsystem-insserv

ls /etc/rc*.d/ | cut -f 1 -d " "

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart10.svgz
display bootchart10.svgz

------------------------------------------------------------------------

sudo update-initramfs -v -u

# CONCURRENCY is now defined in /etc/default/rcS
dpkg -S /etc/init.d/rc
sudo dpkg-reconfigure sysv-rc
sudo vim /etc/init.d/rc

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart11.svgz
display bootchart11.svgz

Waiting for /dev to be fully populated
udevadm settle

sudo vim /etc/init.d/udev
    if udevadm settle --timeout=3; then

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart12.svgz
convert bootchart12.svgz bootchart12.png
display bootchart12.png

sudo vim /etc/init.d/udev
# removing timeout stuff, does not feel any faster and it is unmaintainable

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart13.svgz
convert bootchart13.svgz bootchart13.png
display bootchart13.png

------------------------------------------------------------------------

# testing readahead again with linux-image-2.6.30-1-686
sudo apt-get install readahead
sudo touch /etc/readahead/profile-once

# this does actually work!
# during profiling my udev complete goes over its neck about no memory issue
# i have to SySRq RISE and then crl+alt+del to reboot and then it works

------------------------------------------------------------------------

sudo apt-get remove --purge linux-image-2.6.30-1-686
sudo update-grub

sudo vim /etc/initramfs-tools/initramfs.conf
:%s/MODULES=most/MODULES=dep/g
:%s/BUSYBOX=y/BUSYBOX=n/g
:%s/KEYMAP=y/KEYMAP=n/g

sudo update-initramfs -v -u -k all
sudo /usr/sbin/update-bootsystem-insserv
sudo touch /etc/readahead/profile-once

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart14.svgz
convert bootchart14.svgz bootchart14.png
display bootchart14.png

# the 2.6.30-1-486 seems to be slower because it has higher cpu loads

------------------------------------------------------------------------

# may not be needed i can't see the use of the pcihp module on my eeepc 901
echo "options pciehp pciehp_force=1 pciehp_poll_mode=1" | sudo tee /etc/modprobe.d/pciehp.conf

# not needed anymore on 2.6.30
sudo rm /etc/modprobe.d/bluetooth.conf
    options hci_usb reset=1

sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX="elevator=noop quiet noresume clocksource=hpet init=/sbin/bootchartd"
# force-hpet
sudo update-grub
cat /boot/grub/grub.cfg

cat /proc/cmdline
cat /proc/version
BOOT_IMAGE=/boot/vmlinuz-2.6.30-1-686 root=UUID=3e6384e0-dcaf-4c93-972f-f54c00a7dd22 ro elevator=noop quiet noresume clocksource=hpet init=/sbin/bootchartd
Linux version 2.6.30-1-686 (Debian 2.6.30-1) (waldi@debian.org) (gcc version 4.3.3 (Debian 4.3.3-11) ) #1 SMP Sun Jun 14 16:11:32 UTC 2009

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart15.svgz
convert bootchart15.svgz bootchart15.png
display bootchart15.png

------------------------------------------------------------------------

sudo vim /etc/sysctl.conf
vm.swappiness = 1
vm.vfs_cache_pressure = 50
vm.dirty_writeback_centisecs = 1500
vm.dirty_ratio = 20
vm.dirty_background_ratio = 10
vm.laptop_mode = 5
net.ipv4.tcp_window_scaling=0

sudo sysctl -p

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart16.svgz
convert bootchart16.svgz bootchart16.png
display bootchart16.png

------------------------------------------------------------------------

# turning off everything in bios

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart17.svgz
convert bootchart17.svgz bootchart17.png
display bootchart17.png

# dinaly i have some indication that there is someting serious delaying
# the bootup. Things that cant be disabled in the bios are audio and usb
# things that where disabled are lan, bluetooth, wlan, cam

------------------------------------------------------------------------

# started to blacklist all modules all audio, all usb, all bluetooth
# nothing removed the delay, until i blacklisted the eeepc_laptop
# now the udev process goes like it was meant to be.

sudo vim /etc/modprobe.d/blacklist.con
blacklist eeepc_laptop

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart18.svgz
convert bootchart18.svgz bootchart18.png
display bootchart18.png

sudo apt-get remove --purge readahead linux-image-2.6.30-1-486
sudo update-grub

sudo update-initramfs -v -u -k all
sudo /usr/sbin/update-bootsystem-insserv
sudo rm /var/lib/insserv/*.tar.gz

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart19.svgz
convert bootchart19.svgz bootchart19.png
display bootchart19.png

------------------------------------------------------------------------

wget http://tartarus.org/~ds/linux-image-2.6.30-eee901_2.6.30-eee901-10.00.Custom_i386.deb
sudo dpkg --install linux-image-2.6.30-eee901_2.6.30-eee901-10.00.Custom_i386.deb
sudo vim /etc/default/grub
GRUB_DEFAULT=3
sudo update-grub

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart20.svgz
convert bootchart20.svgz bootchart20.png
display bootchart20.png

sudo vim /etc/default/grub
GRUB_DEFAULT=0
sudo apt-get remove --purge linux-image-2.6.30-eee901
sudo update-grub

ls -hal /var/log/bootchart.tgz
bootchart
mv --verbose bootchart.svgz bootchart21.svgz
convert bootchart21.svgz bootchart21.png
display bootchart21.png

------------------------------------------------------------------------

# disable bootchartd system and enjoying my 5 seconds boot
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX="elevator=noop quiet noresume clocksource=hpet"
sudo update-grub

------------------------------------------------------------------------

find $HOME -type f -iname "*.svgz" -exec convert '{}' '{}'.png \;

------------------------------------------------------------------------

sudo vim /etc/fstab
/dev/sda1   /           ext2    defaults,relatime   0 1
proc        /proc       proc    defaults            0 0
tmpfs       /tmp        tmpfs   defaults            0 0

------------------------------------------------------------------------

current situation ext2 /dev/sda1 wanted situation ext2 /dev/sda1 and 16MB 0xef /dev/sda2 on the end of /dev/sda
fsck -n /dev/sda1
16MB
0xef

$ dumpe2fs -h /dev/sda1
dumpe2fs 1.41.6 (30-May-2009)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          3e6384e0-dcaf-4c93-972f-f54c00a7dd22
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      filetype sparse_super
Default mount options:    (none)
Filesystem state:         not clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              492032
Block count:              983973
Reserved block count:     49198
Free blocks:              119386
Free inodes:              355584
First block:              0
Block size:               4096
Fragment size:            4096
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         15872
Inode blocks per group:   496
Last mount time:          Tue Jun 23 10:52:00 2009
Last write time:          Tue Jun 23 10:52:11 2009
Mount count:              9
Maximum mount count:      30
Last checked:             Tue Jun 23 00:23:53 2009
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128

$ sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=       63, size=  7871787, Id=83, bootable
/dev/sda2 : start=        0, size=        0, Id= 0
/dev/sda3 : start=        0, size=        0, Id= 0
/dev/sda4 : start=        0, size=        0, Id= 0

$ fdisk -l /dev/sda

Disk /dev/sda: 4034 MB, 4034838528 bytes
255 heads, 63 sectors/track, 490 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfb38fb38

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         490     3935893+  83  Linux


bc <<< "16*1024"
16384
bc <<< "3935893 - 16384"
3919509
echo "3935893 - 16384" | bc
3919509

resize2fs /dev/sda1 3919509

bc <<< "4034-16"
resize2fs /dev/sda1 4018M

# result: partition is only 983973 (4K) blocks
# requested: 1028608 blocks
# will not fit exiting

# how can I convert the free space to a partion with parted?
sudo /sbin/parted --script /dev/sda \
mkpart primary 3919509 100% \
print

------------------------------------------------------------------------

modprobe acpi-cpufreq
http://update.eeepc.asus.com/bios/901-ASUS-1703.zip

------------------------------------------------------------------------

$ cat /etc/X11/xorg.conf
Section "Module"
    Disable         "glx"
    Disable         "dri"
EndSection

Section "InputDevice"
    Identifier      "Generic Keyboard"
    Driver          "kbd"
    Option          "XkbRules"      "xorg"
    Option          "XkbModel"      "pc105"
    Option          "XkbLayout"     "us"
    Option          "XkbOptions"    "compose:ralt"
EndSection

Section "InputDevice"
    Identifier      "Configured Mouse"
    Driver          "mouse"
    Option          "CorePointer"
EndSection

Section "Device"
    Identifier      "Configured Video Device"
    Driver          "intel"
    Option          "XAANoOffScreenPixmaps" "true"
    Option          "AccelMethod"           "XAA"
EndSection

Section "Monitor"
    Identifier      "Configured Monitor"
EndSection

Section "Screen"
    Identifier      "Default Screen"
    Monitor         "Configured Monitor"
    Device          "Configured Video Device"
EndSection

Section "ServerLayout"
    Identifier      "Default Layout"
    Screen          "Default Screen"
    Option          "BlankTime"     "0"
    Option          "StandbyTime"   "0"
    Option          "SuspendTime"   "0"
    Option          "OffTime"       "0"
EndSection

------------------------------------------------------------------------

 ::)
U_G_H

Aspire E5-575G V1.27 CPU: Intel i3-6100U (4) @ 2.300GHz GPU: Intel® HD Graphics 520 GPU: NVIDIA GeForce 940MX Samsung SSD 970 EVO Plus 500GB

Timo Tamminen

  • Käyttäjä / moderaattori+
  • Viestejä: 575
    • Profiili
Vs: 5 second desktop
« Vastaus #1 : 11.06.15 - klo:14.50 »
Olemme suomenkielisellä foorumilla, joten voisitko vaihtaa otsikoksi jonkin suomenkielisen lauseen. Kiitos.
Kubuntu 24.04 LTS
Intel Core i5-10400F
Nvidia GeForce GTX 1660 Super 6 Gt
16 Gt RAM
Intel nvme ssd 512 Gt
Samsung Spinpoint F1 640Gt SATA

nm

  • Käyttäjä
  • Viestejä: 16430
    • Profiili
Vs: 5 second desktop
« Vastaus #2 : 11.06.15 - klo:17.39 »
pääpiirteittäin jotenkin selvää tekstiä mullekin, mutta jaksasko joku vääntää tän kokonaan suomeksi :)

Aika vanhaa juttua, eli ei välttämättä enää pidä kaikilta osin paikkaansa.

SSD-levy koneeseen niin säästyy aikaa ylimääräiseltä virittelyltä. ;)

Postimies

  • Käyttäjä
  • Viestejä: 2644
    • Profiili
Vs: 5 second desktop
« Vastaus #3 : 27.06.15 - klo:03.36 »
Mikä tuossa on epäselvää? Suurimmaksi osaksi komentoja käynnistysnopeuden
lisäämiseksi. Hitaammassa koneessa kernelin kääntäminen ja initrd:stä luopuminen
voi tuoda hieman lisää nopeutta. Näin udev:in ei tarvitse odotella kernelin moduleiden
latautumista jos ne tärkeimmät on käännetty mukaan. Minulla oli aikoinaan EeeBox koneessa
LUbuntu ja Gentoo. Käynnistysnopeudessa ei juuri ollut eroa, vaikka hidas levy ja 1,6 GHz
prosu. Virittelyn tuoma etu voi olla vain muutama sekuntti.

qwertyy

  • Käyttäjä
  • Viestejä: 5779
    • Profiili
Vs: 5 second desktop
« Vastaus #4 : 27.06.15 - klo:15.45 »
Täysin Asus EEE 901 spesifistinen artikkeli. Valtaosa ohjeista ei ole enää millään lailla ajankohtaisia. Lisäksi suurin osa nopeutuksista liittyy kustomoituun kerneliin ja muutamien palveluiden karsimiseen sen myötä.

Postimies

  • Käyttäjä
  • Viestejä: 2644
    • Profiili
Vs: 5 second desktop
« Vastaus #5 : 28.06.15 - klo:12.20 »
Täysin Asus EEE 901 spesifistinen artikkeli. Valtaosa ohjeista ei ole enää millään lailla ajankohtaisia. Lisäksi suurin osa nopeutuksista liittyy kustomoituun kerneliin ja muutamien palveluiden karsimiseen sen myötä.
Ei kernelin kääntäminen kovin paha ole jos löytää laitteelle valmiin config-tiedoston. Menee tyyliin make oldconfig && make.
Hitaalla koneella käännös kyllä kestää, mutta kun turhat on pois yleensä aika nopeasti. Vaikka 15-30 min.
Vaatii tietty gcc, make, .. riippuvuudet. Kernelit ovat paisuneet kovasti. Tilaa pitää olla reilu giga - jos kääntää
ram-levyllä menee hetkessä.

qwertyy

  • Käyttäjä
  • Viestejä: 5779
    • Profiili
Vs: 5 second desktop
« Vastaus #6 : 29.06.15 - klo:21.06 »
Juu no sitä en varsinaisesti tarkoittanutkaan. Lähinnä sitä että tuo ohje ei ylipäätään ole kovin ajankohtainen enää ja osa vinkeistä ei suoranaisesti taida enää edes toimia. Tuossahan ei edes käännetä kerneliä, vaan sekin on erillinen jonkin kustomoima kernelipaketti, joka ladataan valmiina koneelle. Villi veikkaus että kyseistä ydintä ei edes enää löydy mistään.