I decided to go a bit further than usual, and push the limits of the unknown.

I decided to install Funtoo, a Gentoo based distro or rather fork, by the Gentoo fouder Daniel Robbins. Daniel is no longer active in Gentoo, and Funtoo is his new pet project, introducing some radical new ideas into the Gentoo landscape. Not to stop there, I went for 64bit, core2 optimized compiler flags, Ext4, latest kernel (2.6.30-gentoo-r5), grub2 and git based portage. Oh boy, am I asking for trouble or what!?!

To start off, I needed a 64bit boot cd, just any Linux distro would do, but it must be 64 bit – the bootstrap enviroment must be compatible with the installed enviroment, otherwise the chroot from one to the other won’t work. The choice fell to a Gentoo-MinimalInstallCD-64bit, fresh weekly build, cca 120MB in size.

The install follows mostly the usual Gentoo install routine – fdisk, mkfs, mount, mount proc, mount dev, chroot, env-update, source profile. To jumpstart the network a ‘dhcpcd eth0‘ will do – for now.

The MinimalInstallCD supports ext4 out of the box, so formatting was a non-issue. I downloaded the latest preconfigured and optimized stage3 & portage tarballs for core2 architecture from funtoo.org and extracted them into the new ext4 partition. Some customization is needed to fstab to match the partition layout, and make.conf to make use of more compilation threads on my multicore CPU. The compiler flags and make.profile were already preset by my choice of the coresponding stage3.

Here comes the tricky part, grub2 & kernel. I won’t drag you through the whole kernel building, just make sure you switch on ext4 support in the new kernel. My wrong was the assumption that ext4 was enabled by default; well, we all learn from mistakes… Btw, I used genkernel to build the kernel.

Grub2 is a different cup of coffee.

Grub2 is unstable, and won’t be stable any time soon. To further complicate things, the only usable version (ext4) is from SVN, and my firewall does not allow svn: connections. I tested the 1.96 ebuild, it failed miserably, time for hacking the 9999 aka SVN ebuild.

Grub2, needs a patch to recognize gentoo style kernels, which is included with the 9999 ebuild unlike 1.96, but the path to access SVN via http: is different then via native svn: protocol. A bit of searching, a quick fix and rebuilding the digest, and the SVN ebuild was working now via http. There is also a weird dependency on ruby, which I find to be somewhat overkill.

Now the ebuild worked, grub2-install worked, but still no luck booting. A few sources recommend to be extremely conservative with the build flags, so I chose to set ‘sys-boot/grub static custom-cflags multislot‘ in packge.use.

No harm done, but still no boot. Finally I figured out that grub-mkconfig assumed I used a /boot partition (I didn’t), and generated a wrong path to the kernel in grub.conf. Once fixed, the kernel started booting and I was hit by a problem once more, the boot stalled at the mounting of the / partition. As mentioned before, don’t forget to build in Ext4 support into your kernel!

Rebuilt kernel with Ext4, booting now… login: Damn! Forgot to set the root password. Where is that boot CD again?

While now the system booted and kind of worked, the / partition stayed read only. I had to remount it manually ‘mount -o remount,rw / /‘ to be able to fix anything. After some pondering and unsuccessful attempts to fix the issue, I remembered that I encountered this problem before while installing Gentoo on my SGI O2. It turned out to be the same problem, the kernel parameter root=/dev/hda1 won’t cut it, real_root=/dev/hda1 to the help! It has to do something with the temporary roots in ram during early boot and unmatched filesystem types, who knows…

Next came the screen resolution, where the familiar vga=791 kernel parameter did nothing. This time some Googling helped me to find some Arch Linux guys solution, including ‘insmod vbe‘ in grub.conf did the trick, vga=791 works now!

Well, I hope that this was as much Fun for you as it was for me; more on Funtoo next time.

All product and company names herein may be trademarks of their respective owners.

Get your free 30-day GFI LanGuard trial

Get immediate results. Identify where you’re vulnerable with your first scan on your first day of a 30-day trial. Take the necessary steps to fix all issues.