slitaz-boot-scripts rev 157

Add option FAST_BOOT_X (fastbootx) to start X 4-6 sec earlier
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 26 14:10:28 2009 +0200 (2009-04-26)
parents 3f862c04d344
children 6d1034b2830e
files etc/init.d/rcS etc/rcS.conf
line diff
     1.1 --- a/etc/init.d/rcS	Sun Apr 26 01:14:33 2009 +0200
     1.2 +++ b/etc/init.d/rcS	Sun Apr 26 14:10:28 2009 +0200
     1.3 @@ -50,17 +50,49 @@
     1.4  echo "Mounting filesystems in fstab... "
     1.5  /bin/mount -a
     1.6  
     1.7 -/bin/dmesg > /var/log/dmesg.log
     1.8 +# Store boot messages to log files.
     1.9 +/bin/dmesg > /var/log/dmesg.log &
    1.10  vcsa2txt < /dev/vcsa1 | awk 'BEGIN {s=0} /^Processing|^.witching/ {s=1} { if (s) print }' >/var/log/boot.log
    1.11  script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log
    1.12  
    1.13  else # logged
    1.14  
    1.15 +# Clean up the system.
    1.16 +if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then
    1.17 +	echo -n "Cleaning up the system... "
    1.18 +	/bin/rm -rf /tmp /var/run/*.pid /var/run/dbus/* \
    1.19 +		/var/run/hald/pid /var/lock/*
    1.20 +	/bin/mkdir -p /tmp && /bin/chmod 1777 /tmp
    1.21 +	status
    1.22 +else
    1.23 +	echo "System clean up is disabled in /etc/rcS.conf... "
    1.24 +	echo -n "Keeping all tmp and pid files... "
    1.25 +	status
    1.26 +fi
    1.27 +
    1.28 +# Set up tmp X11 and ICE dir.
    1.29 +echo -n "Setting up tmp X11 and ICE unix dir... "
    1.30 +/bin/mkdir -p /tmp/.X11-unix /tmp/.ICE-unix
    1.31 +/bin/chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix
    1.32 +status
    1.33 +
    1.34 +# Fast boot into X for HD install or custom Live system. We need 
    1.35 +# keymap settings since Xvesa dump the console mapping and a correct
    1.36 +# slim configuration for screen resolution. DBUS and HAL must also start
    1.37 +# befor X session (manual login or autologin) to have devices in PCmanFM.
    1.38 +if [ "$FAST_BOOT_X" = "yes" ] || grep -q -w "fastbootx" /proc/cmdline; then
    1.39 +	/etc/init.d/i18n.sh
    1.40 +	/etc/init.d/dbus start
    1.41 +	/etc/init.d/hald start
    1.42 +	/etc/init.d/slim start &
    1.43 +fi
    1.44 +
    1.45  # Create /dev/cdrom if needed (symlink does not exist on LiveCD).
    1.46  # Also add /dev/cdrom to fstab if entry does not exist.
    1.47 -DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
    1.48  if grep -q " cdrom=" /proc/cmdline; then
    1.49  	DRIVE_NAME=`cat /proc/cmdline | sed 's/.* cdrom=\([^ ]*\).*/\1/'`
    1.50 +else
    1.51 +	DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
    1.52  fi
    1.53  if [ -n "$DRIVE_NAME" -a ! "`readlink /dev/cdrom`" ]; then
    1.54  	echo -n "Creating symlink : /dev/cdrom..."
    1.55 @@ -137,25 +169,6 @@
    1.56  	echo "Kernel log daemons are disabled in /etc/rc.conf... "
    1.57  fi
    1.58  
    1.59 -# Clean up the system.
    1.60 -if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then
    1.61 -	echo -n "Cleaning up the system... "
    1.62 -	/bin/rm -rf /tmp /var/run/*.pid /var/run/dbus/* \
    1.63 -		/var/run/hald/pid /var/lock/*
    1.64 -	/bin/mkdir -p /tmp && /bin/chmod 1777 /tmp
    1.65 -	status
    1.66 -else
    1.67 -	echo "System clean up is disabled in /etc/rcS.conf... "
    1.68 -	echo -n "Keeping all tmp and pid files... "
    1.69 -	status
    1.70 -fi
    1.71 -
    1.72 -# Set up tmp X11 and ICE dir.
    1.73 -echo -n "Setting up tmp X11 and ICE unix dir... "
    1.74 -/bin/mkdir -p /tmp/.X11-unix /tmp/.ICE-unix
    1.75 -/bin/chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix
    1.76 -status
    1.77 -
    1.78  # Load all modules listed in config file.
    1.79  if [ -n "$LOAD_MODULES" ]; then
    1.80  	for mod in $LOAD_MODULES
    1.81 @@ -204,4 +217,4 @@
    1.82  	echo -e "\033[1m$MESSAGE\033[0m"
    1.83  fi
    1.84  
    1.85 -fi #logged
    1.86 +fi # logged
     2.1 --- a/etc/rcS.conf	Sun Apr 26 01:14:33 2009 +0200
     2.2 +++ b/etc/rcS.conf	Sun Apr 26 14:10:28 2009 +0200
     2.3 @@ -2,10 +2,6 @@
     2.4  # Config file used by /etc/init.d/rcS
     2.5  #
     2.6  
     2.7 -# Start Kernel log daemons (syslogd and klogd).
     2.8 -KERNEL_LOG_DAEMONS="yes"
     2.9 -SYSLOGD_ROTATED_SIZE="60"
    2.10 -
    2.11  # Use udev to populate /dev and handles hotplug events.
    2.12  UDEV="yes"
    2.13  
    2.14 @@ -17,6 +13,15 @@
    2.15  # /etc/fstab. Example : CHECK_FS="/dev/hda5 /dev/hdb1"
    2.16  CHECK_FS=""
    2.17  
    2.18 +# Fast boot into X by setting the system keymap-locale and starting 
    2.19 +# the Slim login manager earlier at boot time. If fast X is enabled
    2.20 +# then dbus, hald and slim can be removed from RUN_DAEMONS.
    2.21 +FAST_BOOT_X="no"
    2.22 +
    2.23 +# Start Kernel log daemons (syslogd and klogd).
    2.24 +KERNEL_LOG_DAEMONS="yes"
    2.25 +SYSLOGD_ROTATED_SIZE="60"
    2.26 +
    2.27  # Kernel modules to automatically load at boot time. You can use 'modprobe -l'
    2.28  # to get a list of all kernel modules available.
    2.29  #
    2.30 @@ -29,13 +34,12 @@
    2.31  # need an active connexion to install Xorg) then you are free to choose.
    2.32  # Note that the local.sh script exists to let you quickly add some local startup
    2.33  # commands.
    2.34 -RUN_SCRIPTS="bootopts.sh i18n.sh network.sh hwconf.sh local.sh"
    2.35 +RUN_SCRIPTS="bootopts.sh network.sh i18n.sh hwconf.sh local.sh"
    2.36  
    2.37  # Daemons to start at boot time. SliTaz only provides a few daemons: firewall,
    2.38  # Web server (lighttpd), SSH server (dropbear) and rsyncd, so boot order is
    2.39  # not really important, but dbus/hald should be started before slim.
    2.40 -RUN_DAEMONS="dbus hald firewall lighttpd slim"
    2.41 +RUN_DAEMONS="dbus hald firewall slim"
    2.42  
    2.43  # Pre login bold message.
    2.44  MESSAGE="Welcome to your box."
    2.45 -