diff --git a/src/cmdline/install.rs b/src/cmdline/install.rs index e191d4756..ab1729ff0 100644 --- a/src/cmdline/install.rs +++ b/src/cmdline/install.rs @@ -111,6 +111,11 @@ pub struct InstallConfig { /// formatted as -. can be sha256 or sha512. #[clap(long, value_name = "digest")] pub ignition_hash: Option, + /// 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 diff --git a/src/install.rs b/src/install.rs index 591e4b952..fce37cf2b 100644 --- a/src/install.rs +++ b/src/install.rs @@ -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()