So, I decided to switch over to 2.6.24 using a modified version of zen-sources. That was pretty easy. I also installed uvesafb, the new framebuffer for handling splash screens and stuff. That was pretty easy, too. Because I was working off of a new tree, I needed to recompile the only two modules used in my system: nvidia and vboxdrv. So, I redownloaded the latest nVidia driver and installed it. Again, pretty easy. Recompiling vboxdrv, however, wasn’t.
Apparently, there are a few lines of code in the VirtualBox kernel module that conflict with 2.6.24 series kernels (they try redefine a few things that have already been defined in this series of kernels; the 2.6.23 series does not have this problem). To fix this problem, Gentoo developers created a simple patch to stop the kernel module from doing this.
One problem, though: the patch is broken. It tries to patch 2 files: include/iprt/types.h and Config.kmk. When I first tried to reinstall vboxdrv (app-emulation/virtualbox-modules), this problem came up and I dug through some log files to find out what was going on. Apparently, the patch couldn’t find Config.kmk. Neither could I.
So, I decided to try a manual build. I did the following:
ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild fetch
ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild unpack
I then grabbed a copy of Config.kmk and slipstreamed it in. Then, I tried:
ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild compile
But, once again, it failed. This time, the patch against Config.kmk failed. I suppose Innotek drastically changed the document after this patch was written.
So, somewhat fed up, I decided to do the following.
- I modified the ebuild, commenting out the code pertaining to the patching.
- I ran:
ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild digest
This regenerated a digest for the ebuild so that it wouldn’t fail.
- I ran the ebuild commands to fetch and unpack the data.
- I slipstreamed Config.kmk in (just in case it was still needed).
- I patched types.h myself with:
patch -p0 -g0 -E –no-backup-if-mismatch < /usr/portage/app-emulation/virtualbox-modules/files/virtualbox-modules_2.6.24.patch
- I ran:
ebuild virtualbox-modules-1.5.2-r1.ebuild compile
ebuild virtualbox-modules-1.5.2-r1.ebuild install
ebuild virtualbox-modules-1.5.2-r1.ebuild qmerge
- Finally, I invoked:
modprobe vboxdrv
- I profited.
Moral of the story: if you are going to use Gentoo, figure out how to use Portage. If I did, I probably wouldn’t have spent hours being frustrated.