-
Notifications
You must be signed in to change notification settings - Fork 12
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
run kernel in chroot #34
Conversation
a5eb528
to
205d78e
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.
small nits, lgtm otherwise
205d78e
to
11233bc
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.
yeah, this reads a bit more clear. thanks for that.
test can go in followup PR
Insteads of mounting the local FS'root, we can do the same but in a chroot. The main benefit would be to be able to run a kernel/artifacts in a guest FS which may be different then the host FS. For instance when collecting CI artifacts and trying to reproduce locally. CI may run in say Ubuntu 22.04 , while my host may be Fedora 38. This also opens up for a next diff where we can run againdt a foreign architecture provided that the chrrot is for that arch. ``` $ cat /etc/debian_version && RUST_LOG=debug cargo run -- -k $KERNEL_REPO/arch/x86_64/boot/bzImage -r debian 'cat /etc/debian_version' trixie/sid Compiling vmtest v0.8.3 (/home/chantra/devel/danobi-vmtest) Finished dev [unoptimized + debuginfo] target(s) in 8.11s Running `target/debug/vmtest -k /home/chantra/devel/bpf-next//arch/x86_64/boot/bzImage -r debian 'cat /etc/debian_version'` => bzImage ===> Booting ===> Setting up VM ===> Running command 11.5 bash: line 1: cd: /home/chantra/devel/danobi-vmtest: No such file or directory ``` Also tested that it would work when configured in `vmtest.toml` ``` $ RUST_LOG=debug cargo run -- Compiling vmtest v0.8.3 (/home/chantra/devel/danobi-vmtest) Finished dev [unoptimized + debuginfo] target(s) in 2.50s Running `target/debug/vmtest` => Alt RootFS ===> Booting ===> Setting up VM ===> Running command 11.5 bash: line 1: cd: /home/chantra: No such file or directory => Standard RootFS ===> Booting ===> Setting up VM ===> Running command trixie/sid $ cat vmtest.toml [[target]] name = "Alt RootFS" kernel = "/home/chantra/devel/bpf-next//arch/x86_64/boot/bzImage" command = "cat /etc/debian_version" rootfs = "debian" [[target]] name = "Standard RootFS" kernel = "/home/chantra/devel/bpf-next//arch/x86_64/boot/bzImage" command = "cat /etc/debian_version" ``` Signed-off-by: Manu Bretelle <[email protected]>
Signed-off-by: Manu Bretelle <[email protected]>
…path) If this is not the case, the guest is not going to be able to find the init file we pass as a parameter of `init=`. We better error out than having a VM that fails to boot properly. Signed-off-by: Manu Bretelle <[email protected]>
11233bc
to
472cce8
Compare
I added them as separate commits. |
the failed test seems to be environmental more than anything. |
I wonder if GH changed something today. The EPERM error looks kinda similar to the large runner thing you have to do: https://github.com/danobi/vmtest-action/blob/fed44e099e1e7b79251780393453929ab20d107e/vmtest.js#L48-L62 |
yeah, they may start presenting /dev/kvm and because no permission is checked it tries to enable kvm while it does not have access. |
Insteads of mounting the local FS'root, we can do the same but in a chroot. The main benefit would be to be able to run a kernel/artifacts in a guest FS which may be different then the host FS. For instance when collecting CI artifacts and trying to reproduce locally.
CI may run in say Ubuntu 22.04 , while my host may be Fedora 38. This also opens up for a next diff where we can run againdt a foreign architecture provided that the chrrot is for that arch.
Also tested that it would work when configured in
vmtest.toml