Skip to content

Commit

Permalink
model: Add tracking of our own static config versions
Browse files Browse the repository at this point in the history
Currently our static configs don't directly support updates.
(They really should)

We also have a use case around simply introspecting the state
that static configs were enabled (xref ostreedev/ostree#3150)
where we want to have ostree not run grub2-mkconfig in this case.

In preparation for both of these things, add tracking of
our *own* version of the static configs into the metadata.

In theory of course, static configs could include other components
(ignition, greenboot, etc.) and we should track those too.  For
now this at least gets us basic metadata.
  • Loading branch information
cgwalters committed Jan 31, 2024
1 parent d1e8f87 commit fa9924e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ jobs:
-v /var/lib/containers:/var/lib/containers \
localhost/bootupd:latest bootc install to-filesystem --skip-fetch-check \
--disable-selinux --replace=alongside /target
# Verify we injected static configs
jq -re '.["static-configs"].version' /boot/bootupd-state.json
2 changes: 2 additions & 0 deletions src/bootupd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ pub(crate) fn install(

match configs.enabled_with_uuid() {
Some(uuid) => {
let self_meta = crate::packagesystem::query_files("/", ["/usr/bin/bootupctl"])?;
state.static_configs = Some(self_meta);
#[cfg(any(
target_arch = "x86_64",
target_arch = "aarch64",
Expand Down
2 changes: 2 additions & 0 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub(crate) struct SavedState {
pub(crate) installed: BTreeMap<String, InstalledContent>,
/// Maps a component name to an in progress update
pub(crate) pending: Option<BTreeMap<String, ContentMetadata>>,
/// If static bootloader configs are enabled, this contains the version
pub(crate) static_configs: Option<ContentMetadata>,
}

/// The status of an individual component.
Expand Down

0 comments on commit fa9924e

Please sign in to comment.