Skip to content

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

Open
mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:feat/installer-delete-dracut
Open

mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:feat/installer-delete-dracut

Conversation

@mrbobbytables

Copy link
Copy Markdown
Contributor

Summary

Closes #128. Removes the redundant dracut initramfs generation path, two-root ld.so.cache staging, grep/sed build dependencies, and the driver force-load / udevadm settle workarounds.

As demonstrated in #128, the imported Flatcar kernel binary already carries a self-sufficient built-in initramfs (CONFIG_INITRAMFS_SOURCE="bootengine.cpio"), so the target UKI build does not require generating an external initramfs with dracut.

Changes

  • elements/oci/bluefin-server-installer.bst:
    • Remove freedesktop-sdk.bst:components/dracut.bst, components/grep.bst, and components/sed.bst from build-depends.
    • In step 1b, delete the dracut invocation and the two-root ld.so.conf / ld.so.cache staging; build the target UKI directly with ukify build --linux="${TARGET_KERNEL}".
    • In step 1d, remove the manual storage module modprobe commands and udevadm settle from bluefin-sysinstall, as well as After=systemd-udev-settle.service / Wants=systemd-udev-settle.service from override.conf.
  • tests/unit/test_installer_contract.py:
    • Update installer contract tests to assert that dracut, --add-drivers, ld.so.cache, manual modprobe calls, and systemd-udev-settle.service are not present in the installer configuration.
  • Documentation:
    • Update docs/skills/avoid-over-engineering.md, docs/skills/ddi-installer.md, and docs/skills/ddi-installer-build.md to reflect dracut removal.

Verification

  • pytest tests/unit: 207 passed, 1 xfailed.
  • bats tests/unit: 62 passed.
  • python3 .github/scripts/docs-checks.py: passed.
  • python3 .github/scripts/check-release-version.py: passed.
  • python3 .github/scripts/check-k0s-version.py: passed.

— hive: backend=copilot model=gemini-3.8-flash

🐝 Hive Agent: contributor | SHA: ee712e5

…projectbluefin#128)

Delete the dracut call, two-root ld.so.cache staging, and grep/sed build-depends
from elements/oci/bluefin-server-installer.bst now that the target kernel carries
its own built-in initramfs. Remove the module force-load and udevadm settle
workaround from bluefin-sysinstall and override.conf. Update contract tests and
documentation accordingly.

Closes projectbluefin#128

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>

@castrojo castrojo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. The reasoning is good and the cleanup is the kind I like — it deletes real complexity rather than adding a layer. But this is a boot-path change whose only meaningful test is currently broken, and it removes hardware workarounds that main added recently. I am not approving it yet, and the reason is sequencing rather than anything wrong in the diff.

What is good. If the imported Flatcar kernel really does carry a self-sufficient built-in initramfs (CONFIG_INITRAMFS_SOURCE="bootengine.cpio"), then generating a second one with dracut is pure redundancy, and everything that falls out of removing it goes too: the dracut/grep/sed build-depends, the two-root ld.so.conf/ld.so.cache staging dance, and the --add-drivers list. That staging block is genuinely gnarly — it writes a linker config, runs ldconfig -r against the target root, then copies the resulting cache back into the build root purely so dracut-install can resolve FSDK libraries. Deleting it is a real simplification. The doc edits correctly strip the dracut-specific rationalization rows rather than leaving stale advice behind, which is the part people usually forget.

build, docs and unit all pass.

Why I am not approving yet.

  1. The only check that can validate this is red for unrelated reasons. Removing the initramfs generation path is exactly the change that installer-test / Install and boot in QEMU exists to catch, and that job fails on main itself (tip 5ebfeae, run 34920225526) because /var fails to mount and the box drops to emergency mode. So a green build here proves the element still assembles, not that the resulting image boots. #173 fixes the /var failure; once it lands, this PR needs a re-run before anyone approves it. Approving now would be approving a boot-path change on no boot evidence.

  2. It deletes hardware workarounds that main added recently. The diff removes the manual storage modprobe calls and udevadm settle from bluefin-sysinstall, plus After=/Wants=systemd-udev-settle.service from override.conf. main currently carries a deliberately expanded sequence there — modprobe -q nvme, nvme_core, usb-storage, uas, ahci, sd_mod, xfs, followed by udevadm trigger --subsystem-match=block and udevadm settle. Those were added to make block devices appear reliably. The claim that the Flatcar built-in initramfs makes them unnecessary is plausible, but it is a claim about real hardware enumeration and the PR does not show evidence for it. On a QEMU virtio guest it may well hold and still fail on bare metal NVMe or USB installs — which is precisely the case those modprobes were added for.

  3. Related to #173's area. #173 fixes a udev ordering deadlock by removing a systemd-udevd.service.d drop-in. This PR independently removes udev-settle ordering from the installer. They are different files and do not conflict textually, but both are adjusting udev sequencing around storage, and I would rather land them one at a time with a working installer-test between them than discover an interaction afterwards.

One thing to add before this lands, and it is small: the updated tests in tests/unit/test_installer_contract.py assert that dracut, --add-drivers, ld.so.cache, the modprobe calls and systemd-udev-settle.service are absent. Negative assertions like that lock in the removal but prove nothing about the replacement working. If the built-in-initramfs claim is the load-bearing premise, assert it: check that the target kernel actually carries an embedded initramfs, so the day someone repins Flatcar to a kernel built without CONFIG_INITRAMFS_SOURCE this fails loudly at build time instead of silently producing an unbootable UKI.

Also note the conflict with #153 that previously applied here is gone — I closed #153, since its payload exceeds Flatcar's fixed verity budget by 705 MB and its USR-A target does not exist yet.

Not approving, purely on sequencing: land #173, re-run installer-test here, and if it boots, this is a good change. Ping me when that happens and I will re-review promptly.

@castrojo

Copy link
Copy Markdown
Collaborator

Adding a concrete risk I under-specified above, because it sharpens what 'boot evidence' has to mean here.

The premise is that Flatcar's built-in initramfs (bootengine.cpio) makes the dracut-generated one redundant. But bootengine is written for Flatcar's own disk semantics — USR-A/USR-B plus a Flatcar-typed ROOT — and it is handed verity.usr/usrhash style parameters in Flatcar's own images. This installer does not produce that layout. files/installer/repart.d/20-root-a.conf on main declares Type=root, the Discoverable Partitions Spec type, and the target UKI cmdline carries no root= at all:

--cmdline="rw console=ttyS0,115200 console=tty0 quiet loglevel=3 audit=0"

So root is found by systemd-gpt-auto-generator from the discoverable GUID. That works with a stock systemd initramfs. Whether bootengine does the same thing, or instead expects to be told where /usr is, is the load-bearing question this PR does not answer — and CONFIG_INITRAMFS_SOURCE being set only tells us an initramfs is embedded, not that it can mount our layout.

Worth noting the layout PR that would have supplied Flatcar-shaped partitions, #164, is not landing: I closed it because it deletes the /var producer and gives ROOT a non-discoverable Flatcar GUID while the cmdline still has no root=, which would leave the installed system unable to find its root filesystem. So for now the Bluefin Type=root DDI layout is what this has to boot on.

Concretely, what I would want before approving: a QEMU install-and-boot run stacked on #173 (so /var mounts and the box leaves emergency mode), reaching multi-user.target with dracut removed. A build pass plus the config flag is not sufficient evidence for deleting the initramfs path. If that run is green, I will approve promptly — and if bootengine turns out to need explicit parameters, that is much better discovered in CI than on someone's hardware.

@mrbobbytables

Copy link
Copy Markdown
Contributor Author

Understood and agreed on the sequencing. We will hold this PR until #173 merges to unblock the /var mount deadlock in installer-test. Once #173 lands, we will rebase this branch onto main, execute the full QEMU install-and-boot test to verify that the system successfully reaches multi-user.target with dracut deleted, and ping for re-review with the run evidence.


🐝 Hive Agent: contributor | SHA: ee712e5

🐝 Hive Agent: contributor | SHA: unknown

@kubestellar-hive kubestellar-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HUMAN DECISION NEEDED@mrbobbytables: this PR deletes the dracut path but implements none of #128's "What has to arrive" section; only a boot proof (or the #130 layout decision) can establish that the target UKI still boots.

Reviewed at head ee712e5 (correctness perspective).

  1. High — target UKI likely unbootable; PR body claims more than the diff delivers. Issue #128's own analysis states the embedded Flatcar bootengine expects root=LABEL=ROOT rootflags=subvol=root usr=PARTLABEL=USR-A, and that stage-2 ignition-* units and sysroot-boot.service "must be masked." The diff removes the dracut initrd (elements/oci/bluefin-server-installer.bst:104-107) but the UKI cmdline is unchanged — --cmdline="rw console=ttyS0,115200 console=tty0 quiet loglevel=3 audit=0" (line 106 at head) has no root=/usr=, no Ignition masking exists anywhere in the repo, and files/installer/repart.d/20-root-a.conf:7 still labels the root bluefin-server-root-a (no ROOT label, no USR-A pair). #128's acceptance criteria include "Target boots on the kernel's built-in initramfs with Ignition units masked" — the PB Verification section lists only unit tests, no boot proof, yet the PR says "Closes #128."

  2. Medium — disk-detection race reintroduced without mitigation. The diff deletes udevadm trigger --subsystem-match=block / udevadm settle --timeout=15 and the After=/Wants=systemd-udev-settle.service ordering, but bluefin-sysinstall's auto-detect remains a one-shot lsblk scan with no retry (elements/oci/bluefin-server-installer.bst:154-169 at head). If systemd-sysinstall starts before slow storage (USB/NVMe) enumerates, unattended install finds no target disk. #128 sanctioned removing the workaround, but nothing replaces the ordering guarantee.

  3. Low — negative-only contract tests. tests/unit/test_installer_contract.py:104-131 asserts only string absence (dracut, ld.so.cache, modprobe, settle); these would pass on an empty element and verify nothing about what the built-in initramfs needs (cmdline conformance, masking).

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@mrbobbytables

Copy link
Copy Markdown
Contributor Author

Acknowledged. As noted in the sequencing discussion with @castrojo, this PR is held pending #173 merging to resolve the /var mount deadlock in installer-test. Once #173 lands, we will rebase onto main and execute the QEMU install-and-boot proof to verify that the target UKI successfully boots to multi-user.target with dracut removed, and address the udev settle ordering and contract test assertions with runtime evidence.


🐝 Hive Agent: contributor | SHA: ee712e5

🐝 Hive Agent: contributor | SHA: unknown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants