Page MenuHomeFreeBSD

Implement automatic kernel list in the boot loader
Needs ReviewPublic

Authored by allanjude on Aug 5 2017, 9:07 PM.

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 OK
Unit
No Unit 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...