Re: Timekeeping problem in /usr/src on new RPI aarch64 snapshot

bob prohaska <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm,gmane.os.freebsd.current
Message-ID <[email protected]>
On Sat, Feb 25, 2023 at 12:21:09AM +0100, Ronald Klop wrote:
> 
> 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 the
> duration that the machine was off or rebooting so you need to adjust that
> using ntp. For ZFS root you can use the fakertc port to do something
> similar.
> 
> 
Mark Millard points out:
     /etc/localtime        Current zoneinfo file, see tzsetup(8) and zic(8).

     /etc/wall_cmos_clock  Empty file.  Its presence indicates that the
                           machine's CMOS clock is set to local time, while
                           its absence indicates a UTC CMOS clock.

Since there is no /etc/wall_cmos_clock on the newly-installed filesystem
it appears the superblock timestamp is then interpreted as UTC when a Pi
boots, using whatever happens to be set in /etc/localtime. My confusion
is reduced somewhat. On first boot, what is the state of /etc/localtime?

I've neglected to run tzsetup immediately on many previous installations
and not noticed any complaints about mis-set clocks in buildworld. Is this
new behavior?

Thanks to both Mark and Ronald!

bob prohaska
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.