Page 1 of 1

Cross compile Guest Addons for different amd64 distribution

Posted: 18. Jan 2018, 17:56
by Menion
Hi all
I am planning to deploy some routers image that run on a JEOS Linux distribution in a VirtualBox container
This is a kind of normal, Linux system, based on kernel 4.9.x. The target is shrink so it is not possible to compile kernel modules on target
That is why I am trying to compile on another host machine the guest addons.
Of course I have available the toolchains, headers file with autoconf.h and auto.conf that produced the kernel that is running in the final image that I will run in virtualbox as guest
I have extracted the vbox additions and tried to compile them. CROSS_COMPILE and ARCH is managed as expected, the problem is with the KERNEL directory
Normally the out of tree modules, rely on the KDIR environment variable to point the kernel against the compilation shall occur, while the vbox Makefiles, in Makefile.include.header, apparently use the KERN_DIR and KERN_VER variables.
Unfortunately I have not been able to make everything pointing to the correct kernel headers directory, without manually adjusting the KERN_DIR in the Makefile, since it seems that specifying the KERN_DIR you are forced to stick the headers unders the "build" directory, while KERN_VER pretend to find the headers under /lib/modules/%KERN_VER
Maybe I am just following the wrong path and there is something easier to accomplish the task
Can you help on this?
Bye

Re: Cross compile Guest Addons for different amd64 distribution

Posted: 18. Jan 2018, 19:15
by socratis
I can't help you with your question, but I will move it from the "Linux Guests" to the "OSE" section.