Skip to content

Conversation

@ckyrouac
Copy link
Collaborator

A couple small fixes that are prep for multi device support. Related to #1911 and #2000.

@ckyrouac ckyrouac requested a review from cgwalters February 12, 2026 15:21
@ckyrouac ckyrouac marked this pull request as ready for review February 12, 2026 15:22
@github-actions github-actions bot added the area/install Issues related to `bootc install` label Feb 12, 2026
@bootc-bot bootc-bot bot requested a review from henrywang February 12, 2026 15:22
Comment on lines 93 to 96
let sysfs_partn_path = format!("/sys/dev/block/{majmin}/partition");
if Utf8Path::new(&sysfs_partn_path).try_exists()? {
let partn = std::fs::read_to_string(&sysfs_partn_path)
.with_context(|| format!("Reading {sysfs_partn_path}"))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor but I like using https://docs.rs/cap-std-ext/latest/cap_std_ext/dirext/trait.CapStdExtDirExt.html#tymethod.open_optional for things like this.

Though I guess what we should also do (for the many cases that operate on an ambient /) is have an extension trait wrapper somewhere like exists in composefs-rs https://github.com/containers/composefs-rs/blob/fc1d4e27ef054b9ececeeb58c985c77727ceaff4/crates/composefs/src/util.rs#L119

Copy link
Contributor

@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 introduces a couple of bugfixes for block device handling. A new field partn is added to the Device struct to store the partition number, with a backfill mechanism from sysfs for older systems. Additionally, /run/udev is now mounted from the host to ensure lsblk functions correctly within the container.

My review found a potential issue in the backfill logic. The backfill_partn function should only execute if the partition number is actually missing, to avoid overwriting valid data from newer lsblk versions. A code suggestion is provided to address this.

Without access to udev state, lsblk may fail during install-to-disk
operations.

See bootc-dev#688

Assisted-by: Claude Code (claude-opus-4-5-20251101)
Signed-off-by: ckyrouac <[email protected]>
The "partn" column was added in util-linux 2.39, which is newer than
what CentOS 9 / RHEL 9 ship (2.37). Read the partition number from
sysfs when lsblk doesn't provide it.

This is done by refactoring the existing backfill function into a more
generic one used to backfill both start and partn.

Assisted-by: Claude Code (claude-opus-4-5-20251101)
Signed-off-by: ckyrouac <[email protected]>
@ckyrouac
Copy link
Collaborator Author

refactored this to use a shared function to backfill both start and partn which should make the code's intentions more obvious.

@ckyrouac ckyrouac requested a review from cgwalters February 12, 2026 17:34
@cgwalters cgwalters enabled auto-merge (rebase) February 12, 2026 18:44
@cgwalters cgwalters merged commit 47e2bcc into bootc-dev:main Feb 12, 2026
31 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants