genkernel is a nice little Gentoo tool designed to make your everyday life with Gentoo as pleasurable as possible, especially if compiling the kernel is something that sends shivers down your spine. It works by taking the latest kernel source stored in /usr/src/linux, combine that with a specified kernel configuration file and compile a fully working kernel with the user not having to go through the tedious process of configuring Linux manually. Kernel configurations known to work are supplied with genkernel, but you can also specify your own configuration file if you wish to build a custom kernel.
So why am I blogging about genkernel when I’m not even a genkernel developer? For the simple reason that the imminent release of version 3.2.0 adds a long awaited feature, support for the Pegasos PowerPC platform!
If you are an eager beaver and want to try it out right away I suggest you edit /etc/portage/package.unmask, create it if it doesn’t already exist, and add “>sys-kernel/genkernel-3.1.9″ to unmask the 3.2.0-prereleases. Then emerge –ask –verbose ‘>=sys-kernel/genkernel-3.2.0_pre18′ in order to install the latest Pegasos-compatible genkernel. To build a kernel simply execute:
genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all
Whatever kernel /usr/src/linux points to will be compiled and installed into /boot as kernelz-<kernel version>, for instance, gentoo-sources-2.6.12-r4 will be called kernelz-2.6.12-gentoo-r4. In order to boot this kernel from SmartFirmware on the Pegasos, assuming /boot is on /dev/hda1 and your Gentoo root is on /dev/hda2 issue the following command:
boot hd:0 kernelz-2.6.12-gentoo-r4 root=/dev/ram0 init=/linuxrc real_root=/dev/hda2
If you have a Radeon you might want to append something like “video=radeonfb:800×600-16″ as well. Please note that genkernel will also install a yaboot-compatible kernel called kernel-genkernel-<kernel version> and an initramfs file called initramfs-genkernel-ppc-<kernel version>, you can safely remove these on the Pegasos since it does not support yaboot at this time.
I have tried genkernel with pegasos-sources-2.6.11-r5, gentoo-sources-2.6.12 and gentoo-sources-2.6.12-r4 and it produced working kernels for all of them. If however you run into any problems please report them to me.
A special thank you goes out to Tim Yamin (aka plasmaroo) for taking my genkernel-3.1.x patch and updating it to support 3.2.0 without me even asking him.
Cool! Gentoo Rules.
debian is faster
Coupla challenges I’ve had:
a) udev doesn’t automatically get pulled from /usr/portage/distfiles
b) the initrd hasn’t worked for x86 yet (I could well be borking something). I actually use my first 2.6.12 initrd, and then boot 2.6.12-r4.
But, hey, that’s life on the cutting edge, no?
Good work, David! Too bad I still have no time to play with Gentoo.
@Chris Smith:
b) 3.2.0 is using initramfs and not initrd
@opi:
Make time
Thank you dholm and plasmaroo for this.
I was still at 2.6.9 because i could not figure the kernelimage format.
What is the filename under /usr/src/linux/arch/ppc/boot/ ?
@fsteinel:
arch/ppc/boot/images/zImage.chrp
I feel a great b0rking in the source
hello
when i type emerge –ask –verbose ‘>=sys-kernel/genkernel-3.2.0_pre18′i got :
!!!Error: -r is an invalid short action or option
did i miss something ? (should i warn all of u that i’m a complete gentoo newbie ? )
@SoundSquare:
Strange, you didn’t miss anything afaik and I haven’t seen that error before. But, 3.2.0 has been released now, along with 3.2.1 and 3.2.2 so you can run a regular “emerge genkernel” to get the right one.