virt-lightning / freebsd-cloud-images

Shell script to build the FreeBSD cloud images
31 stars 12 forks source link

add kernel-source to image #3

Closed safl closed 6 months ago

safl commented 2 years ago

Hi!

Thanks for your work on creating the images at: http://bsd-cloud-image.org/

I just recently started using them to automate the build of the xNVMe project: https://xnvme.io/

However, I caught the snag that the kernel sources aren't available with the images and downloading them inside a qemu-instance takes a very very long time, and we need them to compile a kernel-module and some other system headers as well. So, I took a look at your tool and added that, and dumped the image in a DigitalOcean Space: https://refenv.fra1.digitaloceanspaces.com/freebsd13-ufs-ksrc.qcow2 It grows to about 1.5GB in size

Using it, works as intended, instantiating a qemu-guest with the image takes < 2min, whereas downloading the kernel-source took > 20min. For reference:

Which is great, however, what I am really interested in, is whether you would consider adding kernel sources to the images at http://bsd-cloud-image.org/ ? I just thought providing a PR and showing the growth in image size and intended use-case would be the best way to ask you :) Looking forward to hearing back from you.

Best, Simon

goneri commented 2 years ago

Hi @safl,

I indeed avoid the src directories on purpose to keep the images light. This being said, maybe you can use a persistant volume disk for this?

safl commented 2 years ago

Hi @goneri, Yeah, keeping them light makes does make sense. A persistent volume does sound like a viable approach, however, having the kernel-sources shipped with the images makes it simpler in the CI pipeline as the guest will be provisioned in the same way as the Linux ones, that is, without additional volume mounting. Any chance you you would consider adding an additional download option on http://bsd-cloud-image.org/ containing the kernel source?

goneri commented 2 years ago

Yes, I can totally do that. I will rework a bit the tool.

safl commented 2 years ago

That is awesome @goneri ! Thanks!