site  contact  subhomenews

Set-hwclock-type GUI improved

October 18, 2022 — BarryK

The first time that EasyOS is booted, or if booted from a USB-stick for the first time on a different computer, a little GUI window pops up asking if the hardware clock is local-time or UTC (also known as GMT). I wrote about hardware-profiling for the hardware-clock back in July:

https://bkhome.org/news/202207/hardware-clock-set-to-local-time-or-utc-now-hardware-profiled.html

That little GUI utility, /usr/sbin/set_hwclock_type, is ancient. It was written by Old Puppy Forum member 'pizzasgood' in 2009, and it was internationalised by 'rodin.s' in 2012. Unchanged since then.

I have overhauled it, put more information into each window. This is the first window:

img1

Click OK, and the next window:

img2

The script uses the old Xdialog utility for the GUI. The Help button is there for newbies; it explains what the hardware clock is, how it differs from the software clock.

EDIT 2022-10-20:
Hmmm, found a fault in the set_hwclock_type script. According to the man-page for hwclock, the "-r" option returns the hardware clock setting. Except it doesn't. Not as-is anyway:

# hwclock -r
2022-10-20 19:21:09.650905+08:00
#
# busybox hwclock -r
Thu Oct 20 11:21:28 2022 0.000000 seconds

This is testing on my Lenovo Ideacentre PC, which has the hardware clock set to localtime, not UTC. The "busybox hwclock -r" returns the correct value.

How misleading is the documentation, and behaviour, of the full version! Anyway, I have fixed the script, now using the busybox applet.   

Tags: easy