Path to generic x86-64 kernel headers

Hello. I need to build the kernel modules for NVidia GPUs for Generic x86_64 and I need the kernel headers to get started.

I found through this forum that for intel-nuc we can find them at https://files.resin.io/images/intel-nuc/${RESINOS_VERSION}/kernel_modules_headers.tar.gz for example, but I cannot figure out the right path for generic x86_64.

Also, is there a place where one can find the valid paths and how they are encoded to find the right URL in files.resin.io?

Thanks!
Carlos

ok I found it myself in the end. I used balena devices list to find out the exact name for the generic x86-64 device, so here it goes, for example: https://files.balena-cloud.com/images/genericx86-64-ext/2.58.6%2Brev1.prod/kernel_modules_headers.tar.gz

Note that since balenaOS 2.95 there is no difference between a production image and development image (this difference has moved to config.json), so the URL has changed too. It is now:

https://files.balena-cloud.com/images/genericx86-64-ext/2.95.12%2Brev1/kernel_modules_headers.tar.gz

That is correct, thanks for pointing this out!

Having a list of possible versions would still be highly appreciated; this makes it easier to update our Docker build scripts. For example having list access to the following location:

https://files.balena-cloud.com/images/${BALENA_MACHINE_NAME}/${YOCTO_VERSION}

Or maybe a file which lists these paths so you can check it.

hey @nilsdebruin the versions for a device type can be easily obtained using the balenaCLI:

balena os versions generic-amd64

And the device type, the generic-amd64 above, can also be extracted from the balenaCloud slug using the balenaCLI:

balena device-type list | grep "Generic x86_64"

Also, there is an example of how to build external kernel modules in GitHub - balena-os/kernel-module-build: Example project for building an OOT kernel module in balena that shows the path to download the kernel headers:

url="${files_url}/${image_path}/${slug}/${version//+/%2B}/kernel_modules_headers.tar.gz"

Hope that helps.

1 Like

Hi @alexgg, thank you very much, this was exactly what I was looking for! Did I miss something when reading the documentation? I think this is very valuable information!

hey @nilsdebruin it’s probably just that the information is scattered around different places. You could query balenaCloud API directly too, but for simple tasks/automations balenaCLI is usually enough.

@alexgg thanks!