Message ID | af9320ee86fabe1a7bd2eed6967f0acd133f9682.1399459420.git.christian.braunersorensen@prevas.dk |
---|---|
State | Changes Requested |
Delegated to: | Esben Haabendal |
Headers | show |
<christian.braunersorensen@prevas.dk> writes: > From: Christian Sørensen <christian.braunersorensen@prevas.dk> > > USE_busybox_hwclock_use_utc: Default not set. If set, inserts --utc to > all hwclock commands within the busybox-hwclock initscript. > > Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk> > --- > recipes/busybox/busybox-configure.inc | 11 +++++++++++ > recipes/busybox/files/busybox-hwclock | 8 ++++---- > 2 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/recipes/busybox/busybox-configure.inc b/recipes/busybox/busybox-configure.inc > index 06588d6..e359928 100644 > --- a/recipes/busybox/busybox-configure.inc > +++ b/recipes/busybox/busybox-configure.inc > @@ -215,6 +215,17 @@ DEFAULT_USE_busybox_hwclock_sysvinit_stop = "15" > RECIPE_FLAGS += "busybox_hwclock_splashutils_progress busybox_hwclock_splashutils_msg" > SPLASHUTILS_INITSCRIPTS:>USE_busybox_hwclock += " busybox_hwclock" > DEFAULT_USE_busybox_hwclock_splashutils_msg = "\"Starting Busybox HWclock\"" > +RECIPE_FLAGS += "busybox_hwclock_utc" > +DO_CONFIGURE_PREFUNCS += " do_configure_busybox_hwclock_use_utc" > +do_configure_busybox_hwclock_use_utc () { > + if [ -n "$USE_busybox_hwclock" ]; then > + if [ -z "$USE_busybox_hwclock_utc" ]; then > + sed -i -e 's/ HWCLOCK_UTC//' ${SRCDIR}/busybox-hwclock > + else > + sed -i -e 's/HWCLOCK_UTC/\-\-utc/' ${SRCDIR}/busybox-hwclock > + fi > + fi > +} > > RECIPE_FLAGS += "busybox_hwclock_crontab" > # USE flag: synchronize to rtc every hour using crond > diff --git a/recipes/busybox/files/busybox-hwclock b/recipes/busybox/files/busybox-hwclock > index 84619ff..d7446e6 100755 > --- a/recipes/busybox/files/busybox-hwclock > +++ b/recipes/busybox/files/busybox-hwclock > @@ -35,9 +35,9 @@ case "$1" in > then > if [ -z "$TZ" ] > then > - hwclock --hctosys > + hwclock HWCLOCK_UTC --hctosys > else > - TZ="$TZ" hwclock --hctosys > + TZ="$TZ" hwclock HWCLOCK_UTC --hctosys > fi > fi > > @@ -60,7 +60,7 @@ case "$1" in > fi > if [ "$HWCLOCKACCESS" != no ] > then > - hwclock --systohc > + hwclock HWCLOCK_UTC --systohc > fi > if [ "$VERBOSE" != no ] > then > @@ -71,7 +71,7 @@ case "$1" in > show) > if [ "$HWCLOCKACCESS" != no ] > then > - hwclock --show > + hwclock HWCLOCK_UTC --show > fi > ;; > *) For easier (re)configuration, on target, it would be better if you configure a single variable in the busybox-hwclock script, and then use that on all calls to hwclock. /Esben
diff --git a/recipes/busybox/busybox-configure.inc b/recipes/busybox/busybox-configure.inc index 06588d6..e359928 100644 --- a/recipes/busybox/busybox-configure.inc +++ b/recipes/busybox/busybox-configure.inc @@ -215,6 +215,17 @@ DEFAULT_USE_busybox_hwclock_sysvinit_stop = "15" RECIPE_FLAGS += "busybox_hwclock_splashutils_progress busybox_hwclock_splashutils_msg" SPLASHUTILS_INITSCRIPTS:>USE_busybox_hwclock += " busybox_hwclock" DEFAULT_USE_busybox_hwclock_splashutils_msg = "\"Starting Busybox HWclock\"" +RECIPE_FLAGS += "busybox_hwclock_utc" +DO_CONFIGURE_PREFUNCS += " do_configure_busybox_hwclock_use_utc" +do_configure_busybox_hwclock_use_utc () { + if [ -n "$USE_busybox_hwclock" ]; then + if [ -z "$USE_busybox_hwclock_utc" ]; then + sed -i -e 's/ HWCLOCK_UTC//' ${SRCDIR}/busybox-hwclock + else + sed -i -e 's/HWCLOCK_UTC/\-\-utc/' ${SRCDIR}/busybox-hwclock + fi + fi +} RECIPE_FLAGS += "busybox_hwclock_crontab" # USE flag: synchronize to rtc every hour using crond diff --git a/recipes/busybox/files/busybox-hwclock b/recipes/busybox/files/busybox-hwclock index 84619ff..d7446e6 100755 --- a/recipes/busybox/files/busybox-hwclock +++ b/recipes/busybox/files/busybox-hwclock @@ -35,9 +35,9 @@ case "$1" in then if [ -z "$TZ" ] then - hwclock --hctosys + hwclock HWCLOCK_UTC --hctosys else - TZ="$TZ" hwclock --hctosys + TZ="$TZ" hwclock HWCLOCK_UTC --hctosys fi fi @@ -60,7 +60,7 @@ case "$1" in fi if [ "$HWCLOCKACCESS" != no ] then - hwclock --systohc + hwclock HWCLOCK_UTC --systohc fi if [ "$VERBOSE" != no ] then @@ -71,7 +71,7 @@ case "$1" in show) if [ "$HWCLOCKACCESS" != no ] then - hwclock --show + hwclock HWCLOCK_UTC --show fi ;; *)