I finally took a crack at getting everything to work with the iBook on ubuntu. Well sort of. I have problems with sound, and with CD-AutoMount. The CD-Automount is related to a known bug in 9.10. Hopefully 10.4 will have this fixed. I can still mount from command line, and that is good enough for me. I don’t use this iBook for sound or media, so sound isn’t important to me either. Below is my list of requirements

My requirements
1 Functional Linux OS with GUI
2 Ethernet, and wifi with WPA
3 Power management including screen dimming and quick and reliable suspend and hibernation.
4 Ability to easily install applications with apt-get for computer network related tasks. This includes wire sniffers and network analyzers as well as functional web browsers (with flash and java) to help with researching problems.

Yeah, I know, I got 9.10 to work on the iBook just before 10.4 comes out. Well, when 10.4 is released I’ll update this blog post.

I would like to rant on the 9.10 PowerPC Live CDs for 9.10 Being 705Mb, they wouldn’t burn to a CD and therefore wouldn’t install on an older iBook that lacks a cd drive, and does not support booting to usb. Of course this could be part of the reason that ubuntu is no longer officially supporting the powerpc architecture, but I hope that future powerpc releases do not have this oversight. The alternate CD was just under 700Mb, so it did work. (In 10.4 this was fixed.)

I had 2 iBooks to toy with. On one iBook, the thing kept hanging while installing 9.10. (I did not have this problem with 10.4.) I think for some reason the CD would spin down and not spin back up. If i quickly went through the setup, that is, made it so the system never waited on me any longer than it took to move my fingers to enter the data then the system would install. I had this same problem with debian on the ibook too. But the install did eventually work. After the install I tried a variety of “fixes” but the only real fix was upgrading the kernel.

On iBook 2 (but same model) the thing wouldn’t install 9.10 at all. (But it would install 10.4.) It did install 9.04, but even if performing the steps below, things would not work. With the 9.04 and the kernel upgrade there was no suspend or resume. So, not all of my requirements were met. I needed 9.10 on this second laptop. I ended up cloning the disk from iBook 1 to iBook 2 (using ddrescue).
Installing debian was opposite. The one that would install 9.10 would not install debian and the one that wouldn’t did. My debian iBook project is for a future post. These 2 iBooks claimed to be the same model and same specs, but obviously something was different.

Upgrade the kernel
After you get the OS installed, you need to update the kernel. Don’t worry, it isn’t as scary in ubuntu as you might think. Also, with a fresh install, what is the worst that will happen? You’ll need to re-install again.
From: http://ubuntuforums.org/showthread.php?t=453497
Also, see: http://ubuntuforums.org/showpost.php?p=8522321&postcount=1387

apt-get update
apt-get -y upgrade
apt-get install kernel-package libncurses5-dev wget bzip2 fakeroot
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-
tar -xjvf inux-
ln -sfn linux- linux
cd /usr/src/linux

If you would like to use my .config file then perform the next 3 steps. If you’d like to create your own, then skip these next 3 steps.

wget http://ant2ne.com/downloads/iBook_ubuntu9.10_ant2ne.config
mv .config .config.original
mv iBook_ubuntu9.10_ant2ne.config .config

If you don’t want to use my .config, you can create your own by performing the following. If you feel safe with my .config then skip the next 2 lines.

cp /boot/config-`uname -r` ./.config
make menuconfig

Be sure to select all wifi (except the mac mesh thing) and enable the suspend and hibernate settings.
Regardless of the .config method, you need to pick up with this next line.

make-kpkg clean
fakeroot make-kpkg –initrd –append-to-version=-ant2ne kernel_image kernel_headers
make-kpkg –initrd –append-to-version=-ant2ne kernel_image kernel_headers
cd /usr/src
ls -l
dpkg -i *.deb

You’ll now need to modify the yaboot.conf file.

sudo cp /etc/yaboot.conf /etc/yaboot.conf.original
nano /etc/yaboot.conf

Paste the following, just before the other sections that look like this.

# initrd=/boot/initrd.img-

Note: The commented initrd.img line.
Note: there is no video=ofonly! Video=ofonly breaks suspend and screen dimming.

Problems with this kernel
I get some boot errors with this kernel on start up regarding radeon and Plymoth. These errors seem to be related to the splash, that doesn’t work with 9.10 anyway. I just disabled the splash in yaboot.conf and ignore these errors.

After rolling this kernel there is no eth up on boot. This isn’t an issue most of the time, but if you want the network to come up with the OS you need to do the following.

sudo nano /etc/network/interfaces

and add

auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp

Sound in 9.10 is broken. It didn’t detect my sound card. With 10.4 this was not a problem.

Power Management
with a 2.6.32 kernel, you don’t need pbbuttonsd or pmud, as the kernel can handle it all. I removed it with

sudo apt get remove –y pbbuttonsd pmud

For kernel suspend and dimming, you gotta be sure to remove video=ofonly from yaboot.conf! (see above)
sudo nano /etc/power/pwrctl

Find any place where you have “ifconfig eth0 up” and add directly above it

modprobe airport
ifconfig eth1 up

Find any place where you have “ifconfig eth0 down” and add directly above it

modprobe -r airport
modprobe -r orinoco
ifconfig eth1 down

I have yet to see an ibook with wlan0 instead of an eth1, but i suppose it is possible. Be sure that you do have an eth1 by typing “sudo ifconfig eth1 up” and then an “ifconfig eth1″
Now click System, Preferences, Power Management and configure the power settings as you’d like.

For wpa you must perform the follwing.

