Skip to content

Add support for installing to devices with multiple parents#1068

Draft
ckyrouac wants to merge 7 commits intocoreos:mainfrom
ckyrouac:multi-device-commit-cleanup
Draft

Add support for installing to devices with multiple parents#1068
ckyrouac wants to merge 7 commits intocoreos:mainfrom
ckyrouac:multi-device-commit-cleanup

Conversation

@ckyrouac
Copy link

@ckyrouac ckyrouac commented Mar 5, 2026

See individual commits for details. Generally, this migrates to using the new blockdev crate funtions and standardize on the Device struct operating on block devices. On top of this, handle the --filesystem and multiple --device flags to install the bootloader to multiple devices, e.g. a /dev/md0 RAID1 device backed by 3 physical disks, each with an ESP partition.

Keeping this as a draft because it will break older bootc versions prior to bootc-dev/bootc#2048.

Leaving the TEMP code in to validate CI passes (previously validated on my fork).

@openshift-ci
Copy link

openshift-ci bot commented Mar 5, 2026

Hi @ckyrouac. Thanks for your PR.

I'm waiting for a coreos member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and well-executed refactoring to support installing bootloaders to multiple devices, such as in a RAID setup. The migration to the bootc-internal-blockdev crate and the Device struct is consistently applied across the codebase. The new CLI options --device and --filesystem are sensible additions. The logic for handling multiple devices, especially for EFI where it filters for ESPs, is robust. I've also noticed some nice correctness improvements, like verifying that a VFAT partition is a true mount point. I have a couple of suggestions to fix a potential panic when dealing with relative paths, and one for code simplification.

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do a deep review, only superficial. There's some nontrivial regression risk here - CI covers some basics, but far from everything.

@ckyrouac ckyrouac force-pushed the multi-device-commit-cleanup branch 3 times, most recently from 0b44eec to 5ff878b Compare March 9, 2026 15:18
ckyrouac added 4 commits March 9, 2026 12:18
Align cap-std-ext with the version used by bootc-internal-blockdev,
eliminating duplicate cap-std/cap-primitives dependency chains.

Assisted-by: Claude Code (Opus 4)
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
Instead of referencing devices as a &str, use Device from the blockdev
crate and its related functions.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
@ckyrouac ckyrouac force-pushed the multi-device-commit-cleanup branch 3 times, most recently from fc93e6b to 5ea4f39 Compare March 9, 2026 16:58
ckyrouac added 3 commits March 9, 2026 15:34
This adds a new --filesystem flag that will use the blockdev crate to
determine the parent devices of the root filesystem and install the
bootloader to each device. The devices can also be explicitly specified
via multiple --device flags.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
When running install-to-filesystem, the host may already have the ESP
mounted (e.g. /dev/sda15 at /boot/efi). Previously mount_esp_device
would unconditionally call mount, which fails with "already mounted".

Check if the mount point already contains a vfat filesystem on a
different device than its parent (i.e. is a real mount point) before
attempting to mount, and reuse the existing mount if so.

Assisted-by: Claude Code (Opus 4)
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
@ckyrouac ckyrouac force-pushed the multi-device-commit-cleanup branch from 5ea4f39 to 52ae943 Compare March 9, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants