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

Add a custom Pi JWM desktop menu, rm xcal (in slitaz-tools now)
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 02 21:53:16 2014 +0200 (2014-05-02)
parents 45bca87a4ab8
children
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 [ -x "/etc/init.d/$LOGIN_MANAGER" ]; then
83 colorize 36 "Starting X environment..."
84 # We need Xorg 40-Keyboard.conf and SliTaz applications.conf
85 if [ ! -s "/etc/X11/xorg.conf.d/40-Keyboard.conf" ]; then
86 echo "Configuring Xorg server..." && HOME="/root"
87 tazx init
88 fi
89 /etc/init.d/$LOGIN_MANAGER start >/dev/null &
90 fi
92 # Start all daemons
93 if [ "$RUN_DAEMONS" ]; then
94 colorize 33 "Starting all daemons..."
95 for daemon in ${RUN_DAEMONS}; do
96 /etc/init.d/$daemon start
97 done
98 fi
100 newline
101 colorize 32 "$MESSAGE"
103 # Back to a verbose mode but wait to finish with a clean boot
104 (sleep 4; echo "7 4 1 7" > /proc/sys/kernel/printk) &