Gentoo on an Clamshell iBook

Originally I had installed Ubuntu on this 300mHz clamshell iBook but it lagged a bit and PPC support was dropped by the developers so I built a customized Gnome build with Gentoo. (Note: a community version of an Ubuntu ppc install still exists).

Note: To run Linux it’s recommended to have at least 256MB of RAM for a very basic desktop (I got 384MB). While you can make do with less, system performance will reflect. Consider increasing your memory. Old Mac parts can be found at a number of places.

This guide supplements the Gentoo Quick Install Guide which in turn is derived from the Gentoo Handbook being specific to the PowerPC iBook.

Building Linux on a PowerPC can be a bit of a challenge – support for PPC isnt as well developed, and answers to questions can be more difficult to come by – but building Gentoo Linux on an iBook is not only possible but a customized build can run very nicely.

A Note about Time and Date

Linux can be real picky if the time and date is wrong. If the clock is off or if the iBook has a dead-battery, it’s a good idea to set the hardware clock before booting. To do this from Open Firmware start the computer and hold down Apple + O + F.

To set the time to: 1:23:45 PM November 7th, 2008:

decimal dev rtc 45 23 13 07 11 2008 set-time

Partitioning – Dual-Boot

If wanting to dual boot Mac OS 9 hold down C on boot with the Mac OS Install CD (see below for without). With Disk Setup partition into three volumes. Here’s how I split up a 5 GB partition:

  • 2.7G / – Unallocated
  • 384MB swap – Mac OS Extended
  • 2.6G / – Mac OS Extended

Install Mac OS on the last partition – this is important for the bootloader to run correctly. Now restart and zap the PRAM
(Apple-Option-P-R). If might not be a bad idea to reset the Open Firmware too. See the Ubuntu on a Powermac on how to do that.

Now put in the Linux CD, restart the system and hold down the c key.

The partition map was already created with Disk Setup. “mac-fdisk” will be used to specify what each partition will be used for.

mac-fdisk /dev/hda p # print current partition map b # Create Apple_Bootstrap 8p # selects eighth block device c # root partition 9p # first start block, 9th partition 9p # end block, 9th partition / # name of root partition d # delete for swap setup 10 c 10p 10p swap # name of partition w # write changes to disk q #quit

Partitioning the Full Disk

I don’t use Mac OS 9 though anymore and just used mac-fdisk to partition:

mac-fdisk -l # to see partitions mac-fdisk /dev/hda # enter disk editor p # print current partition map i # init new partition map b # OF needs an Apple bootstrap partition 2p # on second partition c # create (for swap) 3p 768M # twice the size of the physical RAM swap # name c # for root 4p 4p # to the end of the physical drive / # name w # write partition map q # quit

Formatting the Partitions

There are several good filesystem types in Linux. The common and best tested file system is ext3 – it offers journaling and is very dependable.

mkfs.ext3 /dev/hda9

With any memory less that 512MB in Linux it is best to make a swap partition and activate it:

mkswap /dev/hda10
swapon /dev/hda10

Configuration-Files for Gentoo iBook

To save alot of time and research, here are configuration files for “/etc/make.conf“, “/etc/fstab“, “/etc/X11/xorg.conf” and “/usr/src/linux/.config” (kernel config).

Installing a Kernel

Included in the configuration-files is the kernel configuration file tailored to the clamshell iBooks. Not much should need be changed.

Manually Configuring a Kernel

If beginning from scratch, start by creating a default mac configuration file:

make pmac32_defconfig
make oldconfig
make menuconfig

Video Support

Video support works better with the userspace driver just make sure that the video card is correctly set in the “make.conf“.

Device Drivers - Character devices --->
/dev/agpgart (AGP Support)
[*] Apple UniNorth support
[ ] Direct Rendering Manager (DRI support)
ATI Rage 128
Device Drivers - Graphics Support --->
ATI Rage 128 display support

Kernel Build

make clean zImage modules modules_install

Kernel Install

make install” uses the “installkernel” script that doesn’t work on PPC computers so the kernel will need to be installed by hand:

mv vmlinuz /boot/kernel-<version>
mv /boot/<version>
cp .config /boot/config-<version>

Adding System Daemons and Tools

“updatedb” runs once a day which is tasking for a slow laptop. To change that behavior move slocate from the daily folder to the weekly.

mv /etc/cron.daily/slocate /etc/cron.weekly

Configuring the Bootloader

PowerPC machines must use “yaboot” as a bootloader to boot Mac OS 9 and Linux.

