Page MenuHomeFreeBSD

bsdinstall: Attempt setting the date with NTP
Needs RevisionPublic

Authored by des on Aug 29 2025, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 9, 8:48 PM
Unknown Object (File)
Fri, Oct 3, 11:14 AM
Unknown Object (File)
Thu, Oct 2, 9:22 AM
Unknown Object (File)
Wed, Sep 24, 3:44 AM
Unknown Object (File)
Mon, Sep 22, 1:19 AM
Unknown Object (File)
Fri, Sep 19, 2:22 AM
Unknown Object (File)
Wed, Sep 17, 3:16 PM
Unknown Object (File)
Sep 14 2025, 1:25 PM
Subscribers

Details

Reviewers
emaste
jrtc27
Summary

Before asking the user to set the date and time manually, offer to set
them automatically. We default to freebsd.pool.ntp.org, but give the
user a chance to specify a different server.

Additionally, rewrite the time-setting code so it can run both pre- and
post-install. When running post-install, it checks to see if it has
already run, and if so, retrieves and installs the previously selected
time zone.

Finally, run the time-setting code pre-install if network configuration
has been run, which strongly suggests that we're going to attempt to
download something, and therefore may need to have the right time in
order to validate certificates.

Event: Oslo Hackathon 202508

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 66652
Build 63535: arc lint + arc unit

Event Timeline

des requested review of this revision.Aug 29 2025, 10:04 PM
jrtc27 requested changes to this revision.Aug 29 2025, 10:16 PM

This does too many things in one change. Inferring whether it's pre- or post-install via looking at BSDINSTALL_CHROOT adds unnecessary complexity when the caller of the script already knows if it's pre-install or post-install. D52196 maintains that intentionality, and also better handles the time zone used during the install with a working /etc/localtime rather than needing to mess about with TZ. There may be ways you think the implementation there could be better, but I believe that the general design of it is better.

This revision now requires changes to proceed.Aug 29 2025, 10:16 PM