summaryrefslogtreecommitdiff
path: root/packages/initscripts/initscripts-1.0
diff options
context:
space:
mode:
authorOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2007-10-07 00:34:07 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2007-10-07 00:34:07 +0000
commit2f8521c6d1173dd650d9ae2bba8c18e690fa3b1f (patch)
tree06bc2b997b60797bc42f696f3427f92890089d2b /packages/initscripts/initscripts-1.0
parent0d0bf315513039bd8560ac91865c7174e789d675 (diff)
parent6e90aae26efa66553063b74b9afa9563b70fb982 (diff)
merge of '603b2d0c7e4ad80e5779bd3bbdb822331cc0ea2b'
and '6ab53da82d157971966f5a17d0c29d54df22cac9'
Diffstat (limited to 'packages/initscripts/initscripts-1.0')
-rwxr-xr-xpackages/initscripts/initscripts-1.0/bootmisc.sh20
-rwxr-xr-xpackages/initscripts/initscripts-1.0/checkroot.sh6
-rw-r--r--packages/initscripts/initscripts-1.0/functions17
-rw-r--r--packages/initscripts/initscripts-1.0/gumstix-connex/.mtn2git_empty0
-rw-r--r--packages/initscripts/initscripts-1.0/gumstix-connex/alignment.sh6
-rw-r--r--packages/initscripts/initscripts-1.0/gumstix-verdex/.mtn2git_empty0
-rw-r--r--packages/initscripts/initscripts-1.0/gumstix-verdex/alignment.sh6
-rw-r--r--packages/initscripts/initscripts-1.0/save-rtc.sh6
8 files changed, 47 insertions, 14 deletions
diff --git a/packages/initscripts/initscripts-1.0/bootmisc.sh b/packages/initscripts/initscripts-1.0/bootmisc.sh
index 799cdca12b..2a40e0c410 100755
--- a/packages/initscripts/initscripts-1.0/bootmisc.sh
+++ b/packages/initscripts/initscripts-1.0/bootmisc.sh
@@ -61,16 +61,18 @@ fi
#
/sbin/ldconfig
-#
-# Recover the time, if there is a time file (first boot only)
-# If not, set system clock from hardware clock
-#
+# Set the system clock from hardware clock
+# If the timestamp is 1 day or more recent than the current time,
+# use the timestamp instead.
+/etc/init.d/hwclock.sh start
if test -e /etc/timestamp
then
- date -s `cat /etc/timestamp`
- mv -f /etc/timestamp /etc/timestamp.done
- /etc/init.d/hwclock.sh stop
-else
- /etc/init.d/hwclock.sh start
+ 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
diff --git a/packages/initscripts/initscripts-1.0/checkroot.sh b/packages/initscripts/initscripts-1.0/checkroot.sh
index f3b8a0cd45..5c1e5c6ebb 100755
--- a/packages/initscripts/initscripts-1.0/checkroot.sh
+++ b/packages/initscripts/initscripts-1.0/checkroot.sh
@@ -60,9 +60,9 @@ do
test "$pass" = 0 -o "$pass" = "" && rootcheck=no
- # Enable fsck for ext2 and ext3 rootfs, disable for everything else
+ # Allow fsck for ext2 and ext3 rootfs, disable for everything else
case "$type" in
- ext2|ext3) rootcheck=yes;;
+ ext2|ext3) ;;
*) rootcheck=no;;
esac
@@ -140,7 +140,7 @@ else
esac
test `uname -m` = s390 && spinner="" # This should go away
test "$VERBOSE" != no && echo "Checking root filesystem..."
- fsck $spinner $force $fix /
+ fsck $spinner $force $fix / </dev/null
RTC=$?
#
# If there was a failure, drop into single-user mode.
diff --git a/packages/initscripts/initscripts-1.0/functions b/packages/initscripts/initscripts-1.0/functions
new file mode 100644
index 0000000000..358fc6edb3
--- /dev/null
+++ b/packages/initscripts/initscripts-1.0/functions
@@ -0,0 +1,17 @@
+# -*-Shell-script-*-
+#
+# functions This file contains functions to be used by most or all
+# shell scripts in the /etc/init.d directory.
+#
+
+cpuinfo_id() { # return the Hardware module ID
+ awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+ pid=`/bin/ps -e x |
+ /bin/grep $1 |
+ /bin/grep -v grep |
+ /bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
diff --git a/packages/initscripts/initscripts-1.0/gumstix-connex/.mtn2git_empty b/packages/initscripts/initscripts-1.0/gumstix-connex/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/initscripts/initscripts-1.0/gumstix-connex/.mtn2git_empty
diff --git a/packages/initscripts/initscripts-1.0/gumstix-connex/alignment.sh b/packages/initscripts/initscripts-1.0/gumstix-connex/alignment.sh
new file mode 100644
index 0000000000..3826457609
--- /dev/null
+++ b/packages/initscripts/initscripts-1.0/gumstix-connex/alignment.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -e /proc/cpu/alignment ]; then
+ echo "2" > /proc/cpu/alignment
+fi
+
diff --git a/packages/initscripts/initscripts-1.0/gumstix-verdex/.mtn2git_empty b/packages/initscripts/initscripts-1.0/gumstix-verdex/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/initscripts/initscripts-1.0/gumstix-verdex/.mtn2git_empty
diff --git a/packages/initscripts/initscripts-1.0/gumstix-verdex/alignment.sh b/packages/initscripts/initscripts-1.0/gumstix-verdex/alignment.sh
new file mode 100644
index 0000000000..3826457609
--- /dev/null
+++ b/packages/initscripts/initscripts-1.0/gumstix-verdex/alignment.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -e /proc/cpu/alignment ]; then
+ echo "2" > /proc/cpu/alignment
+fi
+
diff --git a/packages/initscripts/initscripts-1.0/save-rtc.sh b/packages/initscripts/initscripts-1.0/save-rtc.sh
index de7c2b7646..e786073051 100644
--- a/packages/initscripts/initscripts-1.0/save-rtc.sh
+++ b/packages/initscripts/initscripts-1.0/save-rtc.sh
@@ -1,3 +1,5 @@
#! /bin/sh
-#FIXME readd timestamp handling for systems where RTC doesn't survive a reboot
-/etc/init.d/hwclock stop
+/etc/init.d/hwclock.sh stop
+
+# Update the timestamp
+date +%2m%2d%2H%2M%Y > /etc/timestamp