Skip to content

install: Skip mirroring /run/udev when the host has none - #101

Draft
cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-42146356416
Draft

cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-42146356416

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Collaborator

Hosts without udev (e.g. mdev) have no /run/udev, and bootc install to-filesystem fails there because mirroring it from the host is mandatory. Make only that mirror optional: if the host path is missing, log at debug level and return without creating anything locally; if it exists, create the local mount point and compare/bind as before. Other mirrors stay mandatory, and lookup, comparison and mount errors other than not-found still propagate. This ports #97 (examined head 0d94dc9) onto current main, superseding #97 and #72, and adds coverage of the wrapper skipping without creating anything that needs no privileged mounts.

While here, crates/ostree-ext/src/fixture.rs uses as_bytes().len() instead of str::len as clippy.toml requires. This was the known baseline clippy blocker. The task asked for it as a separate commit, but this handback is a single patch, so it is in this commit too. It can be split out on promotion.

Verified in Fedora 44 with install-buildroot prerequisites, ostree 2026.4, Rust/rustfmt/Clippy 1.94.1 (rustup) and tmpfs /tmp, /var/tmp and /run: cargo fmt --check exit 0, cargo test exit 0, cargo clippy --all-targets exit 101. Acceptance is incomplete. With fixture.rs fixed, clippy reaches more baseline str::len (disallowed_methods) errors: crates/ostree-ext/tests/it/main.rs:942, 1551, 1568, 1584, 1585 and crates/lib/src/deploy.rs:1820. Base 0ca885f in the same environment also gives exit codes 0/101/0, but stops earlier at fixture.rs:274. None of these lines are touched here, and no lint configuration or assertion was changed. Fedora's own Rust 1.99.1 gives the same clippy errors, plus more warnings.

Full installation on an mdev host remains untested. Also note that install to-disk still runs udevadm settle unconditionally (crates/lib/src/install/baseline.rs), so this only fixes to-filesystem and to-existing-root.

Review: one pass. Its one blocker asked to collapse the plan/enum into an optional flag on the existing mirror helper. That would be a redesign of #97, which this task said not to do, so it is left as a follow-up. Also open: the plan and wrapper tests overlap, and a tmt test could run in a PID namespace with no /run/udev.

Part of #57
Part of cgwalters-forge/tracker#313; references bootc-dev#2239.

Generated by dispatch · ◷

Hosts without udev (e.g. mdev) have no /run/udev, and `bootc install to-filesystem` fails there because mirroring it from the host is mandatory. Make only that mirror optional: if the host path is missing, log at debug level and return without creating anything locally; if it exists, create the local mount point and compare/bind as before. Other mirrors stay mandatory, and lookup, comparison and mount errors other than not-found still propagate. This ports bootc-dev#97 (examined head 0d94dc9) onto current main, superseding bootc-dev#97 and bootc-dev#72, and adds coverage of the wrapper skipping without creating anything that needs no privileged mounts.

While here, crates/ostree-ext/src/fixture.rs uses `as_bytes().len()` instead of `str::len` as clippy.toml requires. This was the known baseline clippy blocker. The task asked for it as a separate commit, but this handback is a single patch, so it is in this commit too. It can be split out on promotion.

Verified in Fedora 44 with install-buildroot prerequisites, ostree 2026.4, Rust/rustfmt/Clippy 1.94.1 (rustup) and tmpfs /tmp, /var/tmp and /run: `cargo fmt --check` exit 0, `cargo test` exit 0, `cargo clippy --all-targets` exit 101. **Acceptance is incomplete.** With fixture.rs fixed, clippy reaches more baseline `str::len` (disallowed_methods) errors: crates/ostree-ext/tests/it/main.rs:942, 1551, 1568, 1584, 1585 and crates/lib/src/deploy.rs:1820. Base 0ca885f in the same environment also gives exit codes 0/101/0, but stops earlier at fixture.rs:274. None of these lines are touched here, and no lint configuration or assertion was changed. Fedora's own Rust 1.99.1 gives the same clippy errors, plus more warnings.

Full installation on an mdev host remains untested. Also note that `install to-disk` still runs `udevadm settle` unconditionally (crates/lib/src/install/baseline.rs), so this only fixes to-filesystem and to-existing-root.

Review: one pass. Its one blocker asked to collapse the plan/enum into an optional flag on the existing mirror helper. That would be a redesign of bootc-dev#97, which this task said not to do, so it is left as a follow-up. Also open: the plan and wrapper tests overlap, and a tmt test could run in a PID namespace with no /run/udev.

Part of bootc-dev#57
Part of cgwalters-forge/tracker#313; references bootc-dev#2239.

Generated-by: https://github.com/cgwalters/#llms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant