-
Notifications
You must be signed in to change notification settings - Fork 86
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
install: Automatically enable --generic-image when --via-loopback #285
install: Automatically enable --generic-image when --via-loopback #285
Conversation
00b8506
to
9ed2245
Compare
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]>
9ed2245
to
047ce72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I like tihs!
let mut block_opts = opts.block_opts; | ||
let target_blockdev_meta = block_opts | ||
.device | ||
.metadata() | ||
.with_context(|| format!("Querying {}", &block_opts.device))?; | ||
if opts.via_loopback { | ||
if !opts.config_opts.generic_image { | ||
eprintln!("Automatically enabling --generic-image when installing via loopback"); | ||
std::thread::sleep(std::time::Duration::from_secs(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check, this sleep is here so that a user can quickly ctrl-c
in case that is not what they want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More to annoy them into specifying it, while not entirely locking out the use case of writing to a loopback device in this mode - I can't think of a real use case, but maybe there is one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm nevermind, I guess it is locked out because we hardcode it for now, but the goal is to make people specify it explicitly.
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.