Page MenuHomeFreeBSD

Implement automatic kernel list in the boot loader
Needs ReviewPublic

Authored by allanjude on Aug 5 2017, 9:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 15 2024, 10:11 AM
Unknown Object (File)
Mar 1 2024, 9:03 AM
Unknown Object (File)
Feb 7 2024, 4:05 PM
Unknown Object (File)
Jan 14 2024, 5:41 AM
Unknown Object (File)
Jan 9 2024, 10:50 PM
Unknown Object (File)
Jan 9 2024, 10:50 PM
Unknown Object (File)
Jan 9 2024, 10:37 PM
Unknown Object (File)
Dec 20 2023, 7:32 AM
Subscribers

Details

Reviewers
tsoome
brd
emaste
Summary

The loader has long supported the 'kernels' variable, a list of kernels that
could be cycled through via the loader menu, defaulting to kernel and
kernel.old.

This change will automatically populate the variable that powers that
list if it is not manually defined, with the list of installed kernels.

This will complement the upcoming packaged base feature that keeps
previous kernels as a fallback.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10877
Build 11268: arc lint + arc unit

Event Timeline

sys/boot/common/lskernel.c
62

perhaps it is better to use malloc instead of stack allocations - malloc is a bit pain to manage, but at least we will get clear errors, while stack collision with bss is really nasty to debug.

64

verbose and setkenv are in fact booleans, so we should use bool there.

116

we have z for size_t, so %8zu should be better and then you should not need to cast to int.

130

&kbuf will give us char ** as kbuf is char *

132

space after return

151

malloc can fail.

186

space after return

sys/boot/forth/menu.rc
186

this [if] needs to be a [if] due to sfind.

187

This [if] should be if

190

else

191

if

193

then

194

then

205

I think in both these places you want if not [if] and then not [then] . The reloadbe stuff needed [if] because you used sfind. This stuff doesn't and likely shouldn't use it because it can create ordering issues...