bootc-container-split-kernel-and-rootfs - Man Page

Split kernel and rootfs from a container image

Synopsis

bootc container split-kernel-and-rootfs

Description

Split kernel and rootfs from a container image

Options

--rootfs=ROOTFS

Operate on the provided rootfs

Default: /

--output=OUTPUT

Output directory for the extracted kernel files

Examples

Extract kernel files from the current root filesystem to /kernel:

bootc container split-kernel-and-rootfs --output /kernel

This extracts the kernel and initramfs from the current root filesystem (/) and places them in /kernel/<kernel-version>/ with filenames vmlinuz and initramfs.img​. Files that belong to the kernel binary are moved along with it under the same names, when present. Currently that is only the FIPS HMAC file (​.vmlinuz.hmac) shipped by Fedora and RHEL derivatives. Other files in /usr/lib/modules/<kernel-version>/, such as config or System.map, stay in the rootfs.

Extract kernel files from a mounted container rootfs:

bootc container split-kernel-and-rootfs --rootfs /mnt/container-rootfs --output /output/kernels

This extracts kernel files from a container filesystem mounted at /mnt/container-rootfs and places them in the output directory.

Example output structure:

After running the command, the output directory will contain:

/output/kernels/
└── 6.5.0-15-generic/
    ├── .vmlinuz.hmac (Fedora/RHEL, if present)
    ├── vmlinuz
    └── initramfs.img

where 6.5.0-15-generic is the detected kernel version from the source rootfs.

See Also

bootc(8)

Version

v1.17.1