-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add native arm64 support and cross-compilation for kernels #170
Conversation
df82d20
to
b7c852d
Compare
I added some PRs in cilium/little-vm-helper-images:
I just need a last PR for the copy of the kernel modules in the image and then we should be able to run some tests on arm64 using the kind image. |
b7c852d
to
9703c0a
Compare
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
To make kvm work on arm64, the default x86_64 kvm64 cpu type needed to be changed. Signed-off-by: Mahe Tardy <[email protected]>
Previously, all images were by default bootable. This adds an option in the image conf to specify if the output image should be bootable or not. It keeps retro-compatibility with previous configurations by treating omited option as true using a boolean pointer. Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
3f80da9
to
9590475
Compare
9590475
to
a564dda
Compare
For example, on amd64, if the 'gcc-aarch64-linux-gnu' package is installed, LVH can cross compile an arm64 kernel on amd64. On arm64, if the 'gcc-x86-64-linux-gnu' package is install, LVH can cross compile an amd64 kernel on arm64. Signed-off-by: Mahe Tardy <[email protected]>
a564dda
to
7e43e94
Compare
Signed-off-by: Mahe Tardy <[email protected]>
Commit 9e7539f modified our use of the dir-pkg target because it wasn't supported in 4.19. This updates the README along the arch specific target changes. Signed-off-by: Mahe Tardy <[email protected]>
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.
LGTM, thanks.
minor nit: I would prefered to have the an arch
variable (initialized to runtime.GOARCH
) passed to the various helper functions rather than using GOARCH
everywhere. I think this would made it easier to run an ARM vm in an x86 machine or vice-versa. We can do it in a later PR if needed.
Fixes #56.
With this update, you can:
You cannot build an arm64 image on amd64 because of libguestfs tools limitations, unfortunately,
mmdebstrap
works perfectly fine with emulation but libguestfs tools rely on Qemu to start the VMs to modify the images and it's not set up for emulation.Also, this introduces a new
bootable
field in the image conf since with this patch. For now, we can only build non-bootable images for arm64 as I haven't taken the time to investigate the bootloader part that we could use (since extlinux used here is x86_64 only). So the default is that images are bootable by default on x86_64 and non-bootable by default on arm64. You can use the new field to be precise.This might not be the ideal setup as I haven't taken the time to look into the kernel config specific for arm64 to we should change. It seems to work ok at least, maybe we are not very optimized but...