BOOT_CONFIG(8)

πŸ“¦ in nixpkgs unstable

πŸ’… BOOT_CONFIG(8) β€” like, how to change your kernel config at boot, bestie

okay so this is the boot_config manual page β€” System Manager's Manual energy, and it's literally your guide to poking at the kernel config before the kernel even finishes waking up. main character energy fr fr πŸŽ€


✨ NAME ✨

boot_config β€” the whole "how to change kernel configuration at boot" situation πŸ¦‹


🌸 DESCRIPTION 🌸

BOOT_CONFIG is a kernel option that makes it possible to change the configuration at boot time. no cap. and the same interface is available from userland too, using the -e argument to config(8). iykyk πŸ’…

So the boot-time config gets invoked by passing the -c option β€” either from the firmware prompt, or, depending on the architecture, when the bootstrap loader prompts you for a kernel to boot:

>> OpenBSD/i386 BOOT 3.26
boot> boot -c
booting hd0a:/bsd: ...
...
real mem  = 1073086464 (1023MB)
avail mem = 1043189760 (994MB)
User Kernel Config
UKC>

Changes made can be saved for the next reboot, by using config(8). BUT β€” and this is the important part, bestie β€” those changes would not persist across system upgrades and would prevent kernel relinking 😭. To make sure your changes get carried over to upgraded kernels, they can be saved to the bsd.re-config(5) configuration file. slay πŸ’–


πŸ‘‘ COMMANDS πŸ‘‘

  • add dev β€” add a device through copying another. iconic cloning behaviour 🧚
  • base 8 | 10 | 16 β€” change the base of numbers displayed and entered.
  • change devno | dev β€” modify one or more devices.
  • disable devno | dev β€” disable one or more devices.
  • enable devno | dev β€” enable one or more devices.
  • exit β€” continue boot. bye bestie 🫢
  • find devno | dev β€” find one or more devices.
  • help β€” give a short summary of all commands and their arguments.
  • list β€” show all known devices, a screen at a time.
  • lines [count] β€” set the number of rows per page.
  • quit β€” continue boot.
  • show [attr [val]] β€” show all devices for which attribute attr has the value val.
  • verbose β€” toggle the autoconfig verbose variable.

πŸ”₯ EXAMPLES πŸ”₯

🌈 the ethernet card saga

So the Ethernet card is not detected at boot because the kernel configuration does not match the physical hardware configuration β€” e.g. wrong IRQ in OpenBSD/i386. and the Ethernet card is supposed to use the ne(4) driver. classic πŸ™ˆ

UKC> find ne
24 ne0 at isa0 port 0x240 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
26 ne* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
27 ne* at pci* dev -1 function -1 flags 0x0
28 ne* at pcmcia* function -1 irq -1 flags 0x0
UKC>

ne1 seems to match the configuration except it uses IRQ 5 instead of IRQ 10. so the irq on ne1 should be changed via the change command. the device can be specified by either name or number, either way works πŸ’…

UKC> change ne1
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
change (y/n) ? y
port [0x300] ?
size [0] ?
iomem [-1] ?
iosiz [0] ?
irq [10] ? 5
drq [-1] ?
drq2 [-1] ?
flags [0] ?
25 ne1 changed
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 5 drq -1 drq2 -1 flags 0x0
UKC>

πŸ¦‹ the show command

the show command is useful for finding which devices have a certain attribute. it can also be used to find those devices with a particular value for an attribute. double duty queen πŸ‘‘

UKC> show slot
  2 ahc* at eisa0 slot -1 flags 0x0
 10 uha* at eisa0 slot -1 flags 0x0
 12 ep0 at eisa0 slot -1 flags 0x0
 17 ep* at eisa0 slot -1 flags 0x0
102 ahb* at eisa0 slot -1 flags 0x0
103 fea* at eisa0 slot -1 flags 0x0
UKC> show port 0x300
 25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
 72 we1 at isa0 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
 75 el0 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
 77 ie1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
UKC>

πŸ’€ adding a whole new device

it is possible to add new devices, but only devices that were linked into the kernel. that's the catch, bestie. and if a new device is added, following devices will be renumbered 😭

UKC> find ep
 11 ep0 at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
 12 ep0 at eisa0 slot -1 flags 0x0
 13 ep0 at pci* dev -1 function -1 flags 0x0
 14 ep* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
 15 ep* at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
 16 ep* at eisa0 slot -1 flags 0x0
 17 ep* at pci* dev -1 function -1 flags 0x0
 18 ep* at pcmcia* dev -1 irq -1 flags 0x0
UKC> add ep1
Clone Device (DevNo, 'q' or '?') ? 13
Insert before Device (DevNo, 'q' or '?') 14
 14 ep1 at pci* dev -1 function -1
UKC> change 14
 14 ep1 at pci* dev -1 function -1
change (y/n) ? y
dev [-1] ? 14
function [-1] ?
flags [0] ? 18
 14 ep1 changed
 14 ep1 at pci* dev 14 function -1 flags 0x12
UKC>

⭐ finishing up

when configuration is completed, booting can proceed by issuing the quit or exit commands. go forth, bestie 🌸

UKC> quit
Continuing...
mainbus0 (root)

πŸ’œ SEE ALSO πŸ’œ


πŸŽ€ AUTHORS πŸŽ€

Mats O Jansson <moj@stacken.kth.se> β€” the icon who made this 🫢


✨ that's the whole vibe ✨ β€” this beauty came from the Debian edition of the System Manager's Manual, dated May 5, 2025, and it's BOOT_CONFIG(8) all the way down. mwah πŸ’‹

πŸ“¦ where this page comes from