trim: run firmware strip pre-dracut so the UKI initramfs shrinks too

Follow-up to the linux-firmware strip (prev commit put it in the 2d hygiene
block, which runs AFTER the dracut build — so it only shrank the rootfs erofs,
not the initramfs). Move the strip to step 2, before the dracut build: with
--no-hostonly, plymouth's drm dep instmods a broad DRM set and dracut bundles
each module's firmware into the initramfs (amdgpu being the classic UKI
bloater). Trimming first means dracut never sees it, so both the rootfs erofs
AND the UKI initramfs shrink. Keep-list is unchanged (i915 + intel/ + mellanox
+ intel-ucode), so the fleet splash GPU (i915) and ice DDP firmware the
initramfs actually needs are retained; dracut just warns 'firmware not found'
for the removed drm modules and continues.

Add a post-build diagnostic (initramfs .img size + bundled firmware, expected
i915 only) so the initrd win is measured in the build log, not estimated.
This commit is contained in:
Audiobuzz
2026-07-03 05:36:51 +00:00
parent 9464e7fc2a
commit f59eb7942a
2 changed files with 42 additions and 25 deletions
+6 -1
View File
@@ -1483,7 +1483,12 @@ pulls `glibc-all-langpacks` (all languages); swapped for `glibc-minimal-langpack
`glibc-langpack-en`. ~220 MB reclaimed; image is English-only (we also strip
`/usr/share/locale` in 2d). **BENCH-VERIFY:** locale still `en_US.UTF-8`; kiosk + login OK.
**[x] DONE — linux-firmware strip to a hardware-audited keep-list** (`diskless.pkr.hcl` 2d).
**[x] DONE — linux-firmware strip to a hardware-audited keep-list** (`diskless.pkr.hcl`
step 2, run **BEFORE the dracut build** so the UKI initramfs shrinks too — not just the
rootfs. `--no-hostonly` + plymouth's `drm` dep instmods a broad DRM set and dracut bundles
each module's firmware into the initramfs, amdgpu being the classic UKI bloater; the strip
runs first so dracut never sees it. A post-build diagnostic reports the `.img` size + any
firmware still bundled — expected i915 only.)
Live fleet audit (`modinfo -F firmware` over all loaded modules + sysfs/`lspci` driver
bindings on the real 820-class hosts AND the VMs) proved the **only** loadable firmware
any host requests is Intel **i915** (GPU). Every other driver is firmware-free —