Skip to content

Commit 047ce72

Browse files
committed
install: Automatically enable --generic-image when --via-loopback
It's a bit confusing because `to-disk` is intended primarily for *per machine* installs. However, when used with `--via-loopback` it can be used to make disk images which are probably intended to be generic. For now, let's just automatically flip that on. Signed-off-by: Colin Walters <[email protected]>
1 parent cbe6062 commit 047ce72

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/install.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,13 +1093,18 @@ fn installation_complete() {
10931093

10941094
/// Implementation of the `bootc install to-disk` CLI command.
10951095
#[context("Installing to disk")]
1096-
pub(crate) async fn install_to_disk(opts: InstallToDiskOpts) -> Result<()> {
1096+
pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
10971097
let mut block_opts = opts.block_opts;
10981098
let target_blockdev_meta = block_opts
10991099
.device
11001100
.metadata()
11011101
.with_context(|| format!("Querying {}", &block_opts.device))?;
11021102
if opts.via_loopback {
1103+
if !opts.config_opts.generic_image {
1104+
eprintln!("Automatically enabling --generic-image when installing via loopback");
1105+
std::thread::sleep(std::time::Duration::from_secs(2));
1106+
opts.config_opts.generic_image = true;
1107+
}
11031108
if !target_blockdev_meta.file_type().is_file() {
11041109
anyhow::bail!(
11051110
"Not a regular file (to be used via loopback): {}",

0 commit comments

Comments
 (0)