iMac G5 and Debian

This page is under development. --TorranceH, 9 December 2006

Aim

The aim of this page is to help get users of iMac G5s up and running with Debian. It is to provide a clear idea of what can be expected to work and what simply won't work at this stage, and to provide the steps required in clear and concise steps.

I am an ex-newbie who has gained these skills from a lot of google-ing, and would rather others didn't have to do the same. Please email me if you can help me with fixes, would like to write or expand a section, or need help (I will help where I can). Email me at [mailto:torrance123((at))gmail((dot))com torrance123((at))gmail((dot))com].

Contents

1. A few notes about the hardware ?BR 2. A few notes about Debian ?BR 3. What you can expect from Linux on your iMac G5 ?BR 4. Compiling your kernel ?BR 5. Java ?BR 6. Enabling ESound sound mixer ?BR 7. DVD Encrypted Playback ?BR 8. Apple Keyboard ?BR 9. Mount MacOS X partition ?BR 10. Minor Font Fix ?BR 11. Recommended applications

A Few Notes About Hardware

There were three generations or "revisions" of iMac G5 produced by Apple. I am using a first generation 17" iMac G5, or iMac revA, and at this point this page will be most suited for this hardware. The revA came with a Nvidia ?GeForce 5200 Ultra graphics card.

The iMac G5 revB is different from the revA in that its backing is curved and it has an ATI Radeon 9600 graphics card. It also had an ambient light sensor to adjust the light at the bottom-right of the front.

The iMac G5 revC is different again as this is the only revision to have the iSight built in to the top. The iMac revC has an ATI Radeon X600 graphics card.

As far as I know, the only significant differences between the three generations in terms of Linux usabilty are that the revC (iSight) do not have any code available to bring the fans under control at this point, and that there is a possibility that revB and revC iMac's may be able to enable 3d graphics with open source ATI drivers.

[http://en.wikipedia.org/wiki/IMac#iMac_G5 More info about iMac G5 revisions.]

A Few Notes About Software

My experience thus far has been based entirely on using Debain Etch (testing, soon to be Debian 4.0). The last time I tried to use Debain 3.1 I was unable to install the system at all.

I performed a network install, but I assume all ppc images available [http://www.us.debian.org/devel/debian-installer/ here] will work. Extensive installation notes for Debian 4.0 are already available [http://www.debian.org/releases/testing/installmanual here.]

As a matter of interest: My system install currently exists on a small 6GB partition alongside MacOS X that is encrypted using dm-crypt with a 256bit AES key (available as an option during install). I have no separate swap partition, but I do have a separate /boot partition (required since my root partition is encrypted). I use Gnome as my desktop environment.

What You Can Expect from Linux on your iMac G5

Generally speaking, you can expect a fully functional desktop machine similar to MacOS X.

However, these things will require fixes and work-arounds to get working (explained on this page): ?BR

At this point, the following features simply won't work or are bugs that I don't know how to fix: ?BR

Compiling Your Kernel

I should stress this is nowhere near as hard you might expect. If you follow these instructions, you'll be fine.

A new kernel is required to enable sound (on all revisions) and fan control (on rev A and rev B). I don't have either Airport or Bluetooth, so I cannot test how to enable these during kernel configuration, but I welcome others' help. For the mean time I will describe which options should be enabled, but in the future I hope to offer a single configuration file optimised for all iMac G5s. [mailto:torrance123((at))gmail((dot))com Can you help me with this?]

Please follow these steps to install a new kernel:

1. Enable sudo (a command that allows to to execute other commands as root, short for "super user do..."). In the terminal:

{{{cd /etc su (type root password) nano sudoers}}}

Using nano, scroll down to the bottom of the page, and add this line at the very bottom:

yourusername ALL=(ALL) ALL

Press control-x and save on exit.

2. Install the required components to compile a kernel. Using Synaptic (or apt-get in the terminal) install the following packages:

build-essential kernel-package libncurses5-dev

3. Download and unpack the kernel source. Head along to www.kernel.org in your browser, and copy the link to the latest full kernel (the link under the F). In the terminal:

{{{cd /usr/src sudo wget http://www.kernel.org/pub/linux/kernel/v2.6/latestkernel.tar.bz2 sudo tar -xvjf latestkernel.tar.bz2}}}

4. Configure the kernel. In the terminal:

{{{cd /usr/src/latestkernel sudo make g5_defconfig sudo make menuconfig}}}

Now the fun part. You've already configured the kernel with a default G5 kernel, and both sound and fan control are already enabled. But there's a few other configuration options which are recommended.

General Speed: ?BR Block Layer > IO Schedulers > Default IO Scheduler > CFQ ?BR Kernel Options > Timer Frequency > 1000Hz ?BR Kernel Options > Preemption Model > Voluntary Kernel (Desktop) ?BR

To enable a firewall: ?BR Networking > Networking Options > Network Packet Filtering > Netfilter Xtables support (Y) ?BR ...now make every option that appears beneath it a module by press M ?BR Networking > Networking Options > Network Packet Filtering > IP: Netfilter Configuration > IP Tables Support (Y) ?BR ...now make every option that appears beneath it, except "raw table support", a module. ?BR Networking > Networking Options > Network Packet Filtering > ARP Tables Support (Y) ?BR ...now make the two options that appear beneath it modules. ?BR

Airport and Bluetooth: ?BR I don't know. Please help me with this.

Now exit, and save configuration on exit.

5. Make the Kernel into a Debian Package. In the terminal

{{{cd /usr/src/latestkernel sudo make-kpkg clean sudo make-kpkg -initrd --revision=imacg5 kernel_image kernel_headers modules_image}}}

...and play the waiting game. All going well, 30 minutes later, you'll have a compiled kernel package. You can call your kernel whatever you like, so long as it has a number in it (--revision=something1).

6. Install the kernel packages.

{{{cd /usr/src ls (this will show you the image and header package names) sudo dpkg -i kernel-header-latestkernel.deb sudo dpkg -i kernel-image-latestkernel.deb}}}

Now restart and you're all done! You should have fan control and sound on start up.

Java

Sun provides a Java implementation for, you guessed it, x86, but not for ppc. They are in the process of finally open sourcing their code, but in the meantime ppc users must install a java binary provided by IBM. This is mostly important for allowing java applets on the web to work, but also applies to java programs like ?LimeWire.

1. Download the binary package.

To get IBM's Java binary, go to http://www-128.ibm.com/developerworks/java/jdk/linux/download.html, and choose the J2SE 5.0 SDK for 32-bit iSeries/pSeries. This will require an annoying registration. When you finally get through the registration, pick the TGZ version of the JRE.

2. Install the required packages for Java installation using Synaptic or apt-get:

java-package libstdc++5 libgtk1.2 

3. Make a debian package out of the IBM Java file. In the terminal, move yourself to the directory where the ibm.tgz file is and enter this command:

make-jpkg ibm-java2-jre-50-linux-ppc.tgz

Then install the resulting debian package:

sudo dpkg -i ibm-j2re1.5_1.5.0_powerpc.deb

4. Configure and install the Firefox Plugin.

Run this command and make sure IBM Java 1.5 is the default Java, and not any other Java that may be installed on your system:

sudo update-alternatives --config java

Check to see that everything is installed fine:

java -version

Finally, set up the Firefox plugin:

{{{mkdir -p ~/.mozilla/plugins cd ~/.mozilla/plugins ln -s /usr/lib/j2sdk1.5-ibm/jre/bin/libjavaplugin_oji.so}}}

That's it! You may need to restart or log out for changes to take effect.

Enabling ESounD Sound Mixer

Debian uses the xine multimedia backend by default so, unlike Ubuntu, mp3 and DVDs play without configuration in Rhythmbox or Totem. However, I've had one or two crashes when running multiple videos and sound files together, and I think it was caused by failing to have proper sound mixing enabled. ESounD, or ESD, is Gnome's software sound mixer.

1. Install gstreamer0.10-esd and any other esd plug-ins you may need. For example, the popular VLC Player requires vlc-plugin-esd package to be installed. Once this is done, configure VLC by going Settings > Preferences > Audio Triangle > Output Modules. Click the Advanced Options tick box, and choose ESounD Audio from the resulting menu.

2. Enable ESD. Desktop > Preferences > Sound, and check the ESD box.

Done. This should ensure better stability when playing mutiple multimedia sources.

DVD Encrypted Playback

Most DVDs are encrypted with a weak encryption called CSS. This is easily broken, but the potential legal issues mean that the libdvdcss2 package required for this decryption is not installed by default and isn't available in the Debian repositories.

1. Enable the Debian-Unofficial repository.

Open Synaptic, and got Settings > Repository > Add. Then click Custom and add the following line:

deb http://ftp.debian-unofficial.org/debian etch main contrib non-free restricted

Click OK and reload your sources.

2. Search for libdvdcss2 and install it as per normal.

Apple Keyboard

Want your Volume Down, Volume Up, Mute and Eject keys to work? Really easy.

In Gnome, simply go Desktop > Preferences > Keyboard Shortcut and scroll down until you find the desired commands and press the respective keys to enable them as shortcuts.

Mount MacOS X Partition

Most MaxOS X installations are formatted in HFS+. Linux can read, but not write, to HFS+ partitions. This is fine if, for instance, you want to play your music collection on your MacOS X installtion but if you want to be able to write to files you can either create a 3rd shared partition formatted with plain HFS (not extended, journalled, etc.) which both can read and write to or you can remove journalling from your MacOS X partition (which I wouldn't recommend).

Whether the format is HFS or HFS+, the process of manually and automatically mounting these partitions is essentially the same.

Manual Mount

1. In Gnome, go Desktop > Administration > Disks and note the device name of your disk (something like /dev/sda4).

2. In your terminal, make a directory to mount your disk to, and then mount it:

{{{sudo mkdir /mnt/mac (you can call the folder whatever you like) mount -t hfs /dev/sda4 /mnt/mac}}}

The -t command specifies the file format. This is either hfs or hfsplus depending on the partition. "/dev/sda4" specifies the partition you are mounting, and "mnt/mac" is the directory you are mounting it in. These will both change depending on your own circumstances.

Automatic Mount

1. In Gnome, go Desktop > Administration > Disks and note the device name of your disk (something like /dev/sda4).

2. Make a directory to mount your partition into:

sudo mkdir /mnt/mac (you can call the folder whatever you like)

3. Edit the file which describes what is mounted on start up.

sudo nano /etc/fstab

4. Add a line for your device such as this:

/dev/sda3    /mnt/shared     hfs     defaults,user   0 0

This is fairly self-explanatory. The first part is the device, the second is the directory you've created to mount the partition into. The third is the file format which could be, again, hfs or hfsplus. The fourth part is the mount options; what I have described above is a default mount, that is able to be done by the user. If I were mounting an hfsplus partition I would add "ro" to the options, becoming "defaults,user,ro" to make the partition read-only. The final two numbers are to specify two values which I don't understand but I am assured on good authority they should remain 0. ;)

5. Exit nano - control-x - and save on exit. Check the file works:

sudo mount -a

6. Restart, and you should find your drive(s) mounted on startup. You can create links in your Nautilus browser or on your desktop, if you like.

Minor Font Fix

Have you noticed that the occasional website you visit has sharp, pixelated fonts? Try, for example, [http://www.infoshop.org/inews/article.php?story=20061209083446732 this one.] The problem is that websites like this are improperly designed and are forcing the use of Helvetica, which does not anti-alias (sub-pixel font smoothing). The fix for this is to force Helvetica fonts to change to the default sans-serif font, which can be easily anti-aliased.

You need to create a new font configuration file. In the terminal:

{{{cd ~ nano .fonts.conf}}}

Into nano, copy and paste (control-shift-v inside the terminal) this text:

{{{<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<!-- Helvetica is a non true type font, and will look bad. This replaces it with whatever is the default sans-serif font -->

<match target="pattern" name="family" > <test name="family" qual="any" > <string>Helvetica</string> </test> <edit mode="assign" name="family" > <string>sans-serif</string> </edit> </match> <dir>~/.fonts</dir>

</fontconfig>}}}

Now log out and back in, and you should find those few ugly websites with properly anri-aliased fonts now.

I thought I'd just make a list of applications that work well in Debian and on the iMac G5, and which are good MacOS X relacements.

Of course, there are the standard Debian desktop packages, like Firefox, OpenOffice, and Gimp which are well known, well-supported, and are perfect MacOS X-equivalents.

Also recommended:

VLC Media Player Also available on MacOS X, this player works well and will play virtually every file format under the sun, including DVDs. An easy install - just remember to install and configure the ESD plugin if you have ESD enabled (as explained above).

F-Spot Photo Manager An iPhoto equivalent. Simple and easy to use.

Firestarter If you enabled firewall in your kernel, then this is a wonderful little frontend for configuring your ports. It's very easy to use, and their website explains configuration if you need help.

Jokosher A Garageband-type audio editor. This doesn't come with the loops and tracks like Garageband, but it is great for editing sound tracks, far simpler than Audacity, and good for podcasts for example.

XChat Gnome Brilliant and simple IRC chat client. Similar to XChat on the Mac.

Seahorse A GPG key manager for Gnome. Clean and simple. Much nicer than any Mac version of GPG.

Scribus An ?InDesign equivalent. To be honest, I haven't used this much and still prefer ?InDesign, but it's on its way to becoming just as good.