slitaz-boot-scripts view etc/init.d/rcS @ rev 17

Fix typo in rcS
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jan 06 23:20:52 2008 +0100 (2008-01-06)
parents 14f813c4a28a
children 3659b58f2398
line source
1 #!/bin/sh
2 # /etc/init.d/rcS - Initial boot script for SliTaz GNU/Linux. rcS is the main
3 # initialisation script used to check fs, mount, clean, run scripts and start
4 # daemons.
5 #
6 # Config file is : /etc/rcS.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/rcS.conf
11 # Start by sleeping a bit.
12 echo "Processing /etc/init.d/rcS... "
13 sleep 1
15 # Mount /proc.
16 echo -n "Mounting proc filesystem... "
17 /bin/mount proc
18 status && sleep 1
20 # Before mounting filesystems we check fs specified in the file
21 # /etc/rcS.conf and variable $CHECK_FS.
22 if [ ! "$CHECK_FS" = "" ]; then
23 mount -o remount,ro /
24 for i in $CHECK_FS
25 do
26 echo "Checking filesystem on : $i"
27 /sbin/e2fsck -p $i
28 sleep 2
29 done
30 fi
32 # Remount rootfs rw.
33 echo "Remounting rootfs read/write... "
34 /bin/mount -o remount,rw /
36 # Mount all stuff from /etc/fstab.
37 echo "Mounting all staff from fstab... "
38 /bin/mount -a
40 # Start Udev to populate /dev and handle hotplug events
41 if [ "$UDEV" = "yes" ]; then
42 echo -n "Starting udev daemon..."
43 /sbin/udevd --daemon
44 status
45 echo -n "Executing : udevstart..."
46 /sbin/udevstart
47 status
48 echo "/sbin/udevd" > /proc/sys/kernel/hotplug
49 fi
51 # Handle kernel cmdline parameter modprobe=<module_list>
52 if grep -q " modprobe=" /proc/cmdline; then
53 MODULES=`sed -e 's/.* modprobe=\([^ ]*\).*/\1/' -e 's/,/\n/g' < /proc/cmdline`
54 for i in $MODULES; do
55 echo -n "Loading kernel module $i"
56 /sbin/modprobe $i
57 status
58 done
59 fi
61 # Handle kernel cmdline parameter config=<device>,<path> to source a
62 # disk init script
63 if grep -q " config=" /proc/cmdline; then
64 CONFIG=`cat /proc/cmdline | sed 's/.* config=\([^ ]*\).*/\1/'`
65 DEVICE=${CONFIG%,*}
66 SCRIPT=${CONFIG#*,}
67 echo -n "Source $SCRIPT from $DEVICE... "
68 if /bin/mount -r $DEVICE /mnt; then
69 . /mnt/$SCRIPT
70 /bin/umount /mnt
71 fi
72 status
73 fi
75 # Start syslogd and klogd.
76 if [ "$KERNEL_LOG_DAEMONS" = "yes" ]; then
77 echo -n "Starting system log deamon: syslogd... "
78 /sbin/syslogd -s $SYSLOGD_ROTATED_SIZE && status
79 echo -n "Starting kernel log daemon: klogd... "
80 /sbin/klogd && status
81 else
82 echo "Kernel log daemons are disabled in /etc/rc.conf... "
83 fi
85 # Clean up the system.
86 if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then
87 echo -n "Cleaning up the system... "
88 rm -rf /tmp/*
89 rm -f /var/run/*.pid
90 status
91 else
92 echo "System clean up is disabled in /etc/rcS.conf... "
93 echo "Keeping all tmp and pid files... "
94 status
95 fi
97 # Set up tmp X11 and ICE dir.
98 echo -n "Setting up tmp X11 and ICE unix dir... "
99 /bin/mkdir -p /tmp/.X11-unix
100 /bin/mkdir -p /tmp/.ICE-unix
101 /bin/chmod 1777 /tmp/.X11-unix
102 /bin/chmod 1777 /tmp/.ICE-unix
103 status
105 # Load all modules listed in config file.
106 if [ ! "$LOAD_MODULES" = "" ]; then
107 for mod in $LOAD_MODULES
108 do
109 modprobe $mod
110 done
111 fi
113 # Start all scripts specified with $RUN_SCRIPTS.
114 echo "Executing all initialisation scripts..."
115 for script in $RUN_SCRIPTS
116 do
117 /etc/init.d/$script
118 done
120 # Start all daemons specified with $RUN_DAEMONS.
121 echo "Starting all daemons specified in /etc/rcS.conf..."
122 for daemon in $RUN_DAEMONS
123 do
124 /etc/init.d/$daemon start
125 done
127 # Reset screen and display a bold message.
128 if [ -n "$MESSAGE" ]; then
129 /usr/bin/reset
130 echo -e "\033[1m$MESSAGE\033[0m"
131 fi