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

Add /etc/init.d/hwconf.sh (hardware configuration)
author Christophe Lincoln <pankso@slitaz.org>
date Mon Dec 03 12:19:16 2007 +0100 (2007-12-03)
parents 698d63c56ba9
children 14f813c4a28a
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 config=<device>,<path> to source a
52 # disk init script
53 if grep -q " config=" /proc/cmdline; then
54 CONFIG=`cat /proc/cmdline | sed 's/.* config=\([^ ]*\).*/\1/'`
55 DEVICE=${CONFIG%,*}
56 SCRIPT=${CONFIG#*,}
57 echo -n "Source $SCRIPT from $DEVICE... "
58 if /bin/mount -r $DEVICE /mnt; then
59 . /mnt/$SCRIPT
60 /bin/umount /mnt
61 fi
62 status
63 fi
65 # Start syslogd and klogd.
66 if [ "$KERNEL_LOG_DAEMONS" = "yes" ]; then
67 echo -n "Starting system log deamon: syslogd... "
68 /sbin/syslogd -s $SYSLOGD_ROTATED_SIZE && status
69 echo -n "Starting kernel log daemon: klogd... "
70 /sbin/klogd && status
71 else
72 echo "Kernel log daemons are disabled in /etc/rc.conf... "
73 fi
75 # Clean up the system.
76 if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then
77 echo -n "Cleaning up the system... "
78 rm -rf /tmp/*
79 rm -f /var/run/*.pid
80 status
81 else
82 echo "System clean up is disabled in /etc/rcS.conf... "
83 echo "Keeping all tmp and pid files... "
84 status
85 fi
87 # Set up tmp X11 and ICE dir.
88 echo -n "Setting up tmp X11 and ICE unix dir... "
89 /bin/mkdir -p /tmp/.X11-unix
90 /bin/mkdir -p /tmp/.ICE-unix
91 /bin/chmod 1777 /tmp/.X11-unix
92 /bin/chmod 1777 /tmp/.ICE-unix
93 status
95 # Load all modules listed in config file.
96 if [ ! "$LOAD_MODULES" = "" ]; then
97 for mod in $LOAD_MODULES
98 do
99 modprobe $mod
100 done
101 fi
103 # Start all scripts specified with $RUN_SCRIPTS.
104 echo "Executing all initialisation scripts..."
105 for script in $RUN_SCRIPTS
106 do
107 /etc/init.d/$script
108 done
110 # Start all daemons specified with $RUN_DAEMONS.
111 echo "Starting all daemons specified in /etc/rcS.conf..."
112 for daemon in $RUN_DAEMONS
113 do
114 /etc/init.d/$daemon start
115 done
117 # Reset screen and display a bold message.
118 if [ -n "$MESSAGE" ]; then
119 /usr/bin/reset
120 echo -e "\033[1m$MESSAGE\033[0m"
121 fi