BOOTC-KE...RGUMENTS(7)

πŸ“¦
version 1.17.1 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– bootc-kernel-arguments πŸ’–

okay so bestie, welcome to bootc-kernel-arguments β€” it's a page from the Miscellaneous Information Manual, section 7, and we're about to get SO cozy with kernel arguments. grab a snack πŸ“


✨ NAME ✨

bootc-kernel-arguments β€” Kernel arguments. that's it, that's the whole name, she's simple and she knows what she is πŸ’…


🌸 DESCRIPTION 🌸

so the default bootc model is out here using "type 1" bootloader config files (spec is at https://uapi-group.org/specifications/specs/boot_loader_specification/) stored in /boot/loader/entries, and those little guys are what define the arguments handed to the Linux kernel. no cap, that's where the tea is. πŸ«–

the set of kernel arguments can be machine-specific state, but it can also be managed via container updates. both. she contains multitudes. ✨

the bootloader entries are currently written by the OSTree backend. yes, that one.

want more on Linux kernel arguments in general? https://docs.kernel.org/admin-guide/kernel-parameters.html β€” go read, i'll wait πŸŽ€

/usr/lib/bootc/kargs.d πŸ¦‹

Many bootc use cases are gonna use generic "OS/distribution" kernels. so to support injecting kernel arguments, bootc supports a small custom config file format in /usr/lib/bootc/kargs.d β€” TOML format, bestie β€” and it looks like this:

# /usr/lib/bootc/kargs.d/10-example.toml
kargs = ["mitigations=auto,nosmt"]

iconic. but wait, there's more πŸ’– there's ALSO support for making these kernel arguments architecture specific via the match-architectures key:

# /usr/lib/bootc/kargs.d/00-console.toml
kargs = ["console=ttyS0,115200n8"]
match-architectures = ["x86_64"]
NOTE: the architecture matching here accepts values defined by the Rust standard library (see https://doc.rust-lang.org/std/env/consts/constant.ARCH.html), and it uses the architecture of the bootc binary itself. important detail, don't skip it πŸ™ˆ

and in some cases for Linux, this matches the value of uname -m, but definitely not all. for example: on Fedora derivatives there's ppc64le, but in Rust only powerpc64. a common discrepancy is that Debian derivatives use amd64, whereas Rust (and Fedora derivatives) use x86_64. the way these two just don't agree?? 😭

πŸ’… Changing kernel arguments post-install via kargs.d

changes to kargs.d files that are included in a container build are honored post-install β€” the difference between the set of kernel arguments gets applied to the current bootloader configuration. and it preserves any machine-local kernel arguments. she's respectful like that. 🫢

Kernel arguments injected at installation time πŸ”₯

the bootc install flow supports a --karg to provide install-time kernel arguments. these become machine-local state. periodt.

higher level install tools can inject kernel arguments this way too (ideally at least using bootc install to-filesystem); for example, the Anaconda installer at https://github.com/rhinstaller/anaconda has a bootloader verb which ultimately uses an API similar to this. team effort, love that for us 🌈

post-install, it is supported for any tool to edit the /boot/loader/entries files, which are in a standardized format. go off, tools.

typically, /boot is mounted read-only to limit the set of tools which write to this filesystem. it is not "physically" read-only by default. one approach to edit them is to run a tool under a new mount namespace, e.g.

unshare -m
mount -o remount,rw /boot
# tool to edit /boot/loader/entries

at the current time, bootc does not itself offer an API to manipulate kernel arguments maintained per-machine. she's not doing that rn. 🫀

other projects such as rpm-ostree do, via e.g. rpm-ostree kargs, which is just a frontend for editing the bootloader configuration files. ⭐ note an important detail: rpm-ostree kargs always creates a new deployment. always always.

rpm-ostree kargs and bootc will interoperate as they both use the ostree backend today, and any kernel arguments changed via that mechanism will persist across upgrades. slay.

⚠️ it is currently undefined behavior to remove kernel arguments locally that are included in the base image via /usr/lib/bootc/kargs.d. do not do this. i am begging you. πŸ˜­πŸ’€

Injecting default arguments into custom kernels 🧚

the Linux kernel supports building arguments into the kernel binary, at the time of this writing via the config CMDLINE build option. so if you're building a custom kernel, it often makes sense to use that instead of /usr/lib/bootc/kargs.d, for example. different tool, same dream πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


⭐ VERSION ⭐

v1.17.1


and that's the whole page, bestie πŸ’– u ate. this was BOOTC-KE...RGUMENTS(7) β€” yes the title is abbreviated like that, no i don't know why, iykyk β€” from the Miscellaneous Information Manual, brought to you at version v1.17.1. go forth and configure responsibly. mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from
  • fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms