Installing Debian Linux on a G4 Cube

Over the past 2 days I've dedicated my waking hours to making Debian GNU/Linux on my shiny new G4 Cube. Well, alright, the Cube isn't new, but the 80 gig Seagate ATA IV is. So, armed with a brand spanking new 80 gig Seagate ATA IV and a cable modem, I set out to install a new system on my G4 Cube.

This document assumes a little knowlege with Debian. YMMV

Step One: Partitioning
  • Well, first and foremost, I assume you're keeping Mac OS around somewhere on hand. So, boot from your System CD. Find Drive Setup and use it to blow everything away.
  • Set to 4 or 5 paritions.. My setup uses a 'big /' philosophy.
  • Leave the first parition 'Unallocated' and make it as large as you want all of Linux's drives to be.
  • After that, make a small Mac OS Standard Drive and then all your Mac OS Extended drives for Mac OS.
  • Initialize at will.
  • Install Mac OS 9.
  • Reboot
  • Go to http://debian-imac.sourceforge.net/ and download the sit. Uncompress it to your Mac OS Standard drive.
  • Uncompress pdisk, it is a part of the debian-imac package. Run it.
This part is sort of tricky unless you're comftorable with basic fdisk utilities.
'e' puts you into edit mode, try using /dev/hde for your drive's ID.
Once in edit mode, you have some options:
  • 'p' prints the partition table. Make a note of the 'Unallocated' Mac OS drive you created before. It should be listed as Apple_Free.
  • 'd' lets you delete drives. Wipe out the 'Unallocated' Mac OS partition.
  • 'c' or 'C' creates Linux and other drives respectively.
'p'rint the partition table, note the partition number of the now empty space. Create a bootstrap partition with the following:

C #p 800k boot Apple_Bootstrap

Where # is the partition number of the free space. Next, your swap:

c #p 256M swap

Where # is the partition number of the free space. Be careful, the # will be one greater than last time since you made a new parition.

Finally, make your Linux '/' partition. This is most easily done by checking the partition table and using the 'c' command interactively. The partition starts at the base of the free space and extends for its length. 'w'rite the partition table.

Before you reboot, make a note of the partition numbers of your bootstrap partition, your '/' partition, your Mac OS Standard drive and the drive that Mac OS is installed on.

Reboot.

Step Two: The Install

You're back in Mac OS. You have a fancy new partition table and now you have to populate it.
  • There is a folder in debian-imac called 'drag contents to disk icon'. Open it, drag everything out of it to your Mac OS Standard drive.
  • Double check that drive contains the uncompressed debian-imac package.
  • Reboot.

Now, to the Open Firmware. As you reboot, hold Cmd-Opt-O-F. Release when prompted. Welcome to the Firmware. Type

boot hd:#,yaboot

Where # is the partition number of your Mac OS Standard drive. Type 'install' at the next prompt.

You should be whisked away to a Debian installer. I hope you're fairly familiar with it!

The rescue image and base system can be found with the 'harddisk' option, located on the Mac OS Standard partition.

After hitting Enter until your finger is numb from it, the Debian base system should be installed.

Do not let the installer reboot the computer



Hit Opt-F2 to get to a shell. Type

ofpath /dev/hda

then

mkofboot --boot /dev/hda$ -m /usr/lib/yaboot/ofboot --root /dev/hda# --partition #

where $ is the number of the boot partition and # is the number of the '/' partition.

You may now reboot.

Step Three: Some last problems.

Hopefully you've rebooted to a sane state of computing. Complete the Debian install first. I suggest using 'woody' for your apt sources. Hooray for broadband!

After you're done with your install, log in as root. Edit /etc/yaboot.conf.

It is more or less straightforward, with the same paramaters as you used in 'mkofboot'. One note though, this line should be added to your kernel image section:

append="keyboard_sends_linux_keycodes=1"

Adding

macos=/dev/hda#

where # is the partition with your Mac OS System on it will allow you to boot back into Mac OS.

Run 'ybin' to update the boot record.

Configuring X11

Time to tackle that monstrosity that we call X11. The debconf generated config file is almost good enough. Be sure you tell it that you wish to use the Framebuffer. A few things need to be added to the conf file that it generates.

Under the graphic card 'Device', change 'ati' to 'r128' and add

BusID "PCI:0:16:0"

DRI will not work unless you install a new kernel. I'm not going there, it's been covered.

I've never found a complete document of this type.. So I've created it. /msg me if I'm dead wrong please.