status: Add --sysroot flag to query non-booted sysroots#2299
Conversation
Johan-Liebert1
left a comment
There was a problem hiding this comment.
Looks good overall. Just not sure about whether we need the bootloader stuff. We could definitely allow querying even if an ESP isn't mounted at sysroot/boot
| .open_dir_optional("boot/efi")? | ||
| .filter(|d| d.exists(TYPE1_ENT_PATH) || d.exists(EFI_LINUX)) | ||
| { | ||
| (esp_dir, Bootloader::Systemd) |
There was a problem hiding this comment.
This could also be GrubCC but we have no way of knowing I guess
| }; | ||
|
|
||
| let storage = Storage::new_composefs_sysroot(sysroot_path, sysroot_dir, boot_dir)?; | ||
| let bootloader_entries = list_bootloader_entries(&storage, bootloader)?; |
There was a problem hiding this comment.
I'm not sure if we should do this. We shouldn't care about the bootloaders or bootloader entries when querying an arbitrary sysroot. We can definitely base our assumptions by looking at the sysroot/composefs/images or sysroot/state directories. This would cut down a lot of changes in this PR
There was a problem hiding this comment.
The bootloader entries are the source of truth for what gets booted, which is a key concept here in the general case. That said, our current API is much more designed around what a booted system looks like.
That said, there's already e.g. bootctl --list and arguably what we want I think is an extension of that that additionally returns ostree/composefs metadata instead of trying to shim things into our existing status API?
Or perhaps we try to implement that new API as part of #522
Add `bootc status --sysroot <path>` to query the deployment state of an sysroot at an arbitrary path. This is designed for install tooling (Anaconda, osbuild, custom installers) that needs to discover deployment metadata immediately after installation without rebooting. The returned Host uses the same schema as `bootc status --json`. Since the target sysroot is not the running system, `booted` and `staged` are null -- all deployments appear in `otherDeployments`, ordered by priority (first entry is what will boot next). Assisted-by: https://github.com/cgwalters/cgwalters#llms Signed-off-by: Colin Walters <[email protected]>
Add
bootc status --sysroot <path>to query the deployment state of an sysroot at an arbitrary path. This is designed for install tooling (Anaconda, osbuild, custom installers) that needs to discover deployment metadata immediately after installation without rebooting.The returned Host uses the same schema as
bootc status --json. Since the target sysroot is not the running system,bootedandstagedare null -- all deployments appear inotherDeployments, ordered by priority (first entry is what will boot next).Assisted-by: https://github.com/cgwalters/cgwalters#llms
xref #542