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)
Wed, Nov 13, 11:52 AM
Unknown Object (File)
Fri, Nov 8, 4:44 PM
Unknown Object (File)
Tue, Oct 29, 1:55 PM
Unknown Object (File)
Mon, Oct 21, 1:31 AM
Unknown Object (File)
Mon, Oct 21, 1:31 AM
Unknown Object (File)
Mon, Oct 21, 1:31 AM
Unknown Object (File)
Mon, Oct 21, 1:31 AM
Unknown Object (File)
Mon, Oct 21, 1:31 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 Passed
Unit
No Test Coverage
Build Status
Buildable 55925
Build 52814: arc lint + arc unit

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?

211

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