composefs: Open deployments dir from physical root, not ambient path#2115
Open
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Open
composefs: Open deployments dir from physical root, not ambient path#2115cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Conversation
find_vmlinuz_initrd_duplicates() previously opened the absolute path /sysroot/state/deploy via STATE_DIR_ABS, which breaks in the case when we're doing an install outside of a container. We hit this in bootc-dev#1911 Fix by passing a Dir opened relative to the target's physical_root. During fresh install the state dir naturally does not exist yet, so open_dir_optional returns None and the check is skipped -- no special-case guard needed. Also plumb physical_root through the setup_composefs_bls_boot match arms, and replace the hardcoded "/sysroot" in the Upgrade arm with storage.physical_root_path. Assisted-by: OpenCode (Claude Opus 4) Signed-off-by: Colin Walters <walters@verbum.org>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the boot setup logic to use relative paths instead of absolute ambient paths when searching for duplicate boot entries. Key changes include updating find_vmlinuz_initrd_duplicates to accept a directory handle and modifying setup_composefs_bls_boot to resolve the physical root and open the deployment directory relative to it, ensuring correct behavior during installation. I have no feedback to provide.
Collaborator
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.
find_vmlinuz_initrd_duplicates() previously opened the absolute path /sysroot/state/deploy via STATE_DIR_ABS, which breaks in the case when we're doing an install outside of a container.
We hit this in #1911
Fix by passing a Dir opened relative to the target's physical_root. During fresh install the state dir naturally does not exist yet, so open_dir_optional returns None and the check is skipped -- no special-case guard needed.
Also plumb physical_root through the setup_composefs_bls_boot match arms, and replace the hardcoded "/sysroot" in the Upgrade arm with storage.physical_root_path.
Assisted-by: OpenCode (Claude Opus 4)