Skip to content

Commit

Permalink
s390x: run chreipl only on zVM
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-dubrovskii committed Aug 22, 2023
1 parent 8f1f950 commit 7f5a470
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
7 changes: 6 additions & 1 deletion src/s390x/zipl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +28,11 @@ use tempfile::{Builder, NamedTempFile};

/// Sets the boot device to `dev` using `chreipl`.
pub fn chreipl<P: AsRef<Path>>(dev: P) -> Result<()> {
if let Ok(vm) = runcmd_output!("systemd-detect-virt") {
if vm != "zvm" {
return Ok(());
}
}
eprintln!("Updating re-IPL device");
runcmd!("chreipl", dev.as_ref())?;
Ok(())
Expand Down

0 comments on commit 7f5a470

Please sign in to comment.