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

Support vng O= in interactive mode #229

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Conversation

matttbe
Copy link
Collaborator

@matttbe matttbe commented Feb 6, 2025

When looking at the discussion #228, I noticed vng O=my_dir/ was not working as expected: with -v, I could see the VM booting, then stopping right after.

That's because virtme-run was called with --script-sh "O=my_dir/" --kdir=./my_dir/, so simply setting an env var and exiting.

Now virtme-run will be called with --kdir=my_dir/, so without --script-sh and without the ./ prefix to allow full paths.

When vng was used with O=my_dir/ to launch a VM, the VM stopped as soon
as the boot was done without any message, e.g.

  host: $ vng O=.virtme/build
  host: $

That's because O=my_dir/ was used as a command to execute in a
non-interactive mode: so simply setting an env var, and exiting.

Now, when O=... is passed, it is used to set the build dir where the
kernel image is, and this command is removed from the exec list. In
other words, this command will start a VM and start a prompt:

  host: $ vng O=.virtme/build
    vm: $

Fixes: afbec37 ("vng-run: get kdir from O=outdir")
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Before, only relative paths were allowed, I'm not sure why.

Let's remove this restriction, simply by removing the './' prefix.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
@matttbe matttbe requested a review from arighi February 6, 2025 12:13
If this env var is set, and O= is not set, use this as the kernel build
dir.

Follow the same logic as in configkernel: only use it if set and
pointing to a valid directory.

While at it, also harmonise the code in configkernel around this env
var.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Copy link
Owner

@arighi arighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@matttbe matttbe merged commit 8cb14a8 into arighi:main Feb 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants