Skip to content

feat(installer): delete the dracut path; the Flatcar kernel already carries its initramfs #128

Closed as not planned

Description

@castrojo

Design: docs/superpowers/specs/2026-09-13-flatcar-base-migration-design.md (PR #123), phase 2.

The finding

flatcar_production_image_kernel_config.txt for 4593.2.5:

CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="bootengine.cpio"
CONFIG_INITRAMFS_COMPRESSION_XZ=y

The kernel elements/flatcar/flatcar-kernel.bst already imports is self-sufficient. Flatcar publishes a manifest per stage:

Stage Manifest Entries Contents
1 flatcar_production_image_initrd_contents.txt 339 rootfs-0/ shim: 6,772-byte /init, busybox, kmod, dmsetup, veritysetup, empty /realinit + /sysusr/usr
2 flatcar_production_image_realinitrd_contents.txt 2,280 The systemd initrd - same entry count as /usr/lib/flatcar/bootengine.img

Stage 1 sets up dm-verity for /usr and pivots into stage 2. flatcar_production_image.vmlinuz and flatcar_production_pxe.vmlinuz are both 34,245,760 bytes - one kernel, one embedded initramfs.

So the installer has been generating a second initrd to lay over a working one.

Corrections to earlier revisions of this issue

  • flatcar_production_pxe_image.cpio.gz is not a driver initrd: four cpio entries wrapping usr.squashfs at 374 MiB, a RAM-boot OS payload.
  • bootengine.img does not need separate importing either. It is stage 2 of what the kernel already contains.

What still has to go

elements/oci/bluefin-server-installer.bst step 1b: the dracut call with its hand-curated --add-drivers list (origin of the missing usb-storage/uas/sd_mod/xhci-pci/ahci bugs), the two-root ld.so.conf/ld.so.cache staging at lines 108-124, grep/sed in build-depends, and the module force-load + udevadm settle workaround.

What has to arrive

Conformance to the cmdline the embedded initramfs expects. From Flatcar's shipped usr/boot/syslinux/root.A.cfg:

root=LABEL=ROOT rootflags=subvol=root usr=PARTLABEL=USR-A

The DDI has neither a USR-A verity pair nor a ROOT label, and this design rejects Ignition, so stage 2's ignition-fetch/disks/mount/files/kargs units and sysroot-boot.service must be masked.

Options, ranked, to be settled by the phase 4 boot proof (#130):

  1. Conform to Flatcar's layout - USR-A/USR-B verity pair plus ROOT-labelled root in files/installer/repart.d/. Largest change, but it is the only layout upstream tests, and it delivers roadmap items 1-3 (A/B slots, read-only /usr, dm-verity) as a side effect rather than as three separate projects.
  2. Override the built-in initramfs with an external one. Today's behavior; keeps us owning a generator forever.
  3. mkosi-initrd --generic --kernel-version=6.12.102-flatcar - the systemd project's own generator, if the current partition layout must be preserved.

Acceptance

  • dracut call, ld.so.cache staging, and force-load/settle workaround deleted; no replacement generator added.
  • Target boots on the kernel's built-in initramfs with Ignition units masked.
  • Root mounts without an Ignition config present.
  • just show-me-the-future installs and boots without manual initrd repair.
  • Installer contract tests updated for the removed steps.

Activity

  1. changed the title [-]feat(installer): assemble the target UKI from upstream Flatcar kernel and initrd, delete the dracut path[/-] [+]feat(installer): boot the target from Flatcar bootengine.img, delete the dracut path[/+] on Sep 13, 2026
  2. changed the title [-]feat(installer): boot the target from Flatcar bootengine.img, delete the dracut path[/-] [+]feat(installer): delete the dracut path; the Flatcar kernel already carries its initramfs[/+] on Sep 13, 2026
  3. castrojo commented on Sep 13, 2026

    @castrojo
    ContributorAuthor

    Verified empirically, not just from the kernel config.

    Booted the pinned flatcar_production_image.vmlinuz in QEMU with no -initrd and no disk attached:

    qemu-system-x86_64 -enable-kvm -m 2048 -cpu host -nographic -no-reboot \
      -kernel <cached flatcar_production_image.vmlinuz> \
      -append "console=ttyS0,115200n8 root=LABEL=ROOT usr=PARTLABEL=USR-A"
    

    Result:

    [    0.000000] Linux version 6.12.102-flatcar (build@pony-truck.infra.kinvolk.io) ...
    [    0.025767] Kernel command line: rootflags=rw mount.usrflags=ro console=ttyS0,115200n8 root=LABEL=ROOT usr=PARTLABEL=USR-A
    [    1.053101] Run /init as init process
    [    1.171015] SCSI subsystem initialized
    ...
    Waiting for drive...
    Still waiting for drive...
    
    • Run /init as init process with no initrd supplied - the initramfs is compiled in and live.
    • Stage 1 loaded storage modules then blocked on Waiting for drive..., the busybox shim hunting for usr=PARTLABEL=USR-A. That is the boot contract asserting itself.
    • rootflags=rw mount.usrflags=ro precedes the appended args: the kernel carries a built-in CONFIG_CMDLINE, so a UKI cmdline merges with it rather than replacing it. Worth knowing before anyone sets --cmdline in ukify and expects full control.

    Recorded in the spec at bc5df5e on PR #123.

  4. castrojo commented on Sep 13, 2026

    @castrojo
    ContributorAuthor

    Decision made: follow Flatcar's design. Option 1 adopted; options 2 and 3 dropped.

    Stage 1's /init was extracted from the kernel's embedded initramfs and read directly rather than inferred. The contract, and what each part forces:

    This ticket now reduces to its original core: delete the dracut call, the two-root ld.so.cache staging, the grep/sed build-depends, and the force-load/settle workaround. No replacement generator.

  5. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    and removed
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Sep 25, 2026
  6. jeefy commented on Sep 29, 2026

    @jeefy
    Collaborator

    Superseded by #262: the OS no longer uses a Flatcar kernel or its bundled initramfs. The kernel comes from freedesktop-sdk and the initrd is built from FSDK components (elements/bluefin-server/initrd/), so there is no dracut path to delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions