slitaz-boot-scripts rev 303

rcS: /dev/cdrom is created by udev and add bin/rcSconf for rcS.conf migration
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jun 01 22:00:52 2012 +0200 (2012-06-01)
parents 175315b7699d
children 1ac4d1be812e
files bin/rcSconf etc/init.d/rcS
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bin/rcSconf	Fri Jun 01 22:00:52 2012 +0200
     1.3 @@ -0,0 +1,62 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# Update and clean-up /etc/rcS.conf
     1.7 +#
     1.8 +
     1.9 +# X is now started earlier by system.sh
    1.10 +up_daemons() {
    1.11 +	echo $RUN_DAEMONS | sed \
    1.12 +		-e s/dbus// -e s/hald// -e s/slim// -e s'/   //' -e s'/  //'
    1.13 +}
    1.14 +
    1.15 +case "$1" in
    1.16 +	up)
    1.17 +		[ $(id -u) != 0 ] && exit 0
    1.18 +		#check_root: broken gettext in libtaz.sh
    1.19 +		. /etc/rcS.conf
    1.20 +		cp -f /etc/rcS.conf /etc/slitaz/rcS.conf.bak
    1.21 +		echo "Updating: /etc/rcS.conf"
    1.22 +		cat > /etc/rcS.conf << EOT
    1.23 +# /etc/rcS.conf : Initial boot script configuration for SliTaz GNU/Linux
    1.24 +# Sourced by    : /etc/init.d/rcS
    1.25 +#
    1.26 +
    1.27 +# Use udev to populate /dev and handle hotplug events
    1.28 +UDEV="$UDEV"
    1.29 +
    1.30 +# Clean up the system removing all tmp and pid files
    1.31 +CLEAN_UP_SYSTEM="$CLEAN_UP_SYSTEM"
    1.32 +
    1.33 +# Filesystems to check integrity of at boot time. You should check the
    1.34 +# rootfs (where SliTaz is installed) and all partitions listed in fstab.
    1.35 +# Example: CHECK_FS="/dev/hda5 /dev/hdb1"
    1.36 +CHECK_FS="$CHECK_FS"
    1.37 +
    1.38 +# Syslogd: Max size (KB) before rotation
    1.39 +SYSLOGD_ROTATED_SIZE="$SYSLOGD_ROTATED_SIZE"
    1.40 +
    1.41 +# Kernel modules to load at boot time
    1.42 +LOAD_MODULES="$LOAD_MODULES"
    1.43 +
    1.44 +# X Login manager: slim or lxdm, empty to disable X
    1.45 +LOGIN_MANAGER="slim"
    1.46 +
    1.47 +# Initialization scripts to run at boot time. The local.sh script
    1.48 +# let you quickly add some local startup commands.
    1.49 +RUN_SCRIPTS="bootopts.sh system.sh network.sh local.sh"
    1.50 +
    1.51 +# Daemons to start at boot time. DBUS daemon is started before the
    1.52 +# login manager and from: /etc/init.d/system.sh
    1.53 +RUN_DAEMONS="$(up_daemons)"
    1.54 +
    1.55 +# Pre login message
    1.56 +MESSAGE="Welcome to your box"
    1.57 +EOT
    1.58 +		diff /etc/slitaz/rcS.conf.bak /etc/rcS.conf > \
    1.59 +			/etc/slitaz/rcS.conf.diff ;;
    1.60 +	show) less -E /etc/rcS.conf ;;
    1.61 +	show-diff) less -E /etc/slitaz/rcS.conf.diff ;;
    1.62 +	clean) rm -f /etc/slitaz/rcS.conf* ;;
    1.63 +	*) echo "Usage: $(basename $0) [up|show|show-diff|clean]" ;;
    1.64 +esac
    1.65 +exit 0
     2.1 --- a/etc/init.d/rcS	Fri Jun 01 21:46:07 2012 +0200
     2.2 +++ b/etc/init.d/rcS	Fri Jun 01 22:00:52 2012 +0200
     2.3 @@ -106,20 +106,6 @@
     2.4  	echo "System clean up is disabled in: /etc/rcS.conf"
     2.5  fi
     2.6  
     2.7 -# Create /dev/cdrom if needed (symlink does not exist on LiveCD).
     2.8 -# Also add /dev/cdrom to fstab if entry does not exist.
     2.9 -if [ "$CDROM" ]; then
    2.10 -	DRIVE_NAME=${CDROM#/dev/}
    2.11 -else
    2.12 -	DRIVE_NAME=$(fgrep -s "drive name" /proc/sys/dev/cdrom/info | cut -f 3)
    2.13 -fi
    2.14 -if [ "$DRIVE_NAME" -a ! "$(readlink /dev/cdrom)" ]; then
    2.15 -	echo -n "Creating symlink : /dev/cdrom..."
    2.16 -	ln -s /dev/$DRIVE_NAME /dev/cdrom
    2.17 -	ln -s /dev/$DRIVE_NAME /dev/dvd
    2.18 -	status
    2.19 -fi
    2.20 -
    2.21  # Handle kernel cmdline parameter modprobe=<module_list>
    2.22  if [ "$MODPROBE" ]; then
    2.23  	MODULES=$(sed -e 's/.* modprobe=\([^ ]*\).*/\1/' -e 's/,/\n/g' < /proc/cmdline)