Linux PPC on oldworld macs

From LQWiki
Jump to: navigation, search

Have an old PPC mac laying around that's got a PCI Bus? Can't run OSX on it or if you have one of the beige G3 Models you can but very slowly, so what to do with it now that there is dwindling support? Why not revitalize it as a Server or a workstation for simple tasks, i.e. email word processing, web browsing by turning it into a linux machine. This is all fine and good, but can be a tricky problem, as you you cannot boot from a linux CD and there are some caveats to the way Macs boot vs. PC's. Well This is a good tutorial that should get you through most of the process seamlessly. This process has been used on a PowerBase 180 (PowerComputing Mac clone with a 603ev processor) and Several beige G3 Mac AIO units.

What You will need

1)Linux Distro for the PPC architecture burned to CD. There are many Fedora, Yellow Dog, Gentoo, and Debian are some that offer distros for PPC. I prefer Debian it isn't as cutting edge as some of the otheres but should suffice, it does in my case. NOTE: Use either 650MB CDs or the mini 210MB CDs, I ran into problems with some of the drives in the G3 machines being unable to read 700MB CDs this is basically becuase 650MB Cds werre the standard at the time of the drive manufacturing. Also most PPC Distro will not let you boot from CD, However, when I tested YellowDog 2.2 the burned CD would boot the machine, so some versions of YD might allow CD boot, This tutorial assumes that the distro install CD will not boot the Mac.

2)Either a Mac OS install CD (Pre OSX) or Disktools boot floppy from Apple. If you need to use a Disktools floppy (because you have no install CD) then you will need a functioning Mac with Mac OS and a CD Burner or Network connection that can let you copy a file to a machine with a burner PC machines will work. If you need a copy of DiskTools it can be downloaded from Apple.

3)BootX or miBoot these can be found at http://www.penguinppc.org/ (might be two nn in penguin not sure). This tutorial uses BootX, however, miBoot brings a lilo like boot aspect to the Mac tutorials for it's use can be found online. The latest version of the BootX stuffed file has miBoot as well.

The Process

NOTE
Those with A MacOS Install CD Can skip step one and then only read step 2b) before proceeding throught the remainder of the steps.

1)Download the DiskTools floppy image from Apple at ftp://ftp.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/System/Mac_OS_8.1_Update/Disk_Tools_PPC.img.bin or if you have an apple disktools floppy that was enclosed with your system software then cover the tab so that the floppy is writable and not read only. Next If you downloaded the disktoold floppy ensure that you have Apple DiskCopy software (should have been installed with MacOS if not Apple has it for Download) write the floppy image to a blank floppy. After this is done open the floppy disk and remove the fixdisk application, the one with the ambulance icon. Next open the Mac Hard drive and go into the Extensions Folder under System Folder. Copy the "Apple CD/DVD" file from the extensions folder into the Extensions folder under the System Folder on the DiskTools Floppy. Now you have the floppy you need you can eject the floppy and set it aside. Now Open DiskCopy and create a new CD image, either a 210MB image or a 650MB image. Copy all the files from your System Folder on the Mac Hard Drive to the new disk image, do not copy the extensions folder or the control panels folder, or any other folder, you don't really need those folders just the files no subdirectories are needed. Next get the BootX stuffed file if you haven't all ready and unstuff it. Place the unstuffed BootX folder into the CD image you created. Now unmount the open CD image. You will have a file that is called whatINamedMyCDImage.IMG that is the cd Image file, and will be however large you created it i.e. 210 MB or 650MB. Burn that image to a CD if you have a burner and burning software on your MAC. If you do Not have a burner on your Mac ensure you have network connectivity then transfer the file to a computer with a burner.

  • If your computer with a burner is a PC running windows then you will need to install an FTP server on your PC (YOu can find many at tucows) and an ftp client on your mac, there are a few out there for MacOS 8/9 that can still be found. Start the FTP server on the PC and ensure that you can login and upload a file. Then use the Mac FTP client to upload the CD image file you created. Once uploaded you can close the ftp server app on the PC and then burn the image with burning software, One that I know works is MagicISO, it will burn Mac IMG files, although when selecting the image to burn you may need to select the show all files option.
  • If you are using a PC with Linux on it, you can install the netatalk package which enables appletalk services in linux. You can then login to the linux machine via the Mac Chooser and use your linux username password then you can copy the IMG file to the linux share that is mounted on the MAC, the share that is mounted should be your home directory in the linux disk. YOu can then burn it from linux.

2) Go to 2a if using DiskTools or 2b if using a MacOS install CD 2a)shutdown the Mac and insert the diskTools Floppy, now boot up the mac it should boot from the floppy, if you recieve a mac "bomb" with system bus error and a button to restart don't be discouraged, reboot and ensure you boot from the floppy again it should work after a time or two. Once booted you will have a B&W Desktop and you should see the Mac HD and the Disktools floppy, open the Disktools floppy and use Apples Disk initializer app (lite). this will scan the computer and give you the chance to initialize the Mac HD you will need to create two partitions on the MAC HD the first one initialize the second one leave untouched. YOu will need about 200-300MB in the initialized partition that will be used for the MAC OS. Once the Initialization is over copy the System Folder from the Disktools floppy to the Hard Drive, then insert the CD you created. Copy all the files from the System Folder on the CD to the System Folder on the Mac HD, do not copy any subdirectories. Finally copy the BootX Folder from the CD to the Harddrive, and then open the BootX Folder and move the Linux Kernels folder into the System Folder, and copy the BootX Extension that has the dot in front of it to the Extensions Folder in the System Folder on the Mac Hard drive. Now if you haven't done so all ready open the system folder then close all windows and reboot the machine. The floppy and CD should be ejected and it should boot from the hard disk.

2b)Insert the Install CD and boot from cd holding the C key will usually work. Once booted up use the Disk initializer that apple provides the initialize the Hard Disk with two partions, the first needs to be approx. 200-300MB, the second it the remainder of the disk and can be left alone unformatted. After the disk is initialized open the OS installer and select custom install then deselect everything except for the box next to system software that says System Software specific for this machine. or something along thise lines, it will then install a minimal Mac OS with only those thing that are specific to the type of machine you are installing it onto. After the install is done reboot the Mac and let it boot from the Hard drive.

3)Insert the Installation disk from whatever distro you are using. It should come up and there should be an installation folder somewhere on the disk find it and open it, inside there should be two files one the kernel named vmlinux or maybe vmlinux-2.4 or something similar, and an initrd file named something like initrd.gz or initrd-2.4 copy both of these files to the Linux Kernels Folder on the Mac Hard drive. then open up your BootX folder You will see a dialog with two button on top one says linux the other MacOS further down you will see a drop down list that says kernel select the vmlinux kernel that you copied and the you will see a button called otions click it and another dialog will popup a button there will say use image file or something similar it is the last button slect it and choose the initrd file you copied to the Hard drive then click ok. You will come bac to that initial screen but it will look a little different. there will be a line that says RAMDisk size or something similar and a text box with the number 8192 in it select this and change it to at least 16000 I usually use 32000 then click the big linux button on top.

4)The machine will reboot and come up in linux, the installation will be done as it is done specific to each distro, install linux when you partition the drive only use the unformatted section that you left blank do not touch any of the other partitions. Within the space you left for linux partition a space for swap, between 256MB and 1GB your choice based on the space you have on your HD and the RAM you have in your machine. Then at the very least partition the remainder as the root ot / partition. Finish your install. You cannot use quik on these oldworld macs so that will not install. Remember what partition you made the root partition, i.e. /dev/hda7 or /dev/sdc6 etc... you will need this information. After the install is done reboot and you should get that dailog box you saw for BootX during reboot into MacOS. go to options and uncheck use disk image option then click ok. YOu will come back to the dialog and you will see a section that says root= /dev/ an then a text box nex to it, type the partition you used for root in there i.e. hdc7. then click the save button in the dialog and then click the linux button.

Linux should boot up for you!


Notes: The 2.6 series kernel can be a bear to get booted up on a mac. It requires the use of an initrd file which makes things more complicated with BootX. If you are using the 2.6 kernel, or even if you compile a new custom kernel You need to copy the kernel and the initrd file that is specific for that kernel to the Mac OS partition and use them with BootX. If the kernel you are using does not have hfs support enabled or your modules are not loaded for hfs, as is in the case of a debian net install, then you will need to use hfsutils to copy the kernel files to the MacOS partition. the process would be as follows if you have hfutils all ready installed.

# cd /boot
# hmount /dev/hdc5

There will be some stuff from hmount that shows up here it is just information on the hfs partition. The Mac partiton number will likely be 5 if you partitioned like I detailed above.

# hcopy vmlinux-2.6.8-powerpc :vmlinux-2.6.8-powerpc
# hcopy initrd-2.6.8-powerpc :initrd-2.6.8-powerpc
# reboot

Once rebooted click the MacOS button and boot into MacOS move the files you copied from linux (the kernel and initrd) to the Linux Kernels folder in the Macs Sytem Folder, then click the BootX application change the kernel selection from the vmlinux to the one copied from Linux and then select the options button and click use image file choose the one you copied from Linux and then click ok. There will be a text box at the bottom for passing things to the kernel on boot. you need to type

root=/dev/hdc7 devfs=mount all,rw

replacing hdc7 with whatever partition is your linux root. Now save the changes and click the linux botton you will be sailing free from here on out.