Ricardo Nabinger Sanchez wrote:
> On Tue, 09 Sep 2008 11:33:09 +0200 Jonatan Liljedahl
> <[EMAIL PROTECTED]> wrote:
> 
>> I just did a simple measurement and got 18 seconds from grub to X.
> 
> That's pretty nice.

I'm now down to 16 after some more optimizations. Instead of waiting for
udevsettle, I simply copied everything from /dev to /lib/udev/devices on
a fresh boot with everything up and running, and commented out
udevsettle in the Udev Task. So when the Task starts it will copy all
those devices into /dev, which is much faster than waiting on
udevtrigger to settle.

I made some other changes with the boot system, some of which might be
interesting also for non-EeePC users?

1) First off, I boot from an initramfs with this init script:

# init:
echo "Starting initramfs /init script..."
PATH=/bin:/sbin
mount -t proc  proc /System/Kernel/Status
mount -t sysfs none /System/Kernel/Objects
mount -t tmpfs tmpfs /dev
ROOTDEV=`cat /proc/cmdline | sed 's/.*root=// ; s/ .*//'`
if [ "$ROOTDEV" = "" ]; then
    ROOTDEV="LABEL=GOBO_EEE_ROOT"
fi
export ROOTDEV
echo /bin/mdev > /proc/sys/kernel/hotplug
insmod /lib/usbcore.ko
insmod /lib/uhci-hcd.ko
insmod /lib/ehci-hcd.ko
insmod /lib/libusual.ko
insmod /lib/scsi_mod.ko
insmod /lib/sd_mod.ko
insmod /lib/reiserfs.ko
insmod /lib/jbd.ko
insmod /lib/mbcache.ko
insmod /lib/ext3.ko
insmod /lib/ext2.ko
insmod /lib/libata.ko
insmod /lib/ata_generic.ko
insmod /lib/ahci.ko
insmod /lib/ata_piix.ko
insmod /lib/usb-storage.ko
mdev -s
if grep -q WAITUSB /proc/cmdline; then
    echo "Waiting for USB..."
    sleep 10
fi
grep -q NOINIT /proc/cmdline && exec busybox sh
echo "Mounting ROOT..."
mount $ROOTDEV /mnt/root -o ro || exec busybox sh
echo "Moving mounts..."
mount --move /dev /mnt/root/System/Kernel/Devices
mount --move /System/Kernel/Objects /mnt/root/System/Kernel/Objects
cp -af /mnt/root/System/Kernel/Devices/* /dev
echo "Switching root..."
exec /sbin/switch_root /mnt/root /sbin/init || exec busybox sh
echo "Emergency shell"
exec busybox sh
# End of file

I'm not sure the cp -af thing is needed, there should be some devices in
/dev after mount --move..

2) I replaced /etc/mtab with a symlink to /proc/mounts (a much debated
technique, but the last thing I heard was that it is the right thing to
do on modern systems)

3) I commented out mounting of /dev in the Udev Task (since I do mount
--move on it in the initramfs), and also commented out udevsettle.

4) My Bootscripts looks like this:

# Bootup:
# Note that I don't mount /sys here, since it's done
# already in initramfs. I also don't need to clean mtab and remount
# to get a fresh mtab, since I use /proc/mounts instead.
Exec "Remounting root file system"        mount -n -o remount,rw /
Exec "Cleaning up any stale lock files"   eval "find \
  $goboVariable/{run,lock}/ -type f | grep -v utmp | \
  xargs -i rm -rf {}; rm -rf  $goboTemp/.X*-lock"
Exec "Starting Udev"                      Udev Start
echo -n > /var/log/messages
Daemon                                    syslogd -n -m 0
Exec "Checking remaining file systems"    fsck -p -C -T -A -R
Exec "Configuring local network interface" ifconfig lo 127.0.0.1\
  netmask 255.0.0.0
Exec "Setting clock"                      SetClock Start &
Exec "Mounting local file systems"        mount -a -t \
  nonfs,nosmbfs,nocifs,noproc,noswap,nodevpts,nosysfs
Exec "Setting hostname to $HostName"      hostname "$HostName"
[ "${UserDefinedModules[*]}" ] && \
Exec "Loading user-defined kernel modules" LoadModules
Exec "Creating utmp and wtmp"             CreateChmod 644\
  $goboVariable/{run/utmp,log/wtmp}
# End of file

# CommonPost:
Exec "Setting initial CPU speed"          init_cpu_speed
Exec "Starting ifplugd"                   ifplugd_init start
Exec "Starting ssh daemon"                OpenSSH Start
Exec "Starting ACPID"                     Acpid Start
Exec "Starting cardreader"                start_cardreader_poll &
Exec "Starting message bus"               MessageBus Start
Exec "Restoring mixer settings"           Alsactl Start
# End of file

# Graphic:
source BootUp
Exec "Loading login manager..." slim -d
source CommonPost
# End of file

# Shutdown:
Exec "Shutting down Wifi"                    /etc/acpi/wlan.sh poweroff
Exec "Storing mixer settings"                Alsactl Stop
Exec "Unloading audio"                       rmmod snd-hda-intel
Exec "Saving system time"                    SetClock Stop
Exec "Stopping system log daemon"            killall syslogd
Exec "Stopping ifplugd..."                   ifplugd_init stop
Exec "Sending all processes the TERM signal" killall5 -15
sleep 1
Exec "Sending all processes the KILL signal" killall5 -9
Exec "Removing login records"                rm -f \
  ${goboVariable}/run/utmp
Exec "Unmounting all other file systems"     umount -a -r -v
sleep 1
# End of file

I still get double mounts on /System/Kernel/Status, maybe a mount --bind
in initramfs init and uncommenting the mount ${goboStatus} in BootDriver
would do it? Why is there no "mount if not already mounted" switch for
mount?

5) I load these modules in BootOptions UserDefinedModules:
    pciehp
    atl2
    eeepc_acpi
    snd-hda-intel
    unionfs
    fuse
    snd-seq

>> Right now the longest time is the X server starting, it flickers
>> the screen a couple of seconds before showing the login screen. May
>> be something with the videodriver, or perhaps it's possible to
>> tweak xorg.conf to get shorter startup time. (maybe some probing
>> going on that could be hardcoded??)
> 
> This sounds like at least modelines probing, if not driving probing
> also.  I don't know how much time X would still spend on fetching
> EDID data and checking that your settings are sane (driver and
> modeline), if you can skip probing altogether.

Any ideas of how this could be done? I'll attach my xorg.conf in case
someone wants to take a look. :)

-- 
/Jonatan         [ http://kymatica.com ]
Section "ServerLayout"
        Identifier     "Xandros"
        Screen      0  "Screen1"
        InputDevice    "keyboard"
        InputDevice    "mouse"
#       InputDevice    "synaptics"
EndSection

Section "Files"
        RgbPath      "/System/Links/Shared/X11/rgb"
        ModulePath   "/System/Links/Libraries/xorg/modules"
        FontPath     "/Files/Fonts/Misc/"
        FontPath     "/Files/Fonts/TTF/"
        FontPath     "/Files/Fonts/OTF"
        FontPath     "/Files/Fonts/Type1/"
        FontPath     "/Files/Fonts/100dpi/"
        FontPath     "/Files/Fonts/75dpi/"
EndSection

Section "Module"
        Load  "glx"
        Load  "dri"
        Load  "extmod"
#       Load  "synaptics"
EndSection

Section "ServerFlags"
        Option          "AllowMouseOpenFail"
        Option          "BlankTime" "5"
        Option          "DontVTSwitch"  "false"
        Option          "AIGLX"   "false"
EndSection

Section "InputDevice"
        Identifier  "keyboard"
        Driver      "kbd"
        Option      "CoreKeyboard"
        Option      "XkbRules" "xorg"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "se"
        Option      "XkbVariant" "basic"
EndSection

Section "InputDevice"
        Identifier  "mouse"
        Driver      "mouse"
        Option      "Device" "/dev/input/mice"
        Option      "Protocol" "IMPS/2"
        Option      "Emulate3Buttons" "yes"
        Option      "ZAxisMapping" "4 5"
        Option      "CorePointer"
EndSection

Section "InputDevice"
        Identifier  "synaptics"
        Driver      "synaptics"
        Option      "Device"           "/dev/psaux"
        Option      "Protocol"         "auto-dev"
        Option      "LeftEdge"         "1400"
        Option      "RightEdge"        "5900"
        Option      "TopEdge"          "1400"
        Option      "BottomEdge"       "4500"
        Option      "PalmDetect"       "0"
        Option      "SHMConfig"        "true"
        Option      "SendCoreEvents"   "yes"
        Option      "HorizScrollDelta" "0"
        Option      "VertScrollDelta"  "155"
        Option      "RBCornerButton"   "0"
        Option      "RTCornerButton"   "0"
        Option      "TapButton2"       "2"
        Option      "TapButton3"       "3"
        Option      "MinSpeed"         "0.095"
        Option      "MaxSpeed"         "0.38"
        Option      "HorizEdgeScroll"  "0"
        Option      "VertEdgeScroll"   "0"
        Option      "VertTwoFingerScroll" "1"
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "ASUS"
        ModelName    "Eee PC P900"
        Modeline     "1024x600"  48.96  1024 1064 1168 1312  600 601 604 622  
-HSync +Vsync
EndSection

Section "Device"
        Identifier  "Device1"
        Driver      "intel"
        VendorName  "Intel Corporation"
        BoardName   "Mobile 915GM/GMS/910GML Express Graphics Controller"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        Identifier  "Device0"
        Driver      "i810"
        VendorName  "Intel Corporation"
        BoardName   "Mobile 915GM/GMS/910GML Express Graphics Controller"
        BusID       "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen1"
        Device     "Device1"
        Monitor    "Monitor1"
        DefaultDepth     16
        SubSection "Display"
                Depth     8
                Virtual  1024 768
        EndSubSection
        SubSection "Display"
                Depth     15
                Virtual  1024 768
        EndSubSection
        SubSection "Display"
                Depth     16
                Virtual  1024 768
        EndSubSection
        SubSection "Display"
                Depth     24
                Virtual  1024 768
        EndSubSection
EndSection

Section "DRI"
        Mode         0666
EndSection

Section "Extensions"
        Option      "Composite" "Disable"
EndSection




_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to