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