Date: Sat, 25 Feb 2023 00:21:09 +0100 (CET) From: Ronald Klop <ronald-lists@klop.ws> To: freebsd-arm@freebsd.org, bob prohaska <fbsd@www.zefox.net>, freebsd-current@freebsd.org Subject: Re: Timekeeping problem in /usr/src on new RPI aarch64 snapshot Message-ID: <1216867532.11893.1677280869319@localhost> In-Reply-To: <20230224210502.GA8127@www.zefox.net>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_11892_113718381.1677280869315 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Van: bob prohaska <fbsd@www.zefox.net> Datum: 24 februari 2023 22:05 Aan: freebsd-current@freebsd.org CC: freebsd-arm@freebsd.org Onderwerp: Timekeeping problem in /usr/src on new RPI aarch64 snapshot >=20 >=20 > After installing=20 > FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20230223-fe5c211ba873-261074.img > on a Pi3 and setting up the hard disk to use separate swap and /usr parti= tions > an oddity came to light regarding dates. >=20 > The image file was written to disk the night of the 23rd, from a Pi3 with > a correctly-set time and date. It was left idle overnight, configured the > morning of the 24th and booted without issue. It then cloned -current int= o > /usr/src, at which point the time was noticed to be wrong, apparently fas= t. >=20 > It turned out ntpdate wasn't running, so it was started and then tzsetup > run. After a reboot the time reported correctly.=20 >=20 > However, make buildworld in /usr/src triggers an exhortation to "check > your time" and refuses run further.=20 >=20 > running date on the system reports > Fri Feb 24 12:49:41 PST 2023 > but ls -l /usr/src reports time around=20 > Feb 24 19:10 > an obvious inconsistency. > =20 > Presumably just waiting until the system clock catches > up with the /usr/src timestamps will fix the error. Is > there a better method? >=20 > Still, the date and time handling don't seem quite right.=20 > In at least one earlier instance it appeared that tzsetup=20 > altered the reported timeszone without shifting the time > stamp by the UTC/PDT offset. I always thought timestamps > were internally in UTC+timezone, displayed with the right > offset. It looks to a casual observer like something else > is going on.=20 >=20 > An earlier fiasco (on this same Pi3) included wildly wrong > timestamps in a filesystem. The Pi3 has no hardware clock, > how does it set time when booted without a reference? >=20 > Thanks for reading, >=20 > bob prohaska >=20 >=20 >=20 >=20 >=20 >=20 UFS stores the current timestamp in the superblock of the FS on clean shutd= own/unmount. On boot it reads the time from the timestamp in the superblock= of the root FS. Of coarse this timestamp is behind for the duration that t= he machine was off or rebooting so you need to adjust that using ntp.=20 For ZFS root you can use the fakertc port to do something similar.=20 You can use the command =E2=80=9Ctouch=E2=80=9C to manipulate the time of y= our /usr/src dir.=20 Regards, Ronald ------=_Part_11892_113718381.1677280869315 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head></head><body><br><p><small><strong>Van:</strong> bob prohaska &= lt;fbsd@www.zefox.net><br><strong>Datum:</strong> 24 februari 2023 22:05= <br><strong>Aan:</strong> freebsd-current@freebsd.org<br><strong>CC:</stron= g> freebsd-arm@freebsd.org<br><strong>Onderwerp:</strong> Timekeeping probl= em in /usr/src on new RPI aarch64 snapshot<br></small></p><blockquote style= =3D"margin-left: 5px; border-left: 3px solid #ccc; margin-right: 0px; paddi= ng-left: 5px;"><div class=3D"MessageRFC822Viewer do_not_remove" id=3D"P"><!= -- P --> <!-- processMimeMessage --><div class=3D"TextPlainViewer do_not_remove" id= =3D"P.P"><!-- P.P -->After installing <br> FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20230223-fe5c211ba873-261074.img<br> on a Pi3 and setting up the hard disk to use separate swap and /usr partiti= ons<br> an oddity came to light regarding dates.<br> <br> The image file was written to disk the night of the 23rd, from a Pi3 with<b= r> a correctly-set time and date. It was left idle overnight, configured the<b= r> morning of the 24th and booted without issue. It then cloned -current into<= br> /usr/src, at which point the time was noticed to be wrong, apparently fast.= <br> <br> It turned out ntpdate wasn't running, so it was started and then tzsetup<br= > run. After a reboot the time reported correctly. <br> <br> However, make buildworld in /usr/src triggers an exhortation to "check<br> your time" and refuses run further. <br> <br> running date on the system reports<br> Fri Feb 24 12:49:41 PST 2023<br> but ls -l /usr/src reports time around <br> Feb 24 19:10<br> an obvious inconsistency.<br> <br> Presumably just waiting until the system clock catches<br> up with the /usr/src timestamps will fix the error. Is<br> there a better method?<br> <br> Still, the date and time handling don't seem quite right. <br> In at least one earlier instance it appeared that tzsetup <br> altered the reported timeszone without shifting the time<br> stamp by the UTC/PDT offset. I always thought timestamps<br> were internally in UTC+timezone, displayed with the right<br> offset. It looks to a casual observer like something else<br> is going on. <br> <br> An earlier fiasco (on this same Pi3) included wildly wrong<br> timestamps in a filesystem. The Pi3 has no hardware clock,<br> how does it set time when booted without a reference?<br> <br> Thanks for reading,<br> <br> bob prohaska<br> <br> <br> </div><!-- TextPlainViewer --> <hr> </div><!-- MessageRFC822Viewer --> </blockquote><br>UFS stores the current timestamp in the superblock of the = FS on clean shutdown/unmount. On boot it reads the time from the timestamp = in the superblock of the root FS. Of coarse this timestamp is behind for th= e duration that the machine was off or rebooting so you need to adjust that= using ntp. <div>For ZFS root you can use the fakertc port to do somet= hing similar. <br><div><br></div><div>You can use the command =E2=80= =9Ctouch=E2=80=9C to manipulate the time of your /usr/src dir. <br><br= ></div></div><div>Regards,</div><div>Ronald</div><div><br></div></body></ht= ml> ------=_Part_11892_113718381.1677280869315--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1216867532.11893.1677280869319>