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

satart X a bit before and use dialog progress to update rpi kernel
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 30 21:55:08 2014 +0200 (2014-04-30)
parents c34a9ff05fd1
children 45bca87a4ab8
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 # Run post install configs on first boot
53 if [ ! -f "/var/lib/slitaz/post-install" ]; then
54 /etc/init.d/post-install.sh
55 fi
57 # Clean up /tmp
58 echo -n "Cleaning up temporary files: /tmp"
59 rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp
60 status
62 # Start syslogd and klogd
63 echo -n "Starting system log daemons: syslogd/klogd..."
64 syslogd -s ${SYSLOGD_SIZE} && klogd
65 status
67 # Load all modules from config file
68 if [ "$LOAD_MODULES" ]; then
69 colorize 33 "Loading Kernel modules..."
70 for mod in ${LOAD_MODULES}; do
71 modprobe -v $mod | tee -a ${log}
72 done
73 fi
75 # Start all init scripts
76 for script in ${RUN_SCRIPTS}; do
77 colorize 34 "Processing: /etc/init.d/$script"
78 /etc/init.d/$script | tee -a ${log}
79 done
81 # Start X session
82 if [ "$LOGIN_MANAGER" ] && [ -x "/etc/init.d/$LOGIN_MANAGER" ]; then
83 colorize 36 "Starting X environment..."
84 /etc/init.d/$LOGIN_MANAGER start >/dev/null &
85 fi
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 newline
96 colorize 32 "$MESSAGE"
98 # Back to a verbose mode but wait to finish with a clean boot
99 (sleep 4; echo "7 4 1 7" > /proc/sys/kernel/printk) &