Merge remote-tracking branch 'OE-2.1/master' into vuplus-3.0
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-core / initscripts / initscripts-1.0 / bootmisc.sh
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 #
16 if test "$DELAYLOGIN" = yes
17 then
18   echo "System bootup in progress - please wait" > /etc/nologin
19   cp /etc/nologin /etc/nologin.boot
20 fi
21
22 #
23 # Set pseudo-terminal access permissions.
24 #
25 if test -c /dev/ttyp0
26 then
27         chmod 666 /dev/tty[p-za-e][0-9a-f]
28         chown root:tty /dev/tty[p-za-e][0-9a-f]
29 fi
30
31 #
32 # Apply /proc settings if defined
33 #
34 SYSCTL_CONF="/etc/sysctl.conf"
35 if [ -f "${SYSCTL_CONF}" ]
36 then
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
43 fi
44
45 #
46 # Update /etc/motd.
47 #
48 if test "$EDITMOTD" != no
49 then
50         uname -a > /etc/motd.tmp
51         sed 1d /etc/motd >> /etc/motd.tmp
52         mv /etc/motd.tmp /etc/motd
53 fi
54
55 #
56 # This is as good a place as any for a sanity check
57 # /tmp should be a symlink to /var/tmp to cut down on the number
58 # of mounted ramdisks.
59 if test ! -L /tmp && test -d /var/tmp
60 then
61         rm -rf /tmp
62         ln -sf /var/tmp /tmp
63 fi
64
65 # Set the system clock from hardware clock
66 # If the timestamp is more recent than the current time,
67 # use the timestamp instead.
68 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
69 if test -e /etc/timestamp
70 then
71         SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
72         read TIMESTAMP < /etc/timestamp
73         if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
74                 date -u ${TIMESTAMP#????}${TIMESTAMP%????????}
75                 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
76         fi
77 fi
78 : exit 0