Return to the Main Menu
Installing Debian on OldWorld Macs

from Matthew's Apples
by Matthew Frederick Davis Hemming
April 2002


Here is a brief rundown of my ultimately successful attempt to get Debian GNU/Linux 2.2 ("Potato") installed on my PowerMacintosh 9600 with a "Kansas" motherboard. The Mac is using the original SCSI disc (4 GB) and video card (PC I) that it shipped with; the RAM is composed of two non-Apple 128 MB DIMMs. The Mac has "OldWorld" OpenFirmware (version 1.0.5).

Though I had read that getting OldWorld machines to boot directly into Linux was tricky, I really didn't want to waste space on my little 4 GB drive for MacOS-style HFS partitions. I was determined to make the 9600 a Linux-only machine and, in the end, I did succeed. If your configuration is similar or identical to mine, try following these steps:


Stage I: Making Boot Floppies
Stage II: Booting the Debian Installer
Stage III: Partitioning your Hard Drive
Stage IV: Installing Debian
Stage V: Solo System Boot



Stage I: Making Boot Floppies

Download the disc images for the floppies your need to initially boot the installer. Use boot-floppy-hfs.img for the Rescue disc, and root.bin as the Root disc. Be sure to download these files as raw binary, and not as macbinary or plain-text. Do not allow your browser to post-process the files (e.g., unStuff, decode) in any way.

Next, launch ResEdit or a similar resource-fork editor. Select Get File/Folder Info... from the File pulldown menu, and a dialogue box will appear; in it you will find the boxes for the Type and Creator (probably filled with question marks). Fill in the Type as "DDim" (disc image) and the Creator as "ddsk" (Disk Copy), and then checkmark the File Locked box. Quit, and save when prompted.

Now, use Disk Copy (MacintoshHD:Applications (MacOS 9):Utilities:Disk Copy) to make a floppy by typing Command-F. You'll be prompted for the image file and then for a fresh 1.4 MB floppy disc. After you've ejected the finished disc, be sure to snap the little switch in the corner to Read-Only (otherwise your floppy data will be mauled if you accidentally mount it in Classic MacOS). If Disk Copy fails, the most likely cause is bad media. It's no secret that floppy discs suck. Try again with a fresh disc.


Stage II: Booting the Debian Installer

OpenFirmware can be defined as 1) a BIOS-like Forth-based interface stored in your Mac's non-volatile (battery powered) memory for relatively low-level control of the system's hardware; and 2) a profane expression, best used while shaking a fist in the general direction of Cupertino, California. This is because Apple's implementation(s) of the OF standard is a bit creative and, hence, buggy. The buggiest version is version 1.0.5, which is the version included in all or just about all of the so-called OldWorld machines (that is, Macs that predate the candy-coloured-chassis era).

You'll have to deal with OpenFirmware to define the boot device as the floppy drive. The fun part is this: OF defaults on OldWorld systems to using your serial modem port as an output device, instead of your screen. This can be especially tricky if you don't happen to have a second machine with a serial modem port around to use as a terminal (using a Mac serial cable and ZTerm). So, you need a separate piece of MacOS software to 1) give you access to the OF command-line, and 2) allow you to overide the default input/output and booting devices.

I used Apple's System Disk 2.3.1 to talk to OF. Launch System Disk and select the PowerUser icon, then click Advanced Settings. Next, check the boxes for the variables you'd like to overide. Indicate that you'd like booting to pause at the OpenFirmware prompt (this is very important in case you have trouble). Set the boot-device to "fd:0" (floppy drive:first bus) and the input-device to "kbd" (ADB keyboard). As for the output device, you'll have to consult this table since it can vary widely from model to model. My Apple-brand PowerMacintosh 9600/300 ("Kansas" motherboard) worked perfectly with the output-device setting of "pci2/@F".

Click the Save button, and then reboot (I/O, r). Insert the Rescue floppy disc. After a pause, you should see a grey screen with a happy Mac, which shortly changes to the Linux penguin sitting next to a Mac, followed by scrolling kernel messages. If this is the case, skip down to Stage III, below.

