So I wanted to try to build 2.6.39-4. I followed the procedure at ubuntu wiki "GitKernelBuild" page.
In short, download the tar.bz2, extract, copy my old config, make oldconfig, and then
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
All went fine, I am using this kernel right now, except one little thing: I cannot build other modules, build dkms etc. Further info follows:
The produced deb files are two:
linux-image-2.6.39.4-custom_2.6.39.4-custom-10.00.Custom_amd64.deb
linux-headers-2.6.39.4-custom_2.6.39.4-custom-10.00.Custom_amd64.deb
I am a bit confused by this.
In normal ubuntu kernels, even those in mainline-ppa, there are three deb files that are installed. For example, for the same kernel from the mainline ppa there exist these packages:
linux-image-2.6.39-02063904-generic_2.6.39-02063904.201108040905_amd64.deb
linux-headers-2.6.39-02063904-generic_2.6.39-02063904.201108040905_amd64.deb
linux-headers-2.6.39-02063904_2.6.39-02063904.201108040905_all.deb
As you can see, there are two different header packages. Indeed, after installing them, the mainline ppa packages create a directory under /lib/modules:
/lib/modules/2.6.39-02063904-generic
In that directory, a symlink exists which points to the -generic headers under /usr/src
/lib/modules/2.6.39-02063904-generic/build -> /usr/src/linux-headers-2.6.39-02063904-generic
Under /usr/src, two different directories exist for this kernel
/usr/src/linux-headers-2.6.39-02063904-generic
/usr/src/linux-headers-2.6.39-02063904
Now, here is the problem with my own two packages:
In /usr/src there is just one folder,
/usr/src/linux-headers-2.6.39.4-custom
And under /lib/modules, there is a folder
/lib/modules/linux-headers-2.6.39.4-custom
The real issue, and the reason I am writing this post is this symlink that gets created in the above directory:
/lib/modules/linux-headers-2.6.39.4-custom/build -> /home/nickped/projects/kernel/linux-2.6.39.4
As you can see, it links back to the directory where I built the kernel - which of course might not exist afterwards. This causes other modules (for example vmware, virtualbox etc) to fail to built, as it can't find important things.
Why does this happen? How can it be fixed? Why there are two and not three deb files produced? What is the purpose of those 3 different deb files that official releases have, and how can they be created by others?