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

rockchip64: make rockchip64 bootable in VM #7392

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

alex3d
Copy link
Contributor

@alex3d alex3d commented Oct 19, 2024

Description

Most of stuff needed to boot inside VM was already in place, the one remaining (new?) thing is CONFIG_PCI_HOST_GENERIC. Enable it to allow quick check of new images in QEMU or Apple Virtualization framework.

The kernel size difference is negligible (actually I see no kernel size change at all, apparently growth is fully covered by some kernel image alignment)

How Has This Been Tested?

  • Make rk3318-box image and boot it inside UTM in "boot from kernel image" mode (both QEMU and Apple engines)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

@lanefu
Copy link
Member

lanefu commented Oct 19, 2024

I guess it wouldn't hurt anything, although IMHO would be more ideal to have a specific lean kernel for virtualization builds. Amusingly I'm guessing the rockchip64 kernel is probably a fair bit leaner than the uefi ARM64 kernel

@alex3d
Copy link
Contributor Author

alex3d commented Oct 19, 2024

Virtio drivers was already enabled in rockchip64 kernel config, this PR only adds ~512 bytes of code to make them usable.
If kernel size is a concern then probably virtio drivers should be disabled (not sure there will be big size improvement).

BTW if you are concerned with disk size of the kernel (not RAM size), then probably you can compress it and let uboot uncompress it. I use something like this in my build config/extension:

function pre_package_kernel_image__compress_kernel() {
    lzop --best "${kernel_image_pre_package_path}"
    mv "${kernel_image_pre_package_path}"{.lzo,}
    return 0;
}

@lanefu
Copy link
Member

lanefu commented Oct 19, 2024

@alex3d btw how you booting the image with Apple Virtualization Framework?

In the past I've used UTM a few different ways

@alex3d
Copy link
Contributor Author

alex3d commented Oct 19, 2024

UTM currently has builtin Apple Virtualization support.
You need to specify drive image + unpacked kernel + initramfs in the VM wizard:
image
VM config:
image

@paolosabatino
Copy link
Contributor

Mmmh, I see no harm in enablng the generic PCI Host driver. Perhaps having the chance to boot the kernel via VM can be useful for some automated image testing later @igorpecovnik

About concerns on size of the kernel and modules, currently rockchip64 carries a lot of useless drivers and features that can be slimmed down by several megabytes any time.

I will just make a quick check on a live system then, if it works as I suppose it will, approve

Copy link
Contributor

@paolosabatino paolosabatino left a comment

Choose a reason for hiding this comment

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

Checked, the board booted fine with current kernel and PCI_HOST on. I approve

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 11 Milestone: Fourth quarter release labels Oct 20, 2024
@igorpecovnik igorpecovnik merged commit 922f656 into armbian:main Oct 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth quarter release Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

4 participants