diff options
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh new file mode 100755 index 0000000000..bd11f9a2fc --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | |||
@@ -0,0 +1,78 @@ | |||
1 | ### BEGIN INIT INFO | ||
2 | # Provides: bootmisc | ||
3 | # Required-Start: $local_fs mountvirtfs | ||
4 | # Required-Stop: $local_fs | ||
5 | # Default-Start: S | ||
6 | # Default-Stop: 0 6 | ||
7 | # Short-Description: Misc and other. | ||
8 | ### END INIT INFO | ||
9 | |||
10 | . /etc/default/rcS | ||
11 | # | ||
12 | # Put a nologin file in /etc to prevent people from logging in before | ||
13 | # system startup is complete. | ||
14 | # | ||
15 | if test "$DELAYLOGIN" = yes | ||
16 | then | ||
17 | echo "System bootup in progress - please wait" > /etc/nologin | ||
18 | cp /etc/nologin /etc/nologin.boot | ||
19 | fi | ||
20 | |||
21 | # | ||
22 | # Set pseudo-terminal access permissions. | ||
23 | # | ||
24 | if test -c /dev/ttyp0 | ||
25 | then | ||
26 | chmod 666 /dev/tty[p-za-e][0-9a-f] | ||
27 | chown root:tty /dev/tty[p-za-e][0-9a-f] | ||
28 | fi | ||
29 | |||
30 | # | ||
31 | # Apply /proc settings if defined | ||
32 | # | ||
33 | SYSCTL_CONF="/etc/sysctl.conf" | ||
34 | if [ -f "${SYSCTL_CONF}" ] | ||
35 | then | ||
36 | if [ -x "/sbin/sysctl" ] | ||
37 | then | ||
38 | /sbin/sysctl -p "${SYSCTL_CONF}" | ||
39 | else | ||
40 | echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>." | ||
41 | fi | ||
42 | fi | ||
43 | |||
44 | # | ||
45 | # Update /etc/motd. | ||
46 | # | ||
47 | if test "$EDITMOTD" != no | ||
48 | then | ||
49 | uname -a > /etc/motd.tmp | ||
50 | sed 1d /etc/motd >> /etc/motd.tmp | ||
51 | mv /etc/motd.tmp /etc/motd | ||
52 | fi | ||
53 | |||
54 | # | ||
55 | # This is as good a place as any for a sanity check | ||
56 | # /tmp should be a symlink to /var/tmp to cut down on the number | ||
57 | # of mounted ramdisks. | ||
58 | if test ! -L /tmp && test -d /var/tmp | ||
59 | then | ||
60 | rm -rf /tmp | ||
61 | ln -sf /var/tmp /tmp | ||
62 | fi | ||
63 | |||
64 | # Set the system clock from hardware clock | ||
65 | # If the timestamp is 1 day or more recent than the current time, | ||
66 | # use the timestamp instead. | ||
67 | /etc/init.d/hwclock.sh start | ||
68 | if test -e /etc/timestamp2 | ||
69 | then | ||
70 | SYSTEMDATE=`date "+%Y%m%d%2H%2M"` | ||
71 | read TIMESTAMP < /etc/timestamp2 | ||
72 | NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)` | ||
73 | if [ $NEEDUPDATE -eq 1 ]; then | ||
74 | date $TIMESTAMP | ||
75 | /etc/init.d/hwclock.sh stop | ||
76 | fi | ||
77 | fi | ||
78 | : exit 0 | ||