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

Add slim support and custom rpi theme
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 23 14:37:38 2014 +0100 (2014-03-23)
parents d81795f58d28
children ba52d096f50f
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 "Mounting tmpfs filesystem on: /run"
27 mount -t tmpfs tmpfs /run
28 mount --bind /run /var/run
30 # Store boot messages to log files
31 log="/var/log/boot.log"
32 dmesg > /var/log/dmesg.log &
33 echo "$0" > ${log}
35 # Be quiet at boot
36 echo "0 0 0 0" > /proc/sys/kernel/printk
38 # Use udev and disable hotplug helper (udevd listen to netlink)
39 if [ -x "/sbin/udevd" ]; then
40 echo "" > /proc/sys/kernel/hotplug
41 echo "Starting udev daemon..."
42 udevd --daemon 2>/dev/null
43 udevadm trigger
44 udevadm settle --timeout=120
45 else
46 # Fallback to Busybox mdev
47 echo -n "Creating device nodes: /sbin/mdev -s"
48 echo "/sbin/mdev" > /proc/sys/kernel/hotplug
49 mdev -s; status
50 fi
52 # Clean up /tmp
53 echo -n "Cleaning up temporary files: /tmp"
54 rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp
55 status
57 # Start syslogd and klogd
58 echo -n "Starting system log daemons: syslogd/klogd..."
59 syslogd -s ${SYSLOGD_SIZE} && klogd
60 status
62 # Run post install configs on first boot --> into a script ?
63 if [ ! -f "/var/lib/slitaz/post-install" ]; then
64 colorize 33 "Running post install configs..."
65 mkdir -p /var/lib/slitaz
66 echo "$ARCH" > /var/lib/slitaz/post-install
67 [ -s /etc/keymap.conf ] || tazkeymap
68 #[ -s /etc/locale.conf ] || tazlocale
69 slitaz-config root_passwd
70 # add a user: slitaz-config add_user
71 fi
73 # Load all modules from config file
74 if [ "$LOAD_MODULES" ]; then
75 colorize 33 "Loading Kernel modules..."
76 for mod in ${LOAD_MODULES}; do
77 modprobe -v $mod | tee -a ${log}
78 done
79 fi
81 # Start all init scripts
82 for script in ${RUN_SCRIPTS}; do
83 colorize 34 "Processing: /etc/init.d/$script"
84 /etc/init.d/$script | tee -a ${log}
85 done
87 # Start all daemons
88 if [ "$RUN_DAEMONS" ]; then
89 colorize 33 "Starting all daemons..."
90 for daemon in ${RUN_DAEMONS}; do
91 /etc/init.d/$daemon start
92 done
93 fi
95 # Start X session
96 if [ "$LOGIN_MANAGER" ] && [ -x "/etc/init.d/$LOGIN_MANAGER" ]; then
97 #mkdir -p /var/run/dbus
98 #/etc/init.d/dbus start
99 colorize 36 "Starting X environment..."
100 /etc/init.d/$LOGIN_MANAGER start >/dev/null &
101 fi
103 newline
104 colorize 32 "$MESSAGE"
106 # Back to a verbose mode but wait to finish with a clean boot
107 (sleep 4; echo "7 4 1 7" > /proc/sys/kernel/printk) &