If you see only a black screen, your system doesn't like the output-device you've specified. In this case, force-reboot (Command-Control-I/O) and immediately zap the PRAM (Command-Option-P-R) for one chime's worth. Release the keys and MacOS will load; launch System Disk and start again with a different guess at the output-device setting.

If you see the OpenFirmware interface (white-negative type giving a version number and error message), the most likely cause is bad media -- the Rescue disc is especially sensitive since it is read directly by the hardware, before any software is loaded into RAM. The hardware isn't as forgiving of errors and small surprises as software is. So, the first thing to try is to start again with a brand new floppy disc.

If you continue getting kicked back into OF, your system doesn't like your boot-device decision. You can set the boot-device with the command "setenv boot-device [path/device:ID]." You can try variations like "fd0" and "fd0:0" or just plain "fd." OF isn't case-sensitive, so don't waste your time trying majescule iterations. You can attempt to probe the available devices with "dev / ls", but I found the easiest thing to do to be to guess device names until OF said "ok". Once you've found the device name your system likes, type "boot [that device's name]" and you should be off to the races. If not, try force-rebooting (Command-Control-I/O) without zapping the PRAM.


Stage III: Partitioning your Hard Drive

After initially booting from the Rescue floppy, your system will spit it out and request the Root floppy. Be warned, however, that the commands issued by the Debian floppy-kernel may not cut the mustard with your Apple hardware -- my 9600 disengaged the drive-head but did not eject the Rescue disc. In this case, use a straightened paper-clip to poke at the manual eject hole below the floppy drive's mouth; once you've removed the Rescue floppy, you may need to actuate the ejector again to reset the mechanism. Next, insert the Root floppy, hit Return and the installer will finish booting.

The first major step will be the partitioning and initialising of your hard drive. You will need at least two partitions, root and swap. If you're smart, and enjoy recovering -- rather than losing -- your data due to filesystem corruption, you'll want more than two partitions. But hey, I'm not your mother.

The installer automatically dropped me into mac-fdisk, which is a simple command-line partitioning tool. Type 'h' for a listing of commands. Type "p" (lowercase!) to output the current partition map to screen. You'll probably see quite a number of obscure Apple partitions (drivers1, drivers2, patches, &c.) with complicated settings...luckily, you won't have to worry about them since you'll shortly be sending them to that big /dev/null in the sky.

Take note: at the bottom of the table should be the total size of your hard disc expressed in blocks. Write this number down. When mac-fdisk recalculates your disc size later on, it will very likely screw-up and need to be corrected.

Type "i" to wipe out the existing partition map. Good-bye MacOS. You'll be asked to confirm the size of the disc in blocks. If it matches the number you wrote down earlier, hit Return. If not, type in the correct value and hit Return. Next, output the new partition table with "p" and note which partition number is labeled as "Apple_Free." This is the space you'll be doling out to your Linux filesystem. Let us assume the partition number to be 2 for the sake of this discussion (partition 1 contains the partition map itself).

Type "c" (lowercase!) to create a new partition of the default type. When prompted for the first block, identify the partition ("2") and tell it to find it's own bloody first block by adding "P" (so the answer is "2P"). When it asks for the length in blocks, specify a size (like 256M for megabytes). When it asks for a name, name it "swap" or the like. Type "p" to view the updated table. Note that the Apple_Free partition has moved to position 3. You'll create your next partition by typing "c" again, and this time answering "3P" for the start block; next, you can either specify a size again, or you can instruct mac-fdisk to use all the rest of the space available in Apple_Free by typing "3P" again. In the simplest set-up, this would be your "/" partition.



Stage IV: Installing Debian

I selected Network>HTTP as my install method for several reasons: 1) my cable provider has not yet switched to tiered pricing, so large transfers aren't expensive; 2) I've already had the experience of installing LinuxPPC from CD-ROM, and I wanted to try something new; 3) I just think it's cool that you can do that. You'll be asked to plug-in some very basic network information (I.P., netmask, gateway, nameservers). If you don't know what your I.P., netmask, gateway and nameservers are then you probably shouldn't be installing Linux in the first place.

The menu-driven Debian installer is very user-friendly, and I didn't find any significant part of it to be broken. You should choose to make Linux bootable from your hard-drive, so that your system doesn't cry when it goes looking for a MacOS boot-block that isn't there. After the final stage of the installation process you'll be prompted to reboot your computer. DO NOT DO THIS.

