Under a chroot environment, is it possible to build a kernel module without having the kernel installed, just the headers?
It sounds like something you wouldn't want to do, but in my case I do. I've got a script that automates creating an environment for netbooting which also includes the initrd.img created by mkinitramfs and copied to the tftp server afterward.
For example, if the target PC also includes a radeon card I want fglrx. If it's nvidia I want the nvidia package. Those who run/customise the build script may not have those cards installed physically into my PC.
Yes.
For Ubuntu you really just need the
linux-headers-*
packaged installed for the desired target. Here is an example Makefile that sets KDIR to a custom header location:This should work just the same inside a chroot.