From 2bda4bbda3f3033cfb324778ef88f2aedad4a83b Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 1 Nov 2012 14:47:46 +0800 Subject: hwclock.sh: improve hwclock.sh script to use UTC variable Make UTC variable in /etc/default/rcS has effect on hwclock.sh. This variable declares whether the Hardware Clock is kept in UTC or local time. Default its value to "yes" and change the comment. [YOCTO #3341] Signed-off-by: Chen Qi Signed-off-by: Saul Wold --- meta/recipes-core/busybox/busybox_1.20.2.bb | 2 +- meta/recipes-core/busybox/files/hwclock.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'meta/recipes-core/busybox') diff --git a/meta/recipes-core/busybox/busybox_1.20.2.bb b/meta/recipes-core/busybox/busybox_1.20.2.bb index 4c0946af1f..3e628d239e 100644 --- a/meta/recipes-core/busybox/busybox_1.20.2.bb +++ b/meta/recipes-core/busybox/busybox_1.20.2.bb @@ -1,5 +1,5 @@ require busybox.inc -PR = "r3" +PR = "r4" SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://B921600.patch \ diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh index 2e50425ba8..cc6d2862ba 100644 --- a/meta/recipes-core/busybox/files/hwclock.sh +++ b/meta/recipes-core/busybox/files/hwclock.sh @@ -22,6 +22,7 @@ . /etc/default/rcS +[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime" case "$1" in start) if [ "$VERBOSE" != no ] @@ -34,9 +35,9 @@ case "$1" in then if [ -z "$TZ" ] then - hwclock --hctosys + hwclock $tz --hctosys else - TZ="$TZ" hwclock --hctosys + TZ="$TZ" hwclock $tz --hctosys fi fi @@ -59,7 +60,7 @@ case "$1" in fi if [ "$HWCLOCKACCESS" != no ] then - hwclock --systohc + hwclock $tz --systohc fi if [ "$VERBOSE" != no ] then @@ -70,7 +71,7 @@ case "$1" in show) if [ "$HWCLOCKACCESS" != no ] then - hwclock --show + hwclock $tz --show fi ;; *) -- cgit 1.2.3-korg