From nobody Sat Feb 25 16:33:23 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPC4P4mRmz3tbgY; Sat, 25 Feb 2023 16:33:25 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPC4P4MWlz3hCb; Sat, 25 Feb 2023 16:33:25 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.16.1/8.16.1) with ESMTP id 31PGXOkY064695; Sat, 25 Feb 2023 10:33:24 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id Xg5THVQ4+mO1/AAAs/W3XQ (envelope-from ); Sat, 25 Feb 2023 10:33:24 -0600 From: Mike Karels To: bob prohaska Cc: freebsd-arm@freebsd.org, freebsd-current@freebsd.org Subject: Re: Timekeeping problem in /usr/src on new RPI aarch64 snapshot Date: Sat, 25 Feb 2023 10:33:23 -0600 X-Mailer: MailMate (1.14r5937) Message-ID: <0BA0C9F7-5F85-4EBF-86BB-428730746592@karels.net> In-Reply-To: <20230225161625.GB8127@www.zefox.net> References: <20230224210502.GA8127@www.zefox.net> <1216867532.11893.1677280869319@localhost> <20230225161625.GB8127@www.zefox.net> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4PPC4P4MWlz3hCb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 25 Feb 2023, at 10:16, bob prohaska wrote: > 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? /etc/localtime is used in formatting dates (e.g. for ls), but is not involved in storage of timestamps. Timestamps on files, system time, etc, are all in UTC. So the system should act normally if there is no /etc/localtime, and after one is added. Mike > Thanks to both Mark and Ronald! > > bob prohaska