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)
Sun, Feb 23, 3:26 AM
Unknown Object (File)
Tue, Feb 18, 12:02 AM
Unknown Object (File)
Fri, Feb 14, 5:45 PM
Unknown Object (File)
Thu, Feb 13, 6:43 AM
Unknown Object (File)
Wed, Feb 12, 8:29 PM
Unknown Object (File)
Jan 24 2025, 7:24 PM
Unknown Object (File)
Jan 18 2025, 9:15 PM
Unknown Object (File)
Jan 13 2025, 3:11 PM
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.