Hi folks. Not sure what the etiquette is here, but just to say that this bug has surfaced on the Raspberry Pi 5, where public testing of the debian trixie-based version of Raspberry Pi OS has recently begun. Unlike previous Raspberry Pis, the Pi 5 has a hardware RTC built in, so currently the time gets correctly restored from the RTC at boot by the kernel (assuming the board has been connected to power or has a working RTC battery installed), then set to the earlier time saved in /etc/fake-hwclock.data due to this bug. Is the below fix in the pipeline for debian trixie?
Again, apologies if the above is not correct etiquette. Just trying to save downstream (Raspberry Pi) some time with this one. Thanks Andrew Pattison (Debian bug tracker noob) On Thu, 16 Jan 2025 19:39:24 +0100 =?iso-8859-1?q?Aur=E9lien?= Jacobs < au...@gnuage.org> wrote: > Package: fake-hwclock > Version: 0.14 > Severity: important > Tags: patch > > Since version 0.14, calling `fake-hwclock load` *without* the `force` > parameter will actually always force loading the saved clock even if > older than the system clock. > This is very annoying as this forces the system to an older incorrect > clock at boot time even after the system clock was properly set to the > correct time from the RTC by the kernel. > > This is due the an inverted logic test introduced by commit 83537e2 > (Tweak handling of parameters) and easily fixed with the following > patch: > > commit bb7d2c1a0f45905267064b376c812ec53c829286 (HEAD -> master) > Author: Aurelien Jacobs <au...@gnuage.org> > Date: Thu Jan 16 19:15:11 2025 +0100 > > Fix an inverted logic issue for the force parameter of the load > command > > The bug was introduced in the following commit: > 83537e2 Tweak handling of parameters. > > diff --git a/fake-hwclock b/fake-hwclock > index 641c49f..d83afc8 100755 > --- a/fake-hwclock > +++ b/fake-hwclock > @@ -56,7 +56,7 @@ case $COMMAND in > SAVED="$(cat $FILE)" > SAVED_SEC=$(date -u -d "$SAVED" '+%s') > NOW_SEC=$(date -u '+%s') > - if [ "$FORCE"x = "false"x ] || [ $NOW_SEC -le $SAVED_SEC ] > ; then > + if [ "$FORCE"x != "false"x ] || [ $NOW_SEC -le $SAVED_SEC > ] ; then > date -u -s "$SAVED" > else > echo "Current system time: $(date -u '+%Y-%m-%d > %H:%M:%S')" > >