(If you didn't read ahead before you actually started installing, and DID tell your system to reboot at this point (like I did, initially), you can try booting off the Rescue floppy again. If you can't get this happening, there is little else you can do but boot up from a MacOS CD-ROM (zap the PRAM and hold down 'c') and start the installation process over again. Oops!)


Stage V: Solo System Boot

So, you figure you're in the clear, right? I mean, the base operating system and kernel have been installed, right? Your system should be able to boot without the assistance of a measely floppy disc, shouldn't it?

The unqualified answer: maybe.

The first order of business is to mount your root partition if it isn't already mounted. Next, select Execute a Shell and you'll be dumped into the compact world of the ash shell. Your mission is to modify the configuration file for Quik (which was created automatically, but erroneously, when you told the Installer to make Linux bootable from your hard drive). Your root filesystem will be mounted at /target. So:

Type "ls /target/etc/quik*" to verify the existence of the "quik.conf" file. (If it isn't there, exit the shell and return to the Debian Installer and go through the "make Linux bootable" stage again.) Type "ae /target/etc/quik.conf" and you'll be dropped into the ash-ae editor with the quik.conf file open.

First of all, verify that the path, device and partition number leading to your root filesystem are correct. The value of the "partition=" field should be whatever partition number your root filesystem lives on (let's say it's 3). The value of "root=" should be "/dev/sda3". Tune timeout to taste; the default works for me. Important: be certain to rename the value of the "image=" field to read exactly the path/filename of your kernel image. Aliases/links will not work. The Debian installer put my kernel at "/boot/vmlinux-2.2.19". (Note: "vmlinux" is correct in this situation, and not "vmlinuz" -- PowerPC Debian uses an uncompressed kernel image.)

Once you have edited quik.conf to your satisfaction, write the file out and quit ae. There remains yet one hurdle: OpenFirmware. You may now select the option in the Debian Installer to reboot your system. Once the Installer has quit, eject any floppy media, with the manual control if necessary.

Now, it's a good thing you followed these instructions exactly, and thus did not neglect to set the auto-boot? variable in OF to false (you should have done this through System Disk by checking the box for pausing startup at the OF prompt). If you did accidentally skip this step, you'll have to configure the OF settings from the ash prompt in the Debian Installer using the "nvsetenv" command. Good luck. I couldn't get this to work.
`
At any rate, those of you who did remember to set auto-boot? to false, kudos. Now rebooting your system should bring you to the OpenFirmware prompt. Use "printenv" to view the current settings. Type "setenv boot-device scsi-int/sd@0:3" to set the boot device to the root partition of your drive. On a Kansas 9600 your internal drive is located on "scsi-int" (the internal SCSI bus) and the device takes the form of "sd@0:3" (SCSI disc at the first bus, third ID). If your boot-file variable has not been set correctly by Quik, set it to " /boot/vmlinux-2.2.19 root=/dev/sda3" where the root-path points to your root filesystem. Note: if this boot-file doesn't work for you, try specifying an absolute hardware path to the kernel image; for example: " /bandit/gc/mesh/sd@0:3/boot/vmlinux-2.2.19" works on my model. You can determine the path to your device with the "ofpath" command at the ash prompt. Try "ofpath /dev/sda3". If this still doesn't work, see if it prefers the alias " scsi-int/sd@0:3/boot/vmlinux-2.2.19".

Now, at the OF prompt, type "boot linux". If nothing good happens, try typing "boot" and then entering "linux" at the boot: prompt. Hitting TAB should cause the boot: prompt to list the available labels, one of which is the keyword that leads to your kernel. Maybe "Linux".

Your system should now boot directly into Debian GNU/Linux. Mine did.

(Addendum: For an additional note about boot-file syntax see Wylie's note here.)


Matthew's Apples Matthew Frederick Davis Hemming

Some images on this page may be ©1984-2006 Apple Computer, Inc., and are reproduced here without permission. The contents of this page are not endorsed or approved by Apple Computer, Inc. in any way. The original content was written by Matthew Frederick Davis Hemming and has been put in the public domain: you may reproduce the text in whole or in smithereens, for any purpose whatsoever.