Skip to content

Commit 15b5f4d

Browse files
jbtrystramcgwalters
authored andcommitted
install/bootloader: make --write-uuid optional
Allow skiping the boot uuid stamp file writing in bootupd. When creating a golden image, we expect the UUIDS to be randomized at first boot, so always writing the stamp is odd. At least for Fedora CoreOS the stamp being already there at first boot short-circuit the partitions uuid randomization process. So let's make it optionnal. It will default to `false`, preserving existing behaviour when not specified. ref coreos/fedora-coreos-config#3898 Assisted-by: OpenCode (Opus 4.5) Signed-off-by: jbtrystram <[email protected]>
1 parent 45fcce3 commit 15b5f4d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

crates/lib/src/bootloader.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ pub(crate) fn install_via_bootupd(
105105
println!("Installing bootloader via bootupd");
106106

107107
// Build the bootupctl arguments
108-
let mut bootupd_args: Vec<&str> = vec!["backend", "install", "--write-uuid"];
108+
let mut bootupd_args: Vec<&str> = vec!["backend", "install"];
109+
if configopts.bootupd_skip_boot_uuid {
110+
bootupd_args.push("--with-static-configs")
111+
} else {
112+
bootupd_args.push("--write-uuid");
113+
}
109114
if let Some(v) = verbose {
110115
bootupd_args.push(v);
111116
}

crates/lib/src/install.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ pub(crate) struct InstallConfigOpts {
368368
/// The stateroot name to use. Defaults to `default`.
369369
#[clap(long)]
370370
pub(crate) stateroot: Option<String>,
371+
372+
/// Don't pass --write-uuid to bootupd during bootloader installation.
373+
#[clap(long)]
374+
#[serde(default)]
375+
pub(crate) bootupd_skip_boot_uuid: bool,
371376
}
372377

373378
#[derive(Debug, Default, Clone, clap::Parser, Serialize, Deserialize, PartialEq, Eq)]

0 commit comments

Comments
 (0)