[issue708] timezone handling broken?

uli bts at bts.grml.org
Wed Aug 12 23:36:02 CEST 2009

uli <ulrich at topfen.net> added the comment:

In autoconfig.functions, the logic assumes that the Hardware Clock is set to the
local time only if one of the following is true:
* an explicit "localtime" boot parameter is given
* UTC=no is set in /etc/default/rcS
* the variable UTC is not contained in /etc/default/rcS at all

# {{{ Set clock (Local time is more often used than GMT, so it is default)

    # The default hardware clock timezone is stated as representing local time.
    grep -q "^UTC=" /etc/default/rcS || echo "UTC=no" >> /etc/default/rcS
    checkbootparam utc       >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|"
    checkbootparam gmt       >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|"
    checkbootparam localtime >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=no|" 
    grep -q -i "^UTC=yes" /etc/default/rcS && UTC="-u"

# }}}

Unfortunately, grml-live's GRMLBASE/18-timesetup script explicitly sets UTC in
rcS to whatever value it's set on the buildserver, which appears to be UTC=yes.

# tell if hwclock is running in UTC or local time
if [ -n "$UTC" ] ; then
   echo "Setting hwclock parameter UTC to $UTC"
   sed -i "s|^UTC=.*$|UTC="$UTC"|" $target/etc/default/rcS

Therefore, there appear to be three options to address this to me:
1) Start grml with the localtime boot parameter by default
2) Remove the above 5 lines from 18-timesetup
3) Rework the logic in so it ignores the setting in /etc/default/rcS while booting

If you tell me which option you prefer, I'll come up with a patch for it.

Additionally, the boot parameter "localtime" isn't documented in
grml-cheatcodes.txt. If this is unintentional, I'll try to prepare a patch for
it as well.

messages: 2350, 2431
nosy: mika
priority: bug
status: chatting
title: timezone handling broken?
topic: release-stopper

GRML issue tracker <bts at bts.grml.org>

More information about the Bugs-changes mailing list