slitaz-arm view rootfs/etc/init.d/rcS @ rev 58

Bunch og new stuff: more doc, st fixes, tazberry
author Christophe Lincoln <pankso@slitaz.org>
date Sat Mar 15 14:54:17 2014 +0100 (2014-03-15)
parents ffd23dba61e3
children 45169f4d9df0
line source
1 #!/bin/sh
2 #
3 # /etc/init.d/rcS : Initial boot script for SliTaz ARM
4 # Config file is : /etc/rcS.conf
5 #
6 # rcS is the main initialization script used to check fs, mount, clean,
7 # run scripts and start daemons. This is a custom script for ARM to get
8 # a faster boot and skip things like handling cdrom.
9 #
10 # Copyright (C) 2012-2014 SliTaz ARM - BSD License
11 #
12 . /lib/libtaz.sh
13 . /etc/rcS.conf
15 # Set default path
16 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
18 echo $(colorize 34 "Processing: /etc/init.d/rcS")
20 # Mount all from: /etc/fstab
21 echo "Mounting filesystems in fstab..."
22 mkdir -p /dev/pts /dev/shm
23 mount -a
25 # Mount /run as tmpfs so runtime data are not written to disk
26 echo -n "Mounting tmpfs filesystem on: /run"
27 mount -t tmpfs tmpfs /run
28 mount --bind /run /var/run
29 status
31 # Store boot messages to log files
32 log="/var/log/boot.log"
33 dmesg > /var/log/dmesg.log &
34 echo "$0" > ${log}
36 # Be quiet at boot
37 echo "0 0 0 0" > /proc/sys/kernel/printk
39 # Use udev and disable hotplug helper (udevd listen to netlink)
40 if [ -x "/sbin/udevd" ]; then
41 echo "" > /proc/sys/kernel/hotplug
42 echo "Starting udevd & udevadm [trigger settle]..."
43 udevd --daemon 2>/dev/null
44 udevadm trigger
45 udevadm settle --timeout=120
46 else
47 # Fallback to Busybox mdev
48 echo "Creating device nodes: /sbin/mdev -s"
49 echo "/sbin/mdev" > /proc/sys/kernel/hotplug
50 mdev -s
51 status
52 fi
54 # Clean up /tmp
55 echo -n "Cleaning up temporary files: /tmp"
56 rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp
57 status
59 # Start syslogd and klogd
60 echo -n "Starting system log daemons: syslogd/klogd..."
61 syslogd -s ${SYSLOGD_SIZE} && klogd
62 status
64 # Run post install configs on first boot --> into a script ?
65 if [ ! -f "/var/lib/slitaz/post-install" ]; then
66 colorize 33 "Running post install configs..."
67 mkdir -p /var/lib/slitaz
68 echo "$ARCH" > /var/lib/slitaz/post-install
69 [ -s /etc/keymap.conf ] || tazkeymap
70 #[ -s /etc/locale.conf ] || tazlocale
71 # change root password
72 # add a user
73 fi
75 # Load all modules from config file
76 if [ "$LOAD_MODULES" ]; then
77 colorize 33 "Loading Kernel modules..."
78 for mod in ${LOAD_MODULES}; do
79 modprobe -v $mod
80 done
81 fi
83 # Start all init scripts
84 for script in ${RUN_SCRIPTS}; do
85 colorize 34 "Processing: /etc/init.d/$script"
86 /etc/init.d/$script
87 done
89 # Start all daemons
90 if [ "$RUN_DAEMONS" ]; then
91 colorize 33 "Starting all daemons..."
92 for daemon in ${RUN_DAEMONS}; do
93 /etc/init.d/$daemon start
94 done
95 fi
97 # System time option
98 if fgrep -q 'rdate' /proc/cmdline; then
99 echo -n "Setting system date..."
100 rdate -s 203.129.68.14 2>/dev/null
101 status
102 fi
104 newline
105 colorize 32 "$MESSAGE"
107 # Back to a verbose mode but wait to finish with a clean boot
108 (sleep 4; echo "7 4 1 7" > /proc/sys/kernel/printk) &