Boot-Time Kernel Configuration

The config kernel editor is great when you know what you’re doing, but many of us aren’t that lucky or educated. When I’m trying to figure out how to fix a problem, I’ll frequently make a change, reboot to test the change, and see if things work.

OpenBSD lets you edit the kernel at boot time. You can try one boot with a kernel change, see if it works, and write your changes to the kernel. At the boot loader prompt, run boot -c.

boot > boot -c

You’ll get a couple lines of boot output, and then the kernel editor prompt.

ukc>

This works just like the config kernel configuration editor. Make any changes you want here, exactly as you would with config. When you quit the editor, the kernel should boot with the changes you’ve chosen.

The nice thing about boot-time edits is that they’re not permanent unless you later declare them so. If your changes don’t result in the desired behavior, reboot and try again. If your changes do solve your issue, however, you can write them to a kernel file.

The kernel remembers the changes you made in it. You can “replay” those changes in config by using the -u flag. Run config as if you were editing the kernel, but add the -u flag to replicate your boot-time changes.

# config -u -e -o /bsd.test /bsd

When you get your command prompt, enter quit to save your changes to your new kernel file.

Between sysctl and config, you should be able to make any OpenBSD-supported changes to the kernel. In the next chapter, we’ll cover how to make wildly unsupported kernel changes by rebuilding the kernel from source.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.67.5