Page MenuHomeFreeBSD

bsdinstall, release: Set time and time zone earlier and use for live system
AcceptedPublic

Authored by jrtc27 on Aug 27 2025, 9:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 25, 9:20 PM
Unknown Object (File)
Sep 13 2025, 2:09 AM
Unknown Object (File)
Sep 12 2025, 10:06 AM
Unknown Object (File)
Sep 9 2025, 7:49 AM
Unknown Object (File)
Sep 5 2025, 3:31 PM
Unknown Object (File)
Sep 4 2025, 9:38 AM
Unknown Object (File)
Sep 4 2025, 7:05 AM
Unknown Object (File)
Sep 3 2025, 7:29 PM
Subscribers

Details

Reviewers
des
emaste
brooks
Summary

Currently we wait until after the base system has been extracted (and a
few other bits of config have occurred) until we configure these. This
means that we risk having the wrong time for files written to the
installed system in this period, and because we don't do anything to set
the live system's time zone the time zone used for displaying to the
user will vary between running inside and outside the chroot. Moreover,
when downloading distribution sets or pkgbase packages, HTTPS requires
an accurate clock for certificate validity checks, and so we really need
to set the current time first.

Instead, split the current step into two. The first half is to set the
time zone and time of the live system, almost exactly as we previously
did for the installed system, except using a new /tmp/bsdinstall_tz for
tzsetup (as we don't yet have the installed system to chroot to, and the
live system has a read-only root filesystem). We symlink the various
corresponding files on the live media's root filesystem to point here so
that this affects the live system's time zone.

The second half is to save this config to the installed system, as
previously happened by virtue of running tzsetup chroot'ed there.

We also introduce a new time script that wraps running both of those to
effectively provide the same end behaviour as before (except also
setting the live system's time zone). This is used by finalconfig if the
user selects the "Time Zone" option, but also provides backwards
compatibility for any existing scripted installation scripts.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 66585
Build 63468: arc lint + arc unit

Event Timeline

usr.sbin/bsdinstall/scripts/auto
196

If you want to do NTP for settime I would just do an unconditional netconfig here, then we can drop all the different cases when we end up having to run netconfig earlier than the "default" case

brooks added a subscriber: brooks.

I wonder if there is somewhere we should be being shouty about the time needing to be correct?

Over all seems good.

usr.sbin/bsdinstall/scripts/auto
196

I'm a big fan of the idea that we should netconfig as early as possible.

This revision is now accepted and ready to land.Aug 28 2025, 8:07 AM
jlduran added inline comments.
release/Makefile
261

Note: These symbolic links won't have a 0644 mode. (in fact the mode can be set to the source file, if one is using mtree's -u flag)
I realize here you are just following what is currently done with resolv.conf. One can see in the ISO that it points to /tmp/bsdinstall_etc/resolv.conf, the mode however is 0755, as expected.