wget http://www.ant2ne.com/downloads/iBook_orinoco.fw.tar.bz2
tar -xvjf iBook_orinoco.fw.tar.bz2
mv orinoco.fw /lib/firmware/agere_sta_fw.bin
modprobe airport
shutdown now -r

wpa_supplicant command line works great. And, I have had some success with wicd and connecting to wpa networks. I cannot connect to non-broadcasting networks with wicd. I do suggest wicd as your gui connection method.

sudo apt-get install wicd

In debian, the gnome-network-manager works just fine, but I have not tested it much in ubuntu. If anyone tries it, feel free to update me on its success.
Hot hard drive

sudo hdparm -B /dev/hda

Displayed APM_level = 254, Which basically means no power management and no spin down. (see man for hdparm) Any number between 1 and 127 should permit spindown, with the higher of that spectrum being more performance. I went with

sudo hdparm -B 127 /dev/hda

And this should have aggressive performance, but still permit spindown and power savings. It is too early to determine if this actually makes the drive less hot. While we are here, the acoustic setting is set to 128 which is quiet mode. I don’t care how loud my hard drive is. I’ll crank this up to improve performance (possibly offset the loss from the -B setting)

sudo hdparm -M 254 /dev/hda

sreadahead sreadahead is a program that speeds up boot times. I did notice a 10-15 second gain in boot time. I did time a boot (from bong) to login both before installing and after, but I didn’t focus too much on gathering accurate data. It could be all smoke and mirrors. Read about Ubuntu and sreadahead

mdkir ~/apps
cd ~/apps
{beware of word wrap here}
wget https://launchpad.net/ubuntu/+source/sreadahead/1.0-5/+build/1285937/+files/sreadahead_1.0-5_powerpc.deb
dpkg -i sreadahead_1.0-5_powerpc.deb

java suns version did not want to install from the repos. Broken depends. So I’m installing the open one and we’ll see how it goes.

sudo apt-get install openjdk-6-jre

networking and internet I notice firefox was gobbling up much of my 800Mhz CPU. Too much. So I installed midori which is a lightweight, yet very functional browser. It doesn’t support all of the things fire fox does, so I keep fire fox arround to full fill those roles. But for general web surfing, midori is faster. I also grabbed my other networking apps at this time.

sudo apt-get install midori thunderbird wireshark netperf zenmap sunbird

Be sure to browse this list to be sure that you want everything that is in this list. These are things that I wanted, and you may not. First, You need to check that a “multiverse” mirror is listed in your /etc/apt/sources.list

sudo nano /etc/apt/sources.list
sudo apt-get install -y ppc-codecs libdvdcss2 mozilla-plugin-gnash swfdec-mozilla mozilla-plugin-vlc vlc libavcodec-extra-52

There is no adobe flash on the ppc, hopefully gnash will suffice.
If your system doesn’t have a lot of resources, installing lxde as your X session maybe an option.

sudo apt-get install lxde

Right Click The dreaded right click is either mapped to the F12, which is dumb, or not available at all. The fn & alt keys are much more convenient.

sudo nano /etc/sysctl.conf

And edit or add the following

dev.mac_hid.mouse_button_emulation = 1
dev.mac_hid.mouse_button2_keycode = 87
dev.mac_hid.mouse_button3_keycode = 100

exit and save. Then, back in the terminal execute

sudo invoke-rc.d procps start

so the changes take effect.

And there you have it. Everything works.

Additional Notes on Ubuntu 10.4
Configuring LTS Ubuntu 10.4, is basically the same. Installation was a pita. To make a long story short, the live CD was blurry and nearly impossible to read. I suggest you use the alternate installer CD. Once installed, the OS would boot to a black screen. Somehow, you need to get in to the hard drive (I suggest booting from a 9.04 live cd) and modifying (or creating) the file /etc/modprobe.d/radeon-kms.conf to read

options radeon modeset=0

Read More here
And that worked,.. but now, randomly, my Xorg eats up 96-99.2% of my CPU and the system is just completely unresponsive!! I’m still working on a solution for this.

Other problems, applications and solutions
See PowerPCFAQ and, PowerPC and, PowerPCKnownIssues

Tricks that didn’t work
I trolled the internet looking for solutions. I tried a whole lot of things before settling on the solutions above. Here is a list of things that I tried, but they did not solve the problem without the above fixes. With the above kernel, i didn’t need these tricks.
Turn off visual effects From https://wiki.ubuntu.com/PowerPCKnownIssues
Sound breaking suspend system – power management – general and deactivated the “use sound to notify etc..”
kernel upgrade with sudo apt-get install linux-image-2.6.32-18-powerpc
Failed with the following errors.

update-initramfs: Generating /boot/initrd.img-2.6.32-18-powerpc
W: Possible missing firmware /lib/firmware/2.6.32-18-powerpc/radeon/R700_rlc.bin for module radeon
W: Possible missing firmware /lib/firmware/2.6.32-18-powerpc/radeon/R600_rlc.bin for module radeon

roll my own pbbuttonsd
Failed with the following errors

./configure: line 5909: syntax error near unexpected token `1.0.0,’
./configure: line 5909: ` AM_PATH_ALSA(1.0.0, pbb_have_alsa=yes, pbb_have_alsa=no)’

Editing the pm files

sudo nano /etc/pm/config.d/local-sleep-modules

and added this line

SUSPEND_MODULES=”ohci_hcd airport orinoco”

I actually left this setting in place, so I can’t declare it necessary or not.
modifying this file, did nothing.

sudo nano /etc/pm/sleep.d/00-local-chvt