Skip to content

Commit fa9924e

Browse files
committed
model: Add tracking of our own static config versions
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.
1 parent d1e8f87 commit fa9924e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ jobs:
4646
-v /var/lib/containers:/var/lib/containers \
4747
localhost/bootupd:latest bootc install to-filesystem --skip-fetch-check \
4848
--disable-selinux --replace=alongside /target
49+
# Verify we injected static configs
50+
jq -re '.["static-configs"].version' /boot/bootupd-state.json

src/bootupd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ pub(crate) fn install(
108108

109109
match configs.enabled_with_uuid() {
110110
Some(uuid) => {
111+
let self_meta = crate::packagesystem::query_files("/", ["/usr/bin/bootupctl"])?;
112+
state.static_configs = Some(self_meta);
111113
#[cfg(any(
112114
target_arch = "x86_64",
113115
target_arch = "aarch64",

src/model.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub(crate) struct SavedState {
5050
pub(crate) installed: BTreeMap<String, InstalledContent>,
5151
/// Maps a component name to an in progress update
5252
pub(crate) pending: Option<BTreeMap<String, ContentMetadata>>,
53+
/// If static bootloader configs are enabled, this contains the version
54+
pub(crate) static_configs: Option<ContentMetadata>,
5355
}
5456

5557
/// The status of an individual component.

0 commit comments

Comments
 (0)