summaryrefslogtreecommitdiff
path: root/recipes/busybox
diff options
context:
space:
mode:
authorSteffen Sledz <sledz@dresearch.de>2010-02-11 12:16:06 +0100
committerSteffen Sledz <sledz@dresearch.de>2010-02-11 12:17:58 +0100
commit905a0bcc45bff2f58cff57566ccc735b8dc42b95 (patch)
tree100505793b6b2683cb2d18814ab6ec6617d31e8e /recipes/busybox
parent50a23bbe6e3beea6b8d6fdd3c35ea922d4703f41 (diff)
busybox: use machine specific hwclock.sh for hipox
At hipox machine we do not update the Hardware Clock with the System Clock time at stop to avoid needless increase of the RTC epoch counter. Signed-off-by: Steffen Sledz <sledz@dresearch.de>
Diffstat (limited to 'recipes/busybox')
-rw-r--r--recipes/busybox/files/hipox/hwclock.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/recipes/busybox/files/hipox/hwclock.sh b/recipes/busybox/files/hipox/hwclock.sh
new file mode 100644
index 0000000000..47e4c8d44e
--- /dev/null
+++ b/recipes/busybox/files/hipox/hwclock.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+# hwclock.sh Set system clock to hardware clock, according to the UTC
+# setting in /etc/default/rcS (see also rcS(5)).
+# (hipox machine version)
+#
+# WARNING: If your hardware clock is not in UTC/GMT, this script
+# must know the local time zone. This information is
+# stored in /etc/localtime. This might be a problem if
+# your /etc/localtime is a symlink to something in
+# /usr/share/zoneinfo AND /usr isn't in the root
+# partition! The workaround is to define TZ either
+# in /etc/default/rcS, or in the proper place below.
+
+[ ! -x /sbin/hwclock ] && exit 0
+
+. /etc/default/rcS
+
+[ "$UTC" = yes ] && UTC=--utc || UTC=--localtime
+
+case "$1" in
+ start)
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System time was `date`."
+ echo "Setting the System Clock using the Hardware Clock as reference..."
+ fi
+
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ if [ -z "$TZ" ]
+ then
+ hwclock -s $UTC;# --hctosys
+ else
+ TZ="$TZ" hwclock -s $UTC;# --hctosys
+ fi
+ fi
+
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System Clock set. System local time is now `date`."
+ fi
+ ;;
+ stop|restart|reload|force-reload)
+ #
+ # At hipox machine we do not update the Hardware Clock
+ # with the System Clock time to avoid needless increase
+ # of the RTC epoch counter.
+ #
+ exit 0
+ ;;
+ show)
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock -r $UTC;# --show
+ fi
+ ;;
+ *)
+ echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
+ echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
+ echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
+ exit 1
+ ;;
+esac