3

I need to build some old drivers with specific kernel version.

The Kernel 2.6.31-20-generic is needed. I have tried to built it on Ubuntu 12.04 and the new one, 14.04 with no success. The only one working is 2.6.31-20, such answer I get when I asked how to build it.

How to make chroot with such version of kernel?

1 Answers1

4

chroot just uses your current Kernel. That's just how it works. If you need to change the enveloping kernel, you're going to need to virtualise (through something like kvm or VirtualBox)... Or roll your kernel back to the version your chroot is using (though this sounds painful for the versions we're talking about).

I would personally just look at building for the right script. If you're using DKMS for this, it's fairly simple to just tell it which kernel and arch to build for:

sudo dkms install nvidia-337 -k 2.6.31-20-generic

The dkms {remove,build,install,uninstall,status,...} subcommands all take a -k option for specifying the kernel and arch. See man dkms for a bit more information.

For a list of the installed kernels, ls /lib/modules should get you moving in the right direction though it may feature kernels that are no longer installed. If you want a more packaged list, you can use a previous answer of mine:

dpkg -l | awk '/^.i +linux-(im|he)/ && $2~/[0-9]/ {print $2}'
Oli
  • 293,335