Skip to content
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

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

cgwalters
Copy link
Collaborator

@cgwalters cgwalters commented Jan 26, 2024

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.

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Jan 26, 2024
@cgwalters cgwalters force-pushed the warn-via-loopback-generic branch from 00b8506 to 9ed2245 Compare January 26, 2024 19:13
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]>
@cgwalters cgwalters force-pushed the warn-via-loopback-generic branch from 9ed2245 to 047ce72 Compare January 26, 2024 19:13
Copy link
Contributor

@mvo5 mvo5 left a 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));
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@cgwalters cgwalters merged commit 6cfb370 into containers:main Jan 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to `bootc install`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants