Skip to content

update: Skip bootloader update when no block devices back the root#1072

Open
cgwalters wants to merge 2 commits into
coreos:mainfrom
cgwalters:ephemeral-noupdate
Open

update: Skip bootloader update when no block devices back the root#1072
cgwalters wants to merge 2 commits into
coreos:mainfrom
cgwalters:ephemeral-noupdate

Conversation

@cgwalters
Copy link
Copy Markdown
Member

Fix the problem that bcvk ephemeral run quay.io/fedora/fedora-bootc:43 shows a systemd error by default.

Copy link
Copy Markdown

@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 effectively addresses the issue of bootupctl update failing in environments without block-backed root filesystems, such as ephemeral VMs using virtiofs. The core change to make get_devices() return an Option is well-implemented and propagated correctly to the callers, allowing them to gracefully skip the update. The addition of ci/ephemeral-test.sh is a great way to ensure this new behavior is tested. I have one main concern about the completeness of the fix regarding other components, which I've detailed in a specific comment.

Comment thread src/efi.rs Outdated
Comment on lines +563 to +565
let Some(devices) = crate::blockdev::get_devices("/")? else {
return Ok(ValidationResult::Skip);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This change correctly handles the case where no block devices are found for the EFI component's validation. It's highly likely that a similar change is needed for the validate implementation in bios.rs and any other Component implementations that call get_devices(). Without updating all call sites, bootupctl validate could still fail for other components (like BIOS) in the exact ephemeral environments this PR aims to support.

Comment thread .github/workflows/ci.yml Outdated
run: sudo podman build --build-arg=base=quay.io/fedora/fedora-bootc:43 -t localhost/bootupd:latest -f Dockerfile .
- name: Smoke test (bcvk ephemeral)
timeout-minutes: 10
run: bcvk ephemeral run-ssh localhost/bootupd:latest -- /usr/libexec/bootupd-tests/ephemeral-test.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall LGTM, maybe you should add sudo to run bcvk, as image localhost/bootupd:latest is built with sudo

@nikita-dubrovskii
Copy link
Copy Markdown
Contributor

@nikita-dubrovskii
Copy link
Copy Markdown
Contributor

nikita-dubrovskii commented Apr 24, 2026

This won't work on Live systems. Here is my branch with fix, mind checking it?

Logs from live-iso:

$ cosa kola qemuexec --workdir none --qemu-iso builds/latest/x86_64/*.iso

core@localhost:~$ journalctl -u bootloader-update.service 
Apr 24 08:44:56 localhost systemd[1]: Starting bootloader-update.service - Update bootloader on boot...
Apr 24 08:44:57 localhost bootupctl[1090]: Detected live filesystem: erofs, skipping bootloader update.
Apr 24 08:44:57 localhost systemd[1]: Finished bootloader-update.service - Update bootloader on boot.

Logs from qemu:

$  cosa kola qemuexec --devshell-console

core@cosa-devsh:~$ journalctl -u bootloader-update.service 
Apr 24 08:46:34 localhost systemd[1]: Starting bootloader-update.service - Update bootloader on boot...
Apr 24 08:46:34 localhost bootupctl[1456]: No update available for any component.
Apr 24 08:46:34 localhost systemd[1]: Finished bootloader-update.service - Update bootloader on boot.

@cgwalters cgwalters force-pushed the ephemeral-noupdate branch from 218236d to 3df3e2a Compare May 21, 2026 18:32
cgwalters added 2 commits May 21, 2026 14:52
In environments without block-backed boot filesystems (virtiofs in bcvk
ephemeral, NFS root, ISO boot, etc.) there is no on-disk bootloader to
manage. Previously the update path would fail because
list_dev_current_root() bailed when it could not find a block device
from /boot or /sysroot.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
On Fedora 43 dnf is dnf5, and the copr subcommand is provided by the
dnf5-plugins package rather than dnf-plugins-core. Without it the
ephemeral CI job fails with:

  Unknown argument "copr" for command "dnf5".

Install dnf5-plugins with a fallback (|| true) so it's a no-op on
CentOS Stream 9 where that package doesn't exist.

Assisted-by: OpenCode (Claude Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the ephemeral-noupdate branch from 3df3e2a to cdc2944 Compare May 21, 2026 18:52
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.

3 participants