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 --kargcommand.
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
Create files within
/usr/lib/bootc/kargs.dwith kernel arguments.$ sudo tee /usr/lib/bootc/kargs.d/console.kargs << EOF console=tty0 console=ttyS0,115200n8 EOFFetch the container image to get the OSTree commit.
$ podman pull quay.io/<your_org>/<your_bootc_image>:latestUse the OSTree commit to return the file tree.
# bootc install to-filesystem --karg=root=<UUID>=<uuid of /mnt> --imgref $self /mntNavigate to the
/usr/lib/bootc/kargs.dkernel arguments directory.cd /usr/lib/bootc/kargs.dRead each file within the kernel arguments directory.
$ find /usr/lib/bootc/kargs.d -name ".kargs" -exec cat {} \;*Push the contents of each
kargsfile into a file containing all the neededkargs.$ CONSOLIDATED_KARGS="/tmp/all-kargs.txt"Pass the
kargsto thestage()function.$ bootc kargs --append="$KARGS_STRING"Apply the kernel arguments to switch, upgrade, or edit during operations.
$ bootc switch --transport=registry quay.io/<your_org>/<your_bootc_image>:latest