第 9 章 在 bootc 系统中管理内核参数
您可以使用 bootc
来配置内核参数。默认情况下,bootc
使用存储在 /boot/loader/entries
中的引导装载程序配置文件。此目录定义提供给 Linux 内核的参数。一组内核参数是特定于机器的状态,但您也可以使用容器更新来管理内核参数。引导装载程序菜单条目在多个操作系统和引导装载程序间共享。
注意
目前,引导装载程序条目由 OSTree 后端编写。
9.1. 如何添加支持来使用 bootc 注入内核参数 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
bootc
工具使用通用操作系统内核。您可以通过以 TOML 格式添加自定义配置来注入内核参数,格式为 /usr/lib/bootc/kargs.d
。例如:
/usr/lib/bootc/kargs.d/10-example.toml
# /usr/lib/bootc/kargs.d/10-example.toml
kargs = ["mitigations=auto,nosmt"]
您还可以使用 match-architectures
键使这些内核参数特定于架构。例如:
/usr/lib/bootc/kargs.d/00-console.toml
# /usr/lib/bootc/kargs.d/00-console.toml
kargs = ["console=ttyS0,114800n8"]
match-architectures = ["x86_64"]