Page MenuHomeFreeBSD

bsdinstall: implement rootpass with bsddialog
ClosedPublic

Authored by khorben_defora.org on Mar 8 2024, 2:53 PM.
Tags
None
Referenced Files
F119434068: D44280.id135551.diff
Sun, Jun 8, 7:58 PM
F119378905: D44280.diff
Sun, Jun 8, 6:29 AM
F119352398: D44280.id135551.diff
Sun, Jun 8, 12:02 AM
Unknown Object (File)
Sat, Jun 7, 8:23 AM
Unknown Object (File)
Fri, Jun 6, 5:39 PM
Unknown Object (File)
Sun, Jun 1, 3:46 PM
Unknown Object (File)
Fri, May 30, 2:54 PM
Unknown Object (File)
Fri, May 30, 1:26 PM
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.

usr.sbin/bsdinstall/scripts/rootpass
45

Thanks for the heads up; updated.

92

Suggestions welcome :)

103

I'm also having to add an error message for empty passwords, which do not seem to be accepted.
While I agree with your suggestion, I think that it is outside the scope of this change request.

108

Good point; updated.

  • Re-indented the case statement
  • Added a check for empty passwords
  • Reworked error management
This revision now requires review to proceed.Tue, May 20, 11:42 AM
This revision is now accepted and ready to land.Tue, May 20, 4:24 PM

Even though I have the approval of my mentor, it would be great to have approval from the installer group for this change before I proceed with the commit.
Please let me know!

I've done a little testing and this does what I would expect on my test laptop.

I don't find the interface intuitive, but I think you are hamstrung their by what bsddialog offers. I think getting it into installers sooner is best.

Please add "Tested by: thj" when you commit.

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.

Ok, I can change the behavior in future versions. TAB will navigate through input fields as well, instead of switching only between [Input fields <-> Buttons]. This could be in the next version or later with Lua integration.

  • 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.