summaryrefslogtreecommitdiff
path: root/recipes/shr/initscripts-shr/bootmisc.sh
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2009-09-17 21:53:11 +0200
committerKoen Kooi <koen@openembedded.org>2009-09-17 21:53:11 +0200
commit2d899b917c23141945ad34f52b3fd80f93f105fb (patch)
treeecc965c7414892cecb75006a86c5c447f7e59c32 /recipes/shr/initscripts-shr/bootmisc.sh
parent62b5c01bde0a1e5769ab4dba184be51d2907933a (diff)
parentd56ffbe90a9e19915f7bbe1de559438946daa916 (diff)
Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into org.openembedded.dev
Diffstat (limited to 'recipes/shr/initscripts-shr/bootmisc.sh')
-rw-r--r--recipes/shr/initscripts-shr/bootmisc.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes/shr/initscripts-shr/bootmisc.sh b/recipes/shr/initscripts-shr/bootmisc.sh
new file mode 100644
index 0000000000..4511e12fc1
--- /dev/null
+++ b/recipes/shr/initscripts-shr/bootmisc.sh
@@ -0,0 +1,47 @@
+#
+# bootmisc.sh Miscellaneous things to be done during bootup.
+#
+
+. /etc/default/rcS
+#
+# Put a nologin file in /etc to prevent people from logging in before
+# system startup is complete.
+#
+if test "$DELAYLOGIN" = yes
+then
+ echo "System bootup in progress - please wait" > /etc/nologin
+ cp /etc/nologin /etc/nologin.boot
+fi
+
+#
+# Update /etc/motd.
+#
+if test "$EDITMOTD" != no
+then
+ uname -a > /etc/motd.tmp
+ sed 1d /etc/motd >> /etc/motd.tmp
+ mv /etc/motd.tmp /etc/motd
+fi
+
+#
+# Update dynamic library cache
+#
+#/sbin/ldconfig
+
+# Set the system clock from hardware clock
+# If the timestamp is 1 day or more recent than the current time,
+# use the timestamp instead.
+[ "$UTC" = yes ] || /etc/init.d/hwclock.sh start
+
+if ! test -f /etc/.configured && test -e /etc/timestamp
+then
+ SYSTEMDATE=`date "+%Y%m%d"`
+ TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'`
+ NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`
+ if [ $NEEDUPDATE -eq 1 ]; then
+ date `cat /etc/timestamp`
+ /etc/init.d/hwclock.sh stop
+ fi
+fi
+
+: exit 0