From 6e3dd2cf79b6a690f7f8cb9a45a7afe0f4ebd3e1 Mon Sep 17 00:00:00 2001 From: Nikita Dubrovskii Date: Tue, 22 Aug 2023 15:13:13 +0200 Subject: [PATCH] s390x: run chreipl only on zVM --- docs/release-notes.md | 1 + src/s390x/zipl.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index d9d47d4b2..08b6ed97f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -16,6 +16,7 @@ Minor changes: - install: Verify that Ignition config is valid JSON - install: Add long help for several options - download/install: Clarify help text for `--insecure` +- install: Run 'chreipl' only on s390x zVM Internal changes: diff --git a/src/s390x/zipl.rs b/src/s390x/zipl.rs index 4b3d8064e..276fc03c8 100644 --- a/src/s390x/zipl.rs +++ b/src/s390x/zipl.rs @@ -14,9 +14,9 @@ use crate::blockdev::Mount; use crate::io::{visit_bls_entry, visit_bls_entry_options, Initrd, KargsEditor}; -use crate::runcmd; use crate::s390x::ZiplSecexMode; use crate::util::cmd_output; +use crate::{runcmd, runcmd_output}; use anyhow::{anyhow, Context, Result}; use nix::mount::MsFlags; use regex::Regex; @@ -28,8 +28,11 @@ use tempfile::{Builder, NamedTempFile}; /// Sets the boot device to `dev` using `chreipl`. pub fn chreipl>(dev: P) -> Result<()> { - eprintln!("Updating re-IPL device"); - runcmd!("chreipl", dev.as_ref())?; + let vm = runcmd_output!("systemd-detect-virt")?; + if vm == "zvm" { + eprintln!("Updating re-IPL device"); + runcmd!("chreipl", dev.as_ref())?; + } Ok(()) }