]> code.ossystems Code Review - openembedded-core.git/commitdiff
hwclock.sh: improve hwclock.sh script to use UTC variable
authorChen Qi <Qi.Chen@windriver.com>
Thu, 1 Nov 2012 06:47:46 +0000 (14:47 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Nov 2012 16:15:30 +0000 (16:15 +0000)
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 <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-core/busybox/busybox_1.20.2.bb
meta/recipes-core/busybox/files/hwclock.sh
meta/recipes-core/sysvinit/sysvinit/rcS-default
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb

index 4c0946af1f4ea0d437a10e967da79b2f9625eeb2..3e628d239e1dec7cbe83d274b62978204de39667 100644 (file)
@@ -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 \
index 2e50425ba835a3c115a148d24a6a1073b2fc599e..cc6d2862baa241788c25fbeb2d36b7f015d24df1 100644 (file)
@@ -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
                ;;
         *)
index fc6d41522e0a9db897b91e0e5536e14a1905b310..3c9dea90c464ea5207706f692058731330b1c4fa 100644 (file)
@@ -9,8 +9,8 @@ SULOGIN=no
 # Set to no if you want to be able to login over telnet/rlogin
 # before system startup is complete (as soon as inetd is started)
 DELAYLOGIN=no
-# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
-UTC=yes
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
 # Set VERBOSE to "no" if you would like a more quiet bootup.
 VERBOSE=no
 # Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
index 63333b06f43bc02afb004b39dbd766ebfd0e51cc..1647a0fc3aca0643d31129ecaffb687b038ba17c 100644 (file)
@@ -5,7 +5,7 @@ SECTION = "base"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
                     file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
-PR = "r7"
+PR = "r8"
 
 RDEPENDS_${PN} = "${PN}-inittab"