Skip to content

Commit 6cfb370

Browse files
authored
Merge pull request #285 from cgwalters/warn-via-loopback-generic
install: Automatically enable --generic-image when --via-loopback
2 parents cbe6062 + 047ce72 commit 6cfb370

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)