Skip to content
Open
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
5 changes: 5 additions & 0 deletions src/cmdline/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ pub struct InstallConfig {
/// formatted as <type>-<hexvalue>. <type> can be sha256 or sha512.
#[clap(long, value_name = "digest")]
pub ignition_hash: Option<IgnitionHash>,
/// Only perform post-processing (ignition, network copy, kernel args, etc.) without writing
/// the image to disk
#[clap(long)]
#[clap(conflicts_with_all = &["image-file", "image-url"])]
pub postprocess_only: bool,
/// Target CPU architecture
///
/// Create an install disk for a different CPU architecture than the
Expand Down
44 changes: 23 additions & 21 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,27 +366,29 @@ fn write_disk(
) -> Result<()> {
let device = config.dest_device.as_deref().expect("device missing");

// Get sector size of destination, for comparing with image
let sector_size = get_sector_size(dest)?;

// copy the image
#[allow(clippy::match_bool, clippy::match_single_binding)]
let image_copy = match is_dasd(device, Some(dest))? {
#[cfg(target_arch = "s390x")]
true => s390x::image_copy_s390x,
_ => image_copy_default,
};
write_image(
source,
dest,
Path::new(device),
image_copy,
true,
Some(saved),
Some(sector_size),
VerifyKeys::Production,
)?;
table.reread()?;
if !config.postprocess_only {
// Get sector size of destination, for comparing with image
let sector_size = get_sector_size(dest)?;

// copy the image
#[allow(clippy::match_bool, clippy::match_single_binding)]
let image_copy = match is_dasd(device, Some(dest))? {
#[cfg(target_arch = "s390x")]
true => s390x::image_copy_s390x,
_ => image_copy_default,
};
write_image(
source,
dest,
Path::new(device),
image_copy,
true,
Some(saved),
Some(sector_size),
VerifyKeys::Production,
)?;
table.reread()?;
}

// postprocess
if ignition.is_some()
Expand Down