initrd: add boot partition preflight check and documentation#2073
Open
MarkAtwood wants to merge 1 commit intolinuxboot:masterfrom
Open
initrd: add boot partition preflight check and documentation#2073MarkAtwood wants to merge 1 commit intolinuxboot:masterfrom
MarkAtwood wants to merge 1 commit intolinuxboot:masterfrom
Conversation
Heads requires /boot to be a separate, unencrypted block device partition (CONFIG_BOOT_DEV). This has always been true but was never enforced at runtime. A missing or wrong CONFIG_BOOT_DEV produced confusing first-boot-style whiptail dialogs instead of a clear error. Add check-boot-partition, a preflight script called at the top of gui-init before mount_boot(). It validates: - CONFIG_BOOT_DEV is set - CONFIG_BOOT_DEV exists and is a block device - CONFIG_BOOT_DEV is not the same device as / - CONFIG_BOOT_DEV is not LUKS-encrypted (via blkid) On any hard failure it calls die() with a human-readable explanation, dropping to the recovery shell with the error visible in scrollback. Also add doc/boot-partition-requirements.md — first-class in-repo documentation of the requirement, including correct/incorrect layout examples, OS-specific notes (Debian, Fedora, Qubes, NixOS, Guix), and recovery instructions. Note: initrd/bin/init does not exist in the current tree, so the preflight check is only added to gui-init. If a non-GUI init path is added in the future, it should also call check-boot-partition. Fixes the silent-failure mode reported in passing in issue linuxboot#959. Related: linuxboot#753, linuxboot#1620, linuxboot#531 Signed-off-by: Mark Atwood <mark.atwood@gmail.com>
tlaurion
reviewed
Mar 15, 2026
|
|
||
| ### Debian / Ubuntu | ||
|
|
||
| The default installer in recent versions creates a single encrypted |
Collaborator
There was a problem hiding this comment.
Not true if using dvd live install, which detects legacy bios and creates unencrypted /boot
Collaborator
|
Will test later but unsure why initrd/etc/detect_boot_device not enough/not the place to implement those improvements. We might force check earlier, but unsure of redundancy and addition of other scripts as of origin/master, initrd/etc/functions: detect_boot_device looks like: |
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.
Problem
Heads has always required
/bootto be a separate, unencrypted partition (CONFIG_BOOT_DEV). This is the foundation of the entire integrity model — Heads runs from ROM, measures/bootbefore the OS runs, and kexec's the kernel only after GPG signature and TPM PCR verification pass. If/bootis encrypted or merged into/, none of that is possible.The failure mode was silent degradation. A wrong layout produced whiptail dialogs asking "would you like to configure the /boot device now?" — identical to normal first-boot prompts — with no indication the disk layout was fundamentally incompatible. Execution continued with
/bootunmounted.Noted without enforcement in issue #959:
Changes
initrd/bin/check-boot-partition(new, executable)Preflight validator with five checks:
CONFIG_BOOT_DEVis set; device exists; it is a block device; it is not the same device as/; it is notcrypto_LUKSperblkid. Hard failures calldie(). Warnings for soft mismatches (already-mounted device mismatch).initrd/bin/gui-init(modified)Call
check-boot-partitionas the first substantive action, before any whiptail dialogs. If it fails, the user drops to the recovery shell with a clear error rather than a misleading setup prompt.initrd/bin/init(not modified)Does not exist in the current tree. If a non-GUI init path is added in the future, it should also call
check-boot-partition.doc/boot-partition-requirements.md(new)First-class in-repo documentation: why the requirement exists, correct vs incorrect layouts, OS-specific notes (Debian, Fedora, Qubes, NixOS, Guix), how to set
CONFIG_BOOT_DEV, what the new errors mean, how to recover.Testing checklist
/boot): boots normallyCONFIG_BOOT_DEVunset: recovery shell with clear errorCONFIG_BOOT_DEVpointing to nonexistent device: clear errorCONFIG_BOOT_DEVpointing to LUKS partition: clear errorRelated
Fixes silent failure noted in #959. Related: #753, #1620, #531