Live-usb writes UTC time to hwclock  [Solved]

Message
Author
User avatar
figueroa
Posts: 1106
Joined: Thu Dec 20, 2018 11:20 pm

Live-usb writes UTC time to hwclock  [Solved]

#1 Post by figueroa »

Although I do not dual boot, as a practice carried over from early PCs with battery-backed real-time-clocks and MSDOS, I've always set BIOS HWCLOCK (RTC) to local time. I've just figured out that whenever I boot antiX or MX installation media without setting the timezone and/or the option hwclock=local, my hardware clock gets reset to UTC.

I think this is a problem. Installation media should not be writing to the PCs hardware clock.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

User avatar
dolphin_oracle
Developer
Posts: 22767
Joined: Sun Dec 16, 2007 12:17 pm

Re: Live-usb writes UTC time to hwclock

#2 Post by dolphin_oracle »

figueroa wrote: Fri Nov 26, 2021 7:25 pm Although I do not dual boot, as a practice carried over from early PCs with battery-backed real-time-clocks and MSDOS, I've always set BIOS HWCLOCK (RTC) to local time. I've just figured out that whenever I boot antiX or MX installation media without setting the timezone and/or the option hwclock=local, my hardware clock gets reset to UTC.

I think this is a problem. Installation media should not be writing to the PCs hardware clock.
hm...I'll look into it. our live version of the hwclock init script shouldn't touch the clock, so this would certainly be a bug.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
dolphin_oracle
Developer
Posts: 22767
Joined: Sun Dec 16, 2007 12:17 pm

Re: Live-usb writes UTC time to hwclock

#3 Post by dolphin_oracle »

I think I found the issue, but haven't tested my fix yet. If you are using persistence, you can edit the /etc/init.d/hwclock.sh file by removing

Code: Select all

if mountpoint -q /live/aufs; then
	verbose_log_action_msg "Not setting hardware clock on Live system"
	exit 0
fi
and replacing with

Code: Select all

if [ -d "/live/aufs" ]; then
	verbose_log_action_msg "Not setting hardware clock on Live system"
	exit 0
fi
[code]
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
fehlix
Developer
Posts: 12933
Joined: Wed Apr 11, 2018 5:09 pm

Re: Live-usb writes UTC time to hwclock

#4 Post by fehlix »

figueroa wrote: Fri Nov 26, 2021 7:25 pm Although I do not dual boot, as a practice carried over from early PCs with battery-backed real-time-clocks and MSDOS, I've always set BIOS HWCLOCK (RTC) to local time. I've just figured out that whenever I boot antiX or MX installation media without setting the timezone and/or the option hwclock=local, my hardware clock gets reset to UTC.

I think this is a problem. Installation media should not be writing to the PCs hardware clock.
Not here, checked within BIOS and set manually to localtime. After booting live media and rebooted into BIOS setup, it stays in localtime.

User avatar
dolphin_oracle
Developer
Posts: 22767
Joined: Sun Dec 16, 2007 12:17 pm

Re: Live-usb writes UTC time to hwclock

#5 Post by dolphin_oracle »

actually fehlix is right. now that I'm at a pc to test, I can't duplicate the problem, at least not with MX 21.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

User avatar
figueroa
Posts: 1106
Joined: Thu Dec 20, 2018 11:20 pm

Re: Live-usb writes UTC time to hwclock

#6 Post by figueroa »

Thanks for checking. I'm going to mark this as solved. With apologies, apparently it's not antiX or MX, it's my failure at interpretation. When I check differently, it's more clear; and I'm blushing:

Code: Select all

hwclock --show ; date
2021-11-26 17:27:32.889968-05:00
Fri Nov 26 10:27:33 PM EST 2021
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

Post Reply

Return to “General”