Skip to content

About

Kernel CI: build a kernel, turn the container into a bootable disk image, boot it under QEMU and run kselftests/LTP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Kernel CI — boot and test scripts

Scripts for building a kernel, turning the build container into a bootable disk image, and booting it under QEMU to run kselftests and LTP.

Unlike qemu -kernel, these boot the full chain — UEFI → GRUB → initramfs → systemd — so they exercise make install, initramfs generation and bootloader config, which direct kernel boot skips.

Extracted from the kernel CI used at CIQ for RHEL-family LTS kernels. Presented at Open Source Summit Europe 2026.

The useful bits

Script What it does
build-container/image_from_container.sh container image → bootable qcow2. GPT + EFI + ext4, fstab by UUID, grub2-mkconfig, unmasks systemd units. Standalone — usable outside any CI.
build-container/boot_kernel.sh boots a qcow2 under QEMU (x86_64 + aarch64, KVM or TCG), waits for a login prompt
build-container/compare_ltp_results.sh diffs two LTP runs: regression / fixed / already-broken, with an expected-failures file
build-container/parse_ltp_results.sh LTP serial-console output → JSON
container/build_kselftests.sh builds kselftests, installs a systemd unit that runs them on boot and powers off
container/build_ltp.sh same, for LTP
container/resolve_kernel_config.sh picks the in-tree config for an arch

Requirements

The host (or a container) needs: podman, qemu-kvm, libguestfs (guestfish), parted, dosfstools. KVM is optional — TCG works, slower.

The image you convert must be bootable: it needs a kernel, systemd, grubby, shim and GRUB-EFI installed, plus a dracut config pulling in the virtio drivers. A plain build container will not boot.

Configuration

build_kernel.sh takes two environment variables:

REGISTRY_PREFIX   container registry holding your builder images
KERNEL_SRC_REPO   git URL of the kernel tree (only if /src isn't a checkout)

Scope

Works today for RHEL-family kernels (Rocky, Alma, CentOS Stream and forks) — grub2-mkconfig, grubby, dracut. Debian/SUSE would need update-grub and initramfs-tools; that's a known gap and a good first contribution.

These scripts are QEMU-only. They catch install, initramfs, bootloader and integration bugs — not hardware-specific driver bugs. For real hardware, see KernelCI + LAVA.

Licence

See LICENCE. Check with your own legal/OSS process before redistributing.

About

Kernel CI: build a kernel, turn the container into a bootable disk image, boot it under QEMU and run kselftests/LTP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages