I wrote this humble installation HOWTO after installing Gentoo on my first PPC computer, namely a 15" Aluminium Powerbook G4 1GHz. This was my first install of Gentoo on a non-x86 architecture and although I have managed to have a fairly decent system, I ran into several issues that were not covered in the Installation Handbook (but I might have read some sections a bit quickly). I found most of the answers on this Gentoo PPC Forum or by googling the web, but I thought that some people would like to see a post summarize all theses pieces of information in one place.

If you are these "some people", read on.

Note: if you spot any mistake, or if you have better suggestions or alternatives to what I describe in this document, feel free to tell me and I will gladly add any additional information to this humble HOWTO!

What version ?

I have installed from the 2004.0 Universal PowerPC Installation Disc (LiveCD) that I ordered on the Gentoo Store. A few days after the order, I noticed that the store did not sell the PPC CDs anymore, because of some troubles noticed with them. I didn't run into any myself.

I cannot say whether this guide would work for previous (or future) versions of the LiveCD, you'll have to try for yourself (or grab the 2004.0 ISO). Nor can I say whether it is valid for other versions of the Powerbook (or for the iBook), but I guess you'll be smart enough to extrapolate when needed (e.g. not try to load the radeon module if you have an NVidia graphics card !).

Important remark: you should follow the Gentoo PPC Handbook in any case, and use this HOWTO only when you need some help on specific details. This document is not intended to replace the handbook, but only to complete it on some points.

Extra links

I browsed a lot of differents websites, forums and mailing lists archives. I couldn't list them all here, but the best thing to do is always to ask Google !

Firewire: works fine with kernel 2.6.1 (not working with kernel 2.6.4), including network via Firewire and connecting (mounting) an iPod (gtkPod is masked, but just compiles fine)

Wifi (using a 802.11g PC Card, not the Airport Extreme!) I have an SMC 2835W working with the prism54 driver. Other PCMCIA cards should be supported as well.

Power managment (with cpufreqd and pbbuttonsd, cpu frequency scaling)

MOL (Mac-on-Linux)

Connection with the Sharp Zaurus SL-5000D: the usbnet module works fine as it would on an x86 machine

Sleep: suspend-to-ram sleep is supported since 2.6.11 (yet another magic trick by the ever fantastic Benh).

Airport Extreme WiFi card (Broadcom chipsets are supported using the bcm43xx driver since late 2005).

Pending :

56k modem (anyone tested it ?)

Observed issues :

The screen goes all funny at times, I just have to switch to another virtual console and come back (CTRL-ALT-Fx) and it's back to normal.

Note: Feel free to ask for additional working/non-working devices, I'll add them to the list if I can test them.

Booting the LiveCD

If you just insert the LiveCD and boot your laptop, it will start MacOS X and [n]not[/b]* the LiveCD. To force the LiveCD booting, hold the 'c' key with the CD inserted while booting.

Alternatively, you can hold the Alt key pressed while the laptop is booting. You will then have a graphical menu to choose between the booting media (installed OS, bootable CD, etc). Choose the CD-Rom and click the arrow, it should boot the LiveCD.

Loading keyboard mapping

Just load a standard x86 mapping, not the mac-specific mapping, i.e. look for a mapping in /usr/share/keymaps/i386 and not in /usr/share/keymaps/mac, for example :

Code:

# loadkeys fr_CH-latin1

Now, where is the AltGr key ?

You must add it manually to the keyboard mapping you use. I use the Apple key for that. So first, let's see what keycode it is by running the showkey (sys-apps/kbd) command and pressing the Apple key :

Note: For some reason (I'm no expert), keycodes seem not to be the same under X, so when you will be looking for the keycodes for your PBButtons configuration, you will have to use the xev utility.

Boostrap partition

After partitionning the harddrive (I kept MacOS X on a 7 GB partition), you must create a bootstrap partition.

After running `mac-fdisk /dev/hda` you can use the 'b' command to create it. Make sure it is the second partition on the disk.

To run yabootconfig, I exited the chroot environment, copied the CD yaboot.conf to the harddisk and used the --chroot /mnt/gentoo option. Then I ran mkofboot -v and it installed everything in the bootstrap partition. Remember that the next time, you'll only need to run ybin -v instead of mkofboot.

Note: I had to manually add the MacOS X line to the yaboot.conf file :

Then add this to the /etc/modules.autoload.d/kernel-2.6 file and be done with it :

Code:

# echo sungem >> /etc/modules.autoload.d/kernel-2.6
# modules-update

After that, `ifconfig -a` should show you your eth0 interface and you can bring it up.

Kernel configuration

You could probably manage to prepare a pretty cool .config kernel file, but I'd recommend to use the PPCConfigDB .config file as a basis. It works great, and you can easily add/tweak things from there without breaking everything.

I downloaded and used the "PowerBook_G4_1250MHz-15.2_Aluminium" tarball as a basis for my kernel and X11 configuration. It worked fine even though I have a 1GHz (SuperDrive) and not a 1250MHz (ComboDrive) Powerbook.

Thanks to the PPCConfDB, they really rock !

XFree86

You must emerge the cutting-edge xfree-4.3.99.902-r2 version, because the 4.3.0 version is reported not to work correctly on new powerbooks. Also, you must not emerge xfree-drm for it is not supposed to work on new powerbooks (yet, hopefully).

I spent a few hours trying to figure out what to put in the XF86Config file. I also tried the Xeasyconf which marginally worked for me.

Then I decided to try the PPCConfigDB kernel and X11 configuration files : it worked out of the box, like a charm. So unless you are really masochist, I see no reason not to use them.

Sound

You just have to activate the right modules. With a 2.6 kernel, you have better use the ALSA output. This is done by compiling the alsa modules and the snd_powermac module. If you want to use OSS, compile dmasound_pmac instead of snd_powermac, it works too. In both cases, you will also need the i2c-dev module.

Now, the applications ... audio in mplayer works fine as long as you don't use the alsa9 audio output driver. Use the oss driver instead (`mplayer -ao oss`).

XMMS works too but you have to manually change the output plugin to ALSA and change its configuration : set the Buffer time to 3000ms and the Period time to 500ms.

Also, remember that you must be in the audio group to have access to the sound devices (thanks to _savage for the remark).

That should do it !

Thanks to HighOnBonsai and corsair for help on making the ALSA drivers work !

Configuring the SuperDrive DVD-R/CD-RW

With the 2.6 kernel, the ATAPI drives no longer need to be accessed through the usual ide-scsi emulation. Therefore, you don't need to compile that module anymore. Here are the options you must activate in your kernel configuration (but they are probably already selected if you use the configuration file from the PPCConfDB project) :

But if you are as lazy as I am, you will want to make this the default value for the dev argument, so we will use the /etc/defaults/cdrecord file :

Code:

# echo 'CDR_DEVICE=ATAPI:0,0,0' > /etc/defaul/cdrecord

Now you can run cdrecord without the dev argument :

Code:

# cdrecord -v speed=10 image.iso

And don't forget to edit your pbbuttons configuration file to be able to use the keyboard eject button :

Code:

[/etc/pbbuttonsd.conf snippet]
dev_CDROM = "/dev/hdc"

Using the DVD burner

The DVD burning (ISO9660) was reported to work by gnomeza. You have to load the ide-cd module and use the DVD-enabled cdrecord executable from XCDRoast, i.e. not the standard cdrecord from the cdrtools package since it is not DVD-enabled.

Thanks to gnomeza for the report !

Activating the mouse button emulation

Maybe you just don't want to always carry that bloody USB mouse around, so you use the touchpad. But hey, there is only one single button !

Fortunately, we can use the /proc/sys interface to tell the kernel to emulate the two other mouse buttons with the Fn key.

Code:

# echo 1 > /proc/sys/dev/mac_hid/mouse_button_emulation

Now you should be able to use Fn+Ctrl as the middle button and Fn+Alt as the right mouse button ! If it does not work, make sure this file exists in the first place (otherwise, there should need some kernel config tweaking) and check the values of the other files in the same directory. On my powerbook, I use :

Then simply use rc-update to load the service on boot and you are done:

Code:

# rc-update add pb-mouse-emulation default

Using the cool Fx keys just like MacOS X does

The great app-laptop/pbbuttonsd packages does just that. I recommend emerging the latest unstable version (0.5.9-r1 in my case) because I haven't had any trouble with it (yet) and it seems quite stable.

Here is my configuration file for it. All the keys are set correctly, for instance you can press Fn+F3 and the sound will be muted. For some reason, I managed to map all the keys with the Fn pressed *except* the keys controlling the keyboard backlight brightness (F8, F9, F10). So for these, I just press the Fx key alone instead of Fn+Fx.

You can also emerge the graphical frontend that displays the different levels as you change the settings. The package is app-laptop/gtkpbbuttons, and I recommend to install the latest unstable version (0.6.2 for me) since it has a gorgeous MacOSX-like theme.

I added this to my ~/.xsession (*before* the call to the window manager, of course) to start it automatically when I start an X session :

Code:

[~/.xsession snippet]
/usr/bin/gtkpbbuttons -t MacOSX -d

The app-laptop/powerprefs should allow you to configure pbbuttonsd with a nice GUI, but the compilation failed miserably for me, so I'll try it another time ...

CPU Frequency scaling

You can use the sys-apps/cpufreqd package to adapt the CPU frequency to the current machine load. To have it run without error, I had to emerge udev. Anyway, I think it's a good thing to use udev so basically, install it as well and it should work.

You will probably have to change the percent values to absolute values in your /etc/cpufredq.conf file. At least, I had to.

Disclaimer: I have not understood how to configure this properly yet, so it's basically useless right now If anybody has good advices, I'd be glad to learn how to use cpufreqd !

Delete key

Yes, there is no delete key on the Powerbook keyboard. Yes, it sucks.

It seems like in console mode, you can emulate the delete key with Fn+Backspace. I don't remember writing any rule for it, so I guess it does it by default.

For X, you can simply use Xmodmap and add "keycode 107 = Delete" to your ~/.Xmodmap :

Code:

$ echo "keycode 107 = Delete" >> ~/.Xmodmap

And this should hopefully map Fn+Backspace as Delete under X too. If it doesn't work, maybe this is a terminal configuration issue.

For mlterm, I had to setup a termcap file :

Code:

$ mkdir ~/.mlterm
$ echo "xterm:kD=\E[3~" > ~/.mlterm/termcap

Wireless PCMCIA card (prism54)

The Airport Extreme wireless card is supported under GNU/Linux as of late 2005 using the bcm43xx driver. However, it was not when I bought my Powerbook so I bought a PCMCIA wireless card. I leave this section although it has become somewhat obsolete in case other people still want to use an external wireless card.

Here is what I did to install an SMC 2835W (802.11g, prism54 driver) on my powerbook.

First, emerge the wireless-tools package and a 2.6.5 or later kernel. You should be able to use an earlier kernel with the separate prism54 Gentoo package, but I prefered the newer versions that integrate the driver right in the kernel tree.

After checking these options, just `make modules modules_install`. You don't have to add the modules to your modules.autoload file since they are automatically loaded (and unloaded) by hotplug if you have it running (check rc-update) !

Then, you have to manually grab the firmware because of license issues. I'm not sure of the exact reason, and it looks like the prism54 guys aren't either.

* Wednesday 5 May 2004
- Added a section about DVD Burning (thanks to gnomeza)
- Added a report on the installation of an SMC 2835W wireless pcmcia card.

* Monday 31 May 2004
- Updated the Table of Contents
- Updated the Booting section (just found out about holding the 'c'
key)

* Sunday 20 June 2004
- Added a remark about the audio group (thanks to _savage)
- Added the 56k modem in the pending list (please contact me if you
have tested it, successfully or not)

* Saturday 11 February 2006
- Updated the status about suspend-to-ram, which has been working
for a while now.
- Updated the status about the internal Airport Extreme card,
since it is now supported by the bcm43xx driver!

_________________Theefer

Last edited by theefer on Sat Feb 11, 2006 6:02 pm; edited 6 times in total

But why shouldn't I use mac specific keymaps? (the keymap thing is the last issue which doen't work correct on my powerbook)

What exactly doesn't work ?
Do the main keys work (e.g. ABC etc) ?

I found that the mac keys were wrong with the powerbook key mapping, probably because they are intended to be used with another kind of mac (iMac or stuff like that maybe). I use the fr_CH x86 keymap and it's fine. But you can try the mac keymaps too and see if it works for you ...

But I had to customize some stuff (most notably the SHIFT+number keys) with my .Xmodmap file.

So please, tell me exactly what keys are wrong, so that I can see what is wrong exactly. I guess maybe you will have to configure some stuff in your .Xmodmap file, but it's no use posting mine since it all depends on the mapping (I use a french (Switzerland) mapping) ...

Please report what you do to fix the keyboard (what is your mapping schema by the way ? standard american keyboard?), so that I can add it to the HOWTO ! _________________Theefer

Im using 2.6.1 - just compiling 2.6.4 now. Maybe this will fix the ALSA problems.

UPDATE: Now I know why I didn't use the 2.6.4 sources: The IEEE1394 drivers are some kind of broken in this version - but I need them for my iPod and my Firewire network...
While modprobing the IEEE-drivers (ohci1394) there is always this:
"No Driver For IEEE1394 product" error message_________________Are YOU high - on bonsai?

- DRI and all the hardware accelerated stuff (Radeon 9600 M10) (does anybody guess when this will work?)
- Xinerama does not work - in other words: DVI output does not work (at least with DVI-VGA adapter)
- TV-Output does not work (surprise! )
=> In general: All the video stuff is not yet fully supported (so keep your dual-boot with Mac OS X to watch DVDs via TV-Out)
- Bootsplash not yet tested (I heard that this is difficult to get working)

USB 2, the faster Firewire and Modem not yet tested.

Overall let me say: I'm satisfied so far - but I hope the ATI will deliver PPC-arch drivers for the RV350 chipset: Then I'm happy!

Christopher[/list]_________________Are YOU high - on bonsai?

Last edited by HighOnBonsai on Thu Oct 28, 2004 6:30 pm; edited 2 times in total

But I would like to know if you did anything special to have the sound work in mplayer ? On my powerbook, the sound is all scrambled when I try to play a DivX (sound for a DVD works fine though ; the same divx had the sound alright with the OSS driver). The fix for XMMS works fine._________________Theefer

In mplayer is use OSS output plugin (ALSA is also scrambled... ). What Kernel version do you use? Mine is 2.6.1 (due to the Firewire problem with kernel 2.6.4). I think with kernel 2.6.4 there is also a newer ALSA version.

I can post a small bluetooth How-To here if necessary - but the way to setup bluetooth on the powerbook is similar to other machines (e.g. bluetooth dongle on i386 arch).

Theefer: You may have implied it by mentioning that CD-burning works, but it may well be worth noting that DVD data recording works too.

I'm using the ide-cd module and the DVD-enabled cdrecord executable from XCDRoast.
It's worth noting that reemerging/updating cdrtools will clobber this executable, overwriting it with the non-DVD enabled one.

I've recorded data DVDs using ISO9660, but not UDF (although this difference should be trivial).
[/code]

in the Section "InputDevice" for your Keyboard in /etc/X11/XF86Config-4.
Now, you should be able to reach |@¤{[]}\ with fn+alt-->release fn but not alt + <;q;e;7;8;9;0;ß
you can type "~" the same way as above with the (german) "+" key followed by space
"#" is "#"

Airport is supported already, but Airport Extreme (shipping with the latest Apple laptops) is not.
The answer is "as soon as one of these two events occur" :

Broadcom publishes the specs for the chipset (used in the Airport Extreme and many other cards) - not much hope for the moment

The reverse-engineering project succeeds - hard, but let's hope

Until that, unless you extensively use MacOSX or you have money to spend on things you don't use, I'd advise you to go for a pcmcia wifi card. They work great and are more easily supported (see the HOWTO update and browse the web before you buy one). I think I heard it is possible and actually easy to add an Airport (Extreme?) card later yourself, in case they are finally supported _________________Theefer

Is anyone currently working to reverse engineer the airport extreme card? I want a powerbook but i'd like to have a working wireless card driver and all the powerbooks now come standard with airport extreme (i'd rather not buy a seperate card just for wifi on linux) I have a wireless network in my house so I will definitely be using wireless. Will it probably be supported by July when I get my powerbook?(_________________Radeon 9500 pro on Pentium 4 1.6ghz running Gentoo Linux (kernel 2.4)

I think there is a team working on reverse-engineering the broadcom chipsets. However, I don't think they can give any guarrantee or date of success, so if I were you, I'd consider buying a PCMCIA wifi card. As it was mentionned before, you should always be able to switch to Airport Extreme whenever|if it is ever supported._________________Theefer

They talk about using (on X86 machines) ndiswrapper to run the Windows driver, and it appears to work.

I'm wondering if there's an approach that's similar on PPC, some kind of wrapper that lets you run OS X drivers. Or, and this is really fanciful, if you could somehow get BOCHS to run the driver for ndiswrapper?

I'm not a programmer or driver hacker or anything like that so I have no idea if this is a possibility. Any ideas?