12.2. Modifying kernel arguments by using bootc install configurations


You can use the bootc install command with the --karg option to inject kernel arguments during installation time in the following ways:

  • Adding kernel arguments into the container image.
  • Adding kernel arguments by using the bootc install --karg command.

Use the kernel arguments on Day 2 operations, by adding the arguments and applying them on a switch, upgrade, or edit.

Prerequisites

  • You created a container image.

Procedure

  1. Create files within /usr/lib/bootc/kargs.d with kernel arguments.

    $ sudo tee /usr/lib/bootc/kargs.d/console.kargs << EOF
    console=tty0 console=ttyS0,115200n8
    EOF
  2. Fetch the container image to get the OSTree commit.

    $ podman pull quay.io/<your_org>/<your_bootc_image>:latest
  3. Use the OSTree commit to return the file tree.

    # bootc install to-filesystem --karg=root=<UUID>=<uuid of /mnt> --imgref $self /mnt
  4. Navigate to the /usr/lib/bootc/kargs.d kernel arguments directory.

    cd /usr/lib/bootc/kargs.d
  5. Read each file within the kernel arguments directory.

    $ find /usr/lib/bootc/kargs.d -name ".kargs" -exec cat {} \;*
  6. Push the contents of each kargs file into a file containing all the needed kargs.

    $ CONSOLIDATED_KARGS="/tmp/all-kargs.txt"
  7. Pass the kargs to the stage() function.

    $ bootc kargs --append="$KARGS_STRING"
  8. Apply the kernel arguments to switch, upgrade, or edit during operations.

    $ bootc switch --transport=registry quay.io/<your_org>/<your_bootc_image>:latest
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部