# HG changeset patch # User Christophe Lincoln # Date 1240271181 -7200 # Node ID ae0a8f86229af83da8067e4f2ee9b7c53dfcad88 # Parent b0ae1b67d5ed7c30d1ed56972e69099322f0798c Improve and tidy scripts, start tazhw from rcS and start network.sh earlier diff -r b0ae1b67d5ed -r ae0a8f86229a etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Thu Apr 16 17:35:23 2009 +0200 +++ b/etc/init.d/bootopts.sh Tue Apr 21 01:46:21 2009 +0200 @@ -1,12 +1,14 @@ #!/bin/sh # /etc/init.d/bootopts.sh - SliTaz boot options from the cmdline. # +# Earlier boot options are in rcS: config= and modprobe= +# . /etc/init.d/rc.functions # Update fstab for swapon/swapoff add_swap_in_fstab() { - grep -q "$1 " /etc/fstab || cat >> /etc/fstab <> /etc/fstab < /etc/motd << "EOF" - (°- { La documentation est dans /usr/share/doc. Utiliser 'less -EM' pour, - //\ lire des fichiers et 'clex' pour les gérer, devenir root avec 'su', - v_/_ éditer avec 'nano'. Taper 'startx' pour lancer une session X. } + (°- { Documentation dans /usr/share/doc. Utiliser 'less -EM' pour, + //\ lire des fichiers, devenir root avec 'su' et éditer avec 'nano'. + v_/_ Taper 'startx' pour lancer une session X. } SliTaz GNU/Linux est distribuée dans l'espoir qu'elle sera utile, mais alors SANS AUCUNE GARANTIE. @@ -85,8 +81,8 @@ cat > /etc/motd << "EOF" - (°- { Get documentation in /usr/share/doc. Use 'less -EM' to read files, - //\ become root with 'su', manage files with 'clex', edit using 'nano'. + (°- { Documentation in /usr/share/doc. Use 'less -EM' to read files, + //\ become root with 'su' and edit using 'nano'. v_/_ Type 'startx' to start a X window session. } SliTaz GNU/Linux is distributed in the hope that it will be useful, but diff -r b0ae1b67d5ed -r ae0a8f86229a etc/init.d/local.sh --- a/etc/init.d/local.sh Thu Apr 16 17:35:23 2009 +0200 +++ b/etc/init.d/local.sh Tue Apr 21 01:46:21 2009 +0200 @@ -1,5 +1,6 @@ #!/bin/sh # /etc/init.d/local.sh - Local startup commands. +# # All commands here will be executed at boot time. # . /etc/init.d/rc.functions diff -r b0ae1b67d5ed -r ae0a8f86229a etc/init.d/rcS --- a/etc/init.d/rcS Thu Apr 16 17:35:23 2009 +0200 +++ b/etc/init.d/rcS Tue Apr 21 01:46:21 2009 +0200 @@ -1,14 +1,14 @@ #!/bin/sh -# /etc/init.d/rcS - Initial boot script for SliTaz GNU/Linux. rcS is the main -# initialization script used to check fs, mount, clean, run scripts and start -# daemons. +# /etc/init.d/rcS - Initial boot script for SliTaz GNU/Linux. +# Config file is : /etc/rcS.conf # -# Config file is : /etc/rcS.conf +# rcS is the main initialization script used to check fs, mount, clean, +# run scripts and start daemons. # . /etc/init.d/rc.functions . /etc/rcS.conf -if [ "$1" != "logged" ]; then #logged +if [ "$1" != "logged" ]; then # logged echo "Processing /etc/init.d/rcS... " @@ -17,9 +17,23 @@ /bin/mount proc status +# Start Udev to populate /dev and handle hotplug events +if [ "$UDEV" = "yes" ]; then + echo -n "Starting udev daemon..." + /sbin/udevd --daemon + status + echo -n "Udevadm requesting events from the Kernel..." + udevadm trigger + status + echo -n "Udevadm waiting for the event queue to finish..." + udevadm settle + status + echo "/sbin/udevd" > /proc/sys/kernel/hotplug +fi + # Before mounting filesystems we check fs specified in the file # /etc/rcS.conf and variable $CHECK_FS. -if [ ! "$CHECK_FS" = "" ]; then +if [ -n "$CHECK_FS" ]; then mount -o remount,ro / for i in $CHECK_FS do @@ -36,29 +50,14 @@ echo "Mounting filesystems in fstab... " /bin/mount -a -# Start Udev to populate /dev and handle hotplug events -if [ "$UDEV" = "yes" ]; then - echo -n "Starting udev daemon..." - /sbin/udevd --daemon - status - echo -n "Udevadm requesting events from the Kernel..." - udevadm trigger - status - echo -n "Udevadm waiting for the event queue to finish..." - udevadm settle - status - echo "/sbin/udevd" > /proc/sys/kernel/hotplug -fi - /bin/dmesg > /var/log/dmesg.log vcsa2txt < /dev/vcsa1 | awk 'BEGIN {s=0} /^Processing|^.witching/ {s=1} { if (s) print }' >/var/log/boot.log script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log -else #logged +else # logged # Create /dev/cdrom if needed (symlink does not exist on LiveCD). # Also add /dev/cdrom to fstab if entry does not exist. -# DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3` if grep -q " cdrom=" /proc/cmdline; then DRIVE_NAME=`cat /proc/cmdline | sed 's/.* cdrom=\([^ ]*\).*/\1/'` @@ -121,11 +120,6 @@ status fi -# Eject option -if grep -q -w "eject" /proc/cmdline; then - eject /dev/cdrom -fi - # Mount /proc/bus/usb. if [ -d /proc/bus/usb ]; then echo -n "Mounting /proc/bus/usb filesystem... " @@ -146,26 +140,24 @@ # Clean up the system. if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then echo -n "Cleaning up the system... " - rm -rf /tmp/* /tmp/.* 2> /dev/null - rm -f /var/run/*.pid /var/run/dbus/* /var/run/hald/pid - rm -f /var/lock/* + /bin/rm -rf /tmp /var/run/*.pid /var/run/dbus/* \ + /var/run/hald/pid /var/lock/* + /bin/mkdir -p /tmp && /bin/chmod 1777 /tmp status else echo "System clean up is disabled in /etc/rcS.conf... " - echo "Keeping all tmp and pid files... " + echo -n "Keeping all tmp and pid files... " status fi # Set up tmp X11 and ICE dir. echo -n "Setting up tmp X11 and ICE unix dir... " -/bin/mkdir -p /tmp/.X11-unix -/bin/mkdir -p /tmp/.ICE-unix -/bin/chmod 1777 /tmp/.X11-unix -/bin/chmod 1777 /tmp/.ICE-unix +/bin/mkdir -p /tmp/.X11-unix /tmp/.ICE-unix +/bin/chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix status # Load all modules listed in config file. -if [ ! "$LOAD_MODULES" = "" ]; then +if [ -n "$LOAD_MODULES" ]; then for mod in $LOAD_MODULES do modprobe $mod @@ -175,6 +167,12 @@ # Be quiet on configuration to avoid message overwriting ncurses dialog echo "0 0 0 0" > /proc/sys/kernel/printk +# Detect PCI and USB devices with Tazhw from slitaz-tools. We load +# kernel module only at first boot or in LiveCD mode. +if [ ! -s /var/lib/detected-modules ]; then + /sbin/tazhw init +fi + # Start all scripts specified with $RUN_SCRIPTS. echo "Executing all initialization scripts..." for script in $RUN_SCRIPTS @@ -185,7 +183,7 @@ done # Re-source main config file. In Live mode, daemons list can be modified -# by boot options. +# by boot options (screen=text will remove slim). . /etc/rcS.conf # Start all daemons specified with $RUN_DAEMONS. diff -r b0ae1b67d5ed -r ae0a8f86229a etc/rcS.conf --- a/etc/rcS.conf Thu Apr 16 17:35:23 2009 +0200 +++ b/etc/rcS.conf Tue Apr 21 01:46:21 2009 +0200 @@ -25,10 +25,11 @@ LOAD_MODULES="vfat nls_utf8 ohci_hcd" # Initialization scripts to run at boot time. Boot order is important, -# bootopts.sh (boot options) must start first, then you are free to choose. +# bootopts.sh (boot options) must start first, hwconf after network (tazx +# need an active connexion to install Xorg) then you are free to choose. # Note that the local.sh script exists to let you quickly add some local startup # commands. -RUN_SCRIPTS="bootopts.sh i18n.sh hwconf.sh network.sh local.sh" +RUN_SCRIPTS="bootopts.sh i18n.sh network.sh hwconf.sh local.sh" # Daemons to start at boot time. SliTaz only provides a few daemons: firewall, # Web server (lighttpd), SSH server (dropbear) and rsyncd, so boot order is