Page MenuHomeFreeBSD

bsdinstall: implement rootpass with bsddialog
AcceptedPublic

Authored by khorben_defora.org on Mar 8 2024, 2:53 PM.
Tags
None
Referenced Files
F117033975: D44280.diff
Tue, May 13, 10:47 AM
Unknown Object (File)
Tue, May 6, 12:49 AM
Unknown Object (File)
Thu, Apr 24, 10:23 PM
Unknown Object (File)
Mon, Apr 21, 4:16 AM
Unknown Object (File)
Mon, Apr 21, 12:43 AM
Unknown Object (File)
Mon, Apr 21, 12:10 AM
Unknown Object (File)
Thu, Apr 17, 2:45 AM
Unknown Object (File)
Thu, Apr 17, 2:16 AM
Subscribers

Details

Summary

This provides a more consistent user experience to the FreeBSD installer.

Existing functionality is meant to be kept in full.

Test Plan
# BSDINSTALL_CHROOT=/ bsdinstall rootpass

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Mar 21 2024, 4:45 AM
khorben_defora.org added a reviewer: philip.

I am revisiting this revision for the following reasons:

  • It allowed the bsddialog command to be replaced with another through the DIALOG environment variable, which is currently not expected by the other scripts (this was implemented in D44672, which now needs a refresh and review)
  • There is a new group interested by the installation experience, and they should be given a new chance to review this
  • I could now commit this myself, but I would like the approval from my mentor first (philip@)

Thanks Brad for the initial review!

This revision now requires review to proceed.Fri, May 9, 11:21 PM

Also noteworthy in terms of UX:

  • With bsddialog, the <TAB> key will go straight from the first input field to the [ OK ] button; the "arrow down" key should be used instead.
  • Entering a mismatching password resets both password fields. (Like the passwd(8) command)
  • This does not allow setting an empty password; it then fails with error Incorrect input data. (This is unlike the passwd(8) command)

This could be frustrating to some users.

I have added everyone on the de-facto installer group that met on Monday; sorry for the noise.
(Should we create a Phabricator group for us? Apologies if I did not find it)

Approved by: philip (mentor)

This revision is now accepted and ready to land.Sat, May 10, 4:57 AM
usr.sbin/bsdinstall/scripts/rootpass
45

Nit: deindent these by a block as style(9) does for C switch statements

92

This is a weird way to display the error?

103

Hm, it would be nice to avoid this magic error return (that in theory could come out of chroot or pw...)

108

Probably better as

err=$?
if [ $err -eq 0 ]; then
    break
fi
errormsg=$(error_get_message $err)

or that kind of thing? Bit ugly to turn the error into a string and then treat empty string as success.