Page MenuHomeFreeBSD

bsdinstall: Attempt setting the date with NTP
AbandonedPublic

Authored by des on Aug 20 2025, 11:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 15, 12:07 AM
Unknown Object (File)
Sat, Oct 11, 2:08 PM
Unknown Object (File)
Sat, Oct 11, 2:08 PM
Unknown Object (File)
Sat, Oct 11, 5:50 AM
Unknown Object (File)
Fri, Oct 10, 9:21 AM
Unknown Object (File)
Wed, Oct 8, 2:47 PM
Unknown Object (File)
Wed, Oct 8, 2:38 PM
Unknown Object (File)
Sun, Oct 5, 11:43 PM
Subscribers

Details

Reviewers
imp
jrtc27
Group Reviewers
Installer
Summary

Before asking the user to set the date and time manually, check if we
are able to resolve freebsd.pool.ntp.org, and if so, offer to set the
date and time automatically.

Diff Detail

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

Event Timeline

des requested review of this revision.Aug 20 2025, 11:27 PM

This would have helped me a lot...
I never know what to do about ntpdate in scripts...

usr.sbin/bsdinstall/scripts/time
48

How much longer will we have ntpdate? On the one hand, it's been declareed obsolete. On the other, i think we are entering the second decade of obsolescence...

This revision is now accepted and ready to land.Aug 20 2025, 11:30 PM
usr.sbin/bsdinstall/scripts/time
48

Don't worry about it, if it ever goes away I have a replacement pretty much ready.

jrtc27 requested changes to this revision.Aug 22 2025, 6:17 PM
jrtc27 added inline comments.
usr.sbin/bsdinstall/scripts/time
48

This doesn't work, the exit code is sed's, so will always succeed unless something goes wrong with sed itself.

This revision now requires changes to proceed.Aug 22 2025, 6:17 PM
usr.sbin/bsdinstall/scripts/time
48
jrtc4@amoracia:~$ if ! ntperr=$(ntpdate freebsd.pool.ntp.org 2>&1 | sed 's/^.*\]: //'); then echo failed; fi
jrtc4@amoracia:~$ if ! ntperr=$(ntpdate freebsd.pool.ntp.org 2>&1); then echo failed; fi
failed
jrtc4@amoracia:~$ freebsd-version
14.2-RELEASE-p3

if you want proof (failing because I'm not root)

usr.sbin/bsdinstall/scripts/time
48

no, I don't want proof, please leave the chip on your shoulder at the door.