Page MenuHomeFreeBSD

stand: Improve common "boot" command
AbandonedPublic

Authored by kevans on Feb 19 2018, 9:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 15 2024, 10:41 AM
Unknown Object (File)
Jan 14 2024, 5:41 AM
Unknown Object (File)
Jan 5 2024, 7:59 AM
Unknown Object (File)
Jan 5 2024, 7:59 AM
Unknown Object (File)
Jan 5 2024, 7:59 AM
Unknown Object (File)
Jan 5 2024, 7:47 AM
Unknown Object (File)
Dec 20 2023, 3:28 AM
Unknown Object (File)
Dec 16 2023, 12:19 AM
Subscribers
None

Details

Reviewers
dteske
imp
Summary

The common boot command claims to be able to take an explicit kernel to boot. If one specifies "boot kernel.GENERIC", boot will attempt to load a module named "kernel.GENERIC." The common case tends to be that a directory in /boot is named "kernel.GENERIC" with a "kernel" binary inside and this command will fail because it is not searching it.

Re-work it a little bit, fallback to try prepending /boot/$kernel to module_path and loading the "common_bootfiles" (i.e. kernel). This still doesn't quite match the functionality of the "boot" that forth seems to install because it doesn't load modules, but it at least allows the expected "boot $kernelname" to work.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 15157

Event Timeline

Instead of doing arithmetic on argc, argv in try_kernel, just pass in the argc/argv that we're expecting to be passed to mod_loadkld.

I'd honestly feel better if we did this in Lua instead.

stand/common/boot.c
53

This gets used uninitialized if we take the first rv == 0 path.

74–75

we have asprintf, I thought, in libstand which would simplify this.

96

This test isn't needed. libsa's free copes with NULL. See bigger issue above.

stand/common/boot.c
53

actually, it doesn't n/m.

Abandon ship, this is a bad idea.