@Rich: thanks
wiki updated: "Use if no rtc (real time clock) present, to set UTC time at boot without functional rtc, Internet required."
To double check, I tested at both my systems:
- HP510 thin client with VIA Eden x86 processor, 1GHz, 2core, 64bit running on TC16/32bit
- other thin client with VIA Eden x86 processor, 500MHz, 1core running on TC15/32bit
in both cases:
- used nortc bootcode
- modified settime.sh to include logging and added it to .fieltool.lst
- gave date a 5minute offset, synced to hwclock, checked.
- reboot
- logging confirmed settime.sh was called and conditions to sync with internet were met
- but 1st "date" call reported "2025" and getTime.sh call was skipped as result of <2015 check
>> so indeed no internet time sync
It's a bit strange, also found below code snippet in tc-config.
- This basically "does not set system clock" in case of nortc bootcode.
- This means that 1st date call in settime.sh is towards uninitialised system clock
>>>I guess system clock "auto initialises" towards hwclock.
- Maybe not at all processors, maybe just my VIA Eden processors
- Modified wiki text makes clear to only use nortc without hw clock. in case of hwclock present it keeps the behaviour "undefined" which is probably correct. One could dig in deeper but I guess this gives enough warning to trigger a potential someone having a problem in future.
And in case one has a hwclock:
- better not use nortc bootcode
- without internet keep running from hwclock
- with internet add "sudo ntpd -p pool.ntp.org" to filetool.sh to keep syncing system clock and hwclock to "real time"
if [ -n "$NORTC" ]; then
echo "${BLUE}Skipping rtc as requested from the boot command line.${NORMAL}"
else
while [ ! -e /dev/rtc0 ]; do usleep 50000; done
if [ -n "$NOUTC" ]; then
/sbin/hwclock -l -s &
else
/sbin/hwclock -u -s &
fi
fi