Page MenuHomeFreeBSD

reboot: Implement -e from nextboot
ClosedPublic

Authored by imp on Feb 11 2024, 2:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 1:17 PM
Unknown Object (File)
Apr 14 2024, 5:38 PM
Unknown Object (File)
Mar 21 2024, 3:37 AM
Unknown Object (File)
Mar 21 2024, 3:37 AM
Unknown Object (File)
Mar 21 2024, 3:36 AM
Unknown Object (File)
Mar 21 2024, 3:36 AM
Unknown Object (File)
Mar 21 2024, 3:36 AM
Unknown Object (File)
Mar 21 2024, 3:34 AM
Subscribers

Details

Summary

Allow -e foo=bar to add loader environment variables to nextboot.conf.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Feb 11 2024, 2:27 AM
imp created this revision.
sbin/reboot/reboot.c
119
150

Do we need the precise calculation of the dst len? IMO always allocating 3 * slen + 1 would be good enough.

Same about the special case of "XXX" string, but I am not sure there. Why having a different behavior WRT quoting comparing with other cases?

201

Update based on kib's quoting feedback. I'm reverting to just adding quotes, if
they aren't already present like the old code. I've added a note to the man page
about this option and the need for care.

refactor adding an env var.

sbin/reboot/reboot.c
161
185
imp marked 5 inline comments as done.Feb 12 2024, 6:25 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 12 2024, 6:54 PM
This revision was automatically updated to reflect the committed changes.