[arch-projects] [initscripts][PATCH 1/2] rc.sysinit: sync hwclock time and timezone in separate calls
hwclock from util-linux 2.22 no longer allows setting the time in the same call as the timezone, so this fails. It's not really clear this ever had the intended effect. Fixes FS#31416. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- This will be backported to the current initscripts release to get util-linux out of testing. rc.sysinit | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index b285cc7..2931a7d 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -34,8 +34,6 @@ bootlogd -p /run/bootlogd.pid run_hook sysinit_start -HWCLOCK_PARAMS="--systz" - if [[ $HARDWARECLOCK ]]; then print_depr "HARDWARECLOCK=" "rc.conf(5) and hwclock(8)" @@ -70,7 +68,7 @@ if [[ $HWCLOCK_PARAMS ]]; then export TZ=$TIMEZONE fi - hwclock $HWCLOCK_PARAMS && stat_done || stat_fail + { hwclock $HWCLOCK_PARAMS && hwclock --systz; } && stat_done || stat_fail unset TZ fi -- 1.7.12
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.sysinit | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 2931a7d..dd0a047 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -50,9 +50,8 @@ if [[ $HARDWARECLOCK ]]; then fi case $HARDWARECLOCK in - UTC) HWCLOCK_PARAMS+=" --utc --noadjfile";; - localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile";; - *) HWCLOCK_PARAMS="";; + UTC) HWCLOCK_PARAMS=(--utc --noadjfile) ;; + localtime) HWCLOCK_PARAMS=(--localtime --noadjfile) ;; esac fi @@ -68,7 +67,7 @@ if [[ $HWCLOCK_PARAMS ]]; then export TZ=$TIMEZONE fi - { hwclock $HWCLOCK_PARAMS && hwclock --systz; } && stat_done || stat_fail + { hwclock "${HWCLOCK_PARAMS[@]}" && hwclock --systz; } && stat_done || stat_fail unset TZ fi -- 1.7.12
On Sun, Sep 09, 2012 at 02:20:08PM -0400, Dave Reisner wrote:
hwclock from util-linux 2.22 no longer allows setting the time in the same call as the timezone, so this fails. It's not really clear this ever had the intended effect.
Fixes FS#31416.
Signed-off-by: Dave Reisner <dreisner@archlinux.org> ---
Ignore this, this isn't a proper fix. I'll send something that supersedes both of these patches.
This will be backported to the current initscripts release to get util-linux out of testing.
rc.sysinit | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index b285cc7..2931a7d 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -34,8 +34,6 @@ bootlogd -p /run/bootlogd.pid
run_hook sysinit_start
-HWCLOCK_PARAMS="--systz" - if [[ $HARDWARECLOCK ]]; then print_depr "HARDWARECLOCK=" "rc.conf(5) and hwclock(8)"
@@ -70,7 +68,7 @@ if [[ $HWCLOCK_PARAMS ]]; then export TZ=$TIMEZONE fi
- hwclock $HWCLOCK_PARAMS && stat_done || stat_fail + { hwclock $HWCLOCK_PARAMS && hwclock --systz; } && stat_done || stat_fail
unset TZ fi -- 1.7.12
participants (2)
-
Dave Reisner
-
Dave Reisner