emerge yaboot

Now exit the chroot and return to the LiveCD shell to create a yaboot configuration file:

yabootconfig –chroot /mnt/gentoo

Yaboot cannot find a kernel? Type it in manually:


Go back to the chroot environment:

chroot /mnt/gentoo /bin/bash env-update && source /etc/profile

Have “yaboot.conf” (which was just produced) applied to the bootstrap partition.

ybin -v

It may be required to manually add a Open Firmware path to the boot device in “yaboot.conf“. Discover the OFpath by:

ofpath /dev/hda#

where # is the root partition number, and add it to “yaboot.conf“:


Now you can reboot and test your system. This will only do a base install (i.e. allow you to boot with basic services. If you want to add a desktop… see the Gentoo documentation. For computer’s of this performance type take a look at desktops like Openbox as Gnome and KDE would probably be too much for them.

A Few Other Tips

Disk Space

Disk space is a tough issue with an older computer. Even more so with Gentoo. But it is possible to install a Gentoo desktop. To make more space available:

df -h

To see how much disk space it being taken. To help, you can empty the temporary files produced by emerges and the source files themselves:

rm -r /var/tmp/portage/*
rm -r /usr/portage/distfiles/*

Clock Skew

If getting a large clock skew if might be because a program in Linux (ntp I believe) will create a clock skew file (/etc/adjtime) if there are large differences between the hardware clock and software clock. Though the hardware clock and software clock may get adjusted correctly the clock skew upon reboot will be adjusted to the skew in “/etc/adjtime“. Remove this file to fix the problem.

Refusal to Check Filesystem on Boot

fsck could refuse to check filesystem on start stating:

(check deferred; on battery)

To fix create "/etc/e2fsck.conf” and add a defer check option:

defer_check_on_battery = false

4MB Video Cards

4MB is a low amount of memory for displaying material on the screen. Any value over 16 bit depth on the desktop will cause excessive paging and long draw times. Fix in “/etc/X11/xorg.conf“.

About Todd Partridge (Gently)

Good times, good people, good fun.

Posted on 2008-11-29, in Linux. Bookmark the permalink. 12 Comments.

  1. Just curious, how’s the performance compared to the mac on the same ibook? And ubuntu?

  2. i installed debian on my ibook (G4) just to save myself from compilation times, but i already miss gentoo :(

  3. @ basic

    Easily better. The specs out of the ubuntu faq require 256MB and this iBook can only max 200MB. MacOS9 requirements are a bit less, but definitely better for compatibility though. Not much really works there anymore (documents, rendering webpages…). Linux is a good way to resurrect the laptop from the dead.

  4. Actually this iBook officially supports 256MB (+ built-in) and is widely reported to accept 512MB. I have 256+32=288 in mine. I’m considering moving from OS 9.2.2 to 10.3.9, but also interested in trying Linux. Given that the hard drive is only 3 GB, is that a consideration among the various distribution options? which would be best to use/try for a novice to install? I am quite familiar with using unix/linux shells on workstations, but have never tried an install on a machine of my own. Airport card compatibility is a must.

  5. As a new desktop user and considering size-constraints I’d still use Debian or Ubuntu for a first try. Gentoo is made for tailoring and people who are willing to make a greater system at the cost of an expanded learning curve.

  6. I just downloaded Ubuntu 9.04 PPC , so I think your comment about no PPC support is inaccurate. I will be installuing on iMac Slot loading


  7. Definitely could have been more detailed there. Basically the Ubuntu PPC version is a lightly-modified Debian cd. That said it should be a good install disk. Post now reflects that Ubuntu ppc version is a community supported version. Thanks for the tip Mark.

  8. I am glad to be a visitor of this consummate web site! , appreciate it for this rare info ! .

  9. It’s a pity you don’t have a donate button! I’d definitely donate to this superb blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to fresh updates and will share this site with my Facebook group. Chat soon!

  10. hey guys, i have used the xorg.conf that was given here but when X starts, half of the screen is blurred by white lines. i used dwm window manager. latest ~ packages, kernel 3.2.1-r2. anyone else hit this problem and solved it?

  11. @ Bobby

    Haven’t pulled out my iBook in sometime so I can’t help you here. You probably will better be able to get help in the Ubuntu forums or (possibly) the Debian forums since they are one of the few that actively develop PPC anymore.

  12. so, upon a later restart X works great :). problem is i added an airport wifi card but it is not recognized, track my problem here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 58 other followers

%d bloggers like this: