installer: Rebuild initramfs for LUKS installs so crypttab reaches the initramfs - #186
Open
ggiesen wants to merge 1 commit into
Open
installer: Rebuild initramfs for LUKS installs so crypttab reaches the initramfs#186ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
A UEFI lvm-on-luks install completes but cannot boot: it drops to an initramfs rescue shell with "ALERT! /dev/mapper/lvmmint-root does not exist", because the crypttab never reaches the initramfs. The target is copied from the live squashfs, so it inherits live-boot's diverted update-initramfs -- a wrapper that no-ops unless the live medium is mounted at /run/live/medium inside the chroot. The engine bind-mounts /run non-recursively, so that submount is absent and the update-initramfs call is silently skipped; the crypttab is never baked in. On BIOS the copied live initrd happens to unlock and boot from the kernel cmdline, so the failure is firmware-dependent -- UEFI is broken. For LUKS, remove live-boot's initramfs hook (it references a live-only path and fails on the installed system) and run the real, un-diverted update-initramfs so the crypttab is baked in. No-ops cleanly where there is no diversion or hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A UEFI encrypted (LVM-on-LUKS) install completes but cannot boot: it drops to an initramfs shell (
ALERT! /dev/mapper/lvmmint-root does not exist). The target inherits live-boot's divertedupdate-initramfs, which no-ops unless the live medium is mounted at/run/live/mediuminside the chroot./runis bind-mounted non-recursively, so that submount is absent andfinish_installation()'supdate-initramfscall is silently skipped, leaving the crypttab out of the initramfs.Fix, gated on
self.setup.luks: remove live-boot's initramfs hook (/usr/share/initramfs-tools/hooks/live, which references the live-only/usr/lib/live/bootand fails on the installed system), resolve the real un-divertedupdate-initramfsviadpkg-divert --truename, and run it in the chroot so the cryptsetup hook bakes in/conf/conf.d/cryptroot.Scope/regression: the guard means plain and LVM-without-encryption installs are untouched. On a target with no live-boot diversion,
dpkg-divert --truenamereturns the plain/usr/sbin/update-initramfsand therm -fof the absent hook is a no-op, so it just runsupdate-initramfsone extra (harmless) time. On BIOS, where this layout already boots, the rebuild is a harmless no-op improvement. The manual-partition (skip_mount) dm-crypt path is not covered.Testing (LMDE 7, OVMF/QEMU): a UEFI LVM-on-LUKS install on
masterdrops to an initramfs shell at boot; with this change it prompts for the passphrase, unlocks, and boots. BIOS installs of the same layout boot in both cases.Split out of #180 so it can be reviewed and land independently.
Fixes #183