Skip to content

Commit 3e15bcf

Browse files
Johan-Liebert1cgwalters
authored andcommitted
sd-boot: Don't generate random seed for generic images
For installations with `--generic-image` we don't really want a random-seed file to be generated in the ESP as these images would most likely be reused Closes: #2133 Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent bd93a1e commit 3e15bcf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/lib/src/bootloader.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub(crate) fn install_via_bootupd(
227227
pub(crate) fn install_systemd_boot(
228228
device: &bootc_blockdev::Device,
229229
_rootfs: &Utf8Path,
230-
_configopts: &crate::install::InstallConfigOpts,
230+
configopts: &crate::install::InstallConfigOpts,
231231
_deployment_path: Option<&str>,
232232
autoenroll: Option<SecurebootKeys>,
233233
) -> Result<()> {
@@ -246,8 +246,15 @@ pub(crate) fn install_systemd_boot(
246246
.ok_or_else(|| anyhow::anyhow!("Failed to convert ESP mount path to UTF-8"))?;
247247

248248
println!("Installing bootloader via systemd-boot");
249+
250+
let mut bootctl_args = vec!["install", "--esp-path", esp_path.as_str()];
251+
252+
if configopts.generic_image {
253+
bootctl_args.extend(["--random-seed", "no"]);
254+
}
255+
249256
Command::new("bootctl")
250-
.args(["install", "--esp-path", esp_path.as_str()])
257+
.args(bootctl_args)
251258
.log_debug()
252259
.run_inherited_with_cmd_context()?;
253260

0 commit comments

Comments
 (0)