Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: s390x: run chreipl only on zVM #1274

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 6 additions & 3 deletions 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,8 +28,11 @@ use tempfile::{Builder, NamedTempFile};

/// Sets the boot device to `dev` using `chreipl`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a comment here to explain why we only want to do this on zvm? As someone who doesn't know anything about s390x it would probably help me understand. What are the other platfomrs and what will systemd-detect-virt return on s390x that isn't zVM?

pub fn chreipl<P: AsRef<Path>>(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(())
}

Expand Down