feat(install): enable systemd-boot for ostree backend#2099
Open
andrewdunndev wants to merge 1 commit intobootc-dev:mainfrom
Open
feat(install): enable systemd-boot for ostree backend#2099andrewdunndev wants to merge 1 commit intobootc-dev:mainfrom
andrewdunndev wants to merge 1 commit intobootc-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables systemd-boot support for ostree-based installations by implementing a synchronization mechanism that copies boot artifacts from the ext4 /boot partition to the FAT32 ESP. Key changes include the addition of sync_boot_to_esp to manage BLS entries and kernel files, ensuring /boot is formatted as ext4 for POSIX compatibility, and configuring ostree with sysroot.bootprefix=false. Review feedback recommends enhancing the robustness of the BLS configuration parser to handle complex values and simplifying path expressions in the installation logic to reduce unnecessary cloning.
68ca265 to
8b06e22
Compare
Replace the bail!("bootupd is required for ostree-based installs") with
working systemd-boot support for the ostree backend. The approach keeps
ostree's ext4 /boot for its internal hardlink/symlink management, then
copies BLS entries and kernel artifacts to the FAT32 ESP where
systemd-boot can read them.
Three changes:
- baseline.rs: force ext4 /boot partition for systemd-boot + ostree
- install.rs: set sysroot.bootprefix=false, replace bail with
install_systemd_boot() + sync_boot_to_esp()
- bootloader.rs: new sync_boot_to_esp() function that copies BLS
entries, kernel, and initrd from /boot to the ESP
Tested on Fedora 42 with QEMU + OVMF: system boots with systemd-boot
v257, ostree deployment active, kargs.d entries in /proc/cmdline.
This covers install-time support. Upgrade-time ESP sync is a follow-up
because ostree staging does not write BLS entries to /boot until the
next boot (ostree-finalize-staged.service).
Signed-off-by: Andrew Dunn <andrew@dunn.dev>
8b06e22 to
9789cde
Compare
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.
Replace the
bail!("bootupd is required for ostree-based installs")with working systemd-boot support for the ostree backend. The approach keeps ostree's ext4 /boot for its internal management, then copies BLS entries and kernel artifacts to the FAT32 ESP where systemd-boot can read them.Changes
baseline.rs: Force a /boot partition when
Bootloader::Systemd+ non-composefs. Format it as ext4 (ostree needs POSIX fs for hardlinks/symlinks).install.rs: Set
sysroot.bootprefix=falsefor systemd-boot so BLS paths are relative to /boot root, not prefixed with/boot/. Replace the bail withinstall_systemd_boot()+sync_boot_to_esp().bootloader.rs: New
sync_boot_to_esp()function (~100 lines) that mounts the ESP, reads BLS entries from /boot/loader/entries/, and copies .conf files + referenced kernel + initrd to the ESP.Partition layout
Test results
GCP n2-standard-8, nested KVM, Fedora 42, QEMU + OVMF 4M:
Scope
This covers install-time support only. See #2098 for discussion of the upgrade-time ESP sync -- ostree staging does not write BLS entries to /boot until the next boot (
ostree-finalize-staged.service), so the upgrade path needs a different approach.Relates to #2098, #92