Installation of Linux on NuBus based PowerPC Macs

Submitted by linuxopjemac on Sat, 02/06/2010 - 16:18

Are you ready? Working with Linux on your powerpc (ppc) computer is as from now very close! It is a great experience to use Linux on your old PPC based Mac. With the term Linux you are probably familiar. However with X Windows possibly not. X Windows is the graphic interface which facilitates working under Linux. To install Linux, there are a number of things you have to pay attention to. The next procedure applies to newer types of Macs (the so called NewWorld types). The OldWorld Macs are booted in a different way (by means of BootX, see at the end of this tutorial)

First of all, this guide is a little outdated as the installers nowadays do everything automatically. For those of you who want to install stuff themselves or for those who use OldWorld Macs, this guide is still useful.

First of all you must make a choice from the different so-called distributions. There are there a number without costing (this is it beautiful of Linux!) to download. Examples are: Ubuntu, Gentoo, openSuse, Yellow Dog Linux (YDL), Debian and Mandriva. I installed LinuxPPC 2000 and YDL on my iMac 400 Mhz DV

I know that LinuxPPC in advance requires that your hard disk is divided in three Linux-partitions. Nowadays, with the modern installers, you don't need to do anything in advance if you only like to install Linux. Before you start to do anything at all, make a backup of all your data! 

Don't be scared. Partitioning the hard drive is not difficult and also not dangerous. You must, however, copy all important information since after this you will lose all information on your hard disk. To do this, start the program "Disk Utility", from the MacOS installer CD. Boot that CD with the "c" key pressed.

 

Installation for Newworld Macs with open firmware

When everything is backed up, the partitioning can start. For Linux you need in principle at least three parts:

- Bootloader (± 10 Mb) (HFS)
- Swap (dependent on your internal memory) (Apple_Unix_SVR2)
- Root (minus 2 Gb) (Apple_Unix_SVR2)
- if you like an exchange parition between MacOS and Linux (HFS)

1. The boot partition is used to boot Linux. The partition contains a program which enables you to choose which OS you like to run (OSX, Classic OS and Linux). It has to be of the type HFS or HFS+. I recommend HFS, as you can mount and write to it in Linux.

2. The swap is used as virtual memory. My Mac has an internal memory of 256 Mb and my swap is therefore also 256 Mb. It has a unix structure just like the root. Adjust this partition therefore to the size of your internal memory.

3. The root will contain all programs to run Linux, as well as all folders for the users. These partition has a unix structure and must therefore also be formatted as such.

4. Beside these three partitions I have a fourth HFS partition of 200 Mb. I use this to exchange files between the Mac and Linux. This partition can be mounted in both operating systems.

It is possible to just leave one big unformatted empty block for Linux, and to do the formatting during installation. The exchange partition, if you want it, you have to make now.

It is very advisable to make a list of partitions of your hard disk. Write down which partition number belongs to which partition. For example hda8 is MacOS9, hda9 is MacOSX etc. It is very important, if you are planning to use OSX,  to install OSX within the first 8 Gb of your hard disk.

After this disk classification you have to put the Mac system software on one of your MacOS partitions, (e.g. OS 9, or OS X, or both). After restart you can check if the Mac boots from the Mac partition nicely and if all other HFS (+) partitions are mounted on the MacOS desktop.

Now we will install Linux itself. One needs an installation CD of a Linux distribution. There are two methods to boot this CD.  The most well-known manner is to start the Mac with the "c" key pressed. The other option is to press the "Alt" key during startup. Once can then choose the bootable medium. Choose the Linux CD.

The installer will boot and will ask:

boot:

Press the Tab key and you will end up in a menu. Depending on the type of Mac (iBook, G4 or iMac etc), you must make here a choice which installation procedure must be followed. This is not always the case, depending on the distribution. If this is teh case you can consult the documentation put on the CD.

The rest goes automatically. Somewhere in the procedure it is asked to indicate the partitions for boot, swap and root. Some distributions also give the possibility to do all automatically. Look, however, carefully if the installer does the wright thing. Otherwise you can start all over! The root needs to have the mount sign (/). Afterwards the installer asks which packages should be installed.

At the end of the installation a root password is asked. This is very important. The root is the administrator of the system who can perform all tasks. It is advisable to always login with a normal username. Root access may be damaging for teh system if you don't know what you are doing.

In some installers one is asked where the bootloader has to be installed (the bootstrap).

After installation the Mac has to be rebooted. The question is whether it will boot into the bootstrap. If so, you are confronted with a menu from which you can select which OS to run (the program is called yaboot).

If you don't boot into yaboot, you have to restart again and hold the keys "apple", "alt" "o" and "f" all at the same time. One boots into open firmware then (if you have a NewWorld machine). This is a sort of Apple BIOS. In most cases the only thing to type here is:

setenv boot-device hd: …, \ \: tbxi (followed by)
boot

NB at … you have to give the number of the bootstrap partition. In my case this is partition number 13. The Mac should now boot into yaboot.

Choose the "l" of Linux and the show can begin ...

If your computer fails to start after modifying the boot-device, one can always change it back to what it was by booting with the "p" and "r" pressed. Another method is to boot again into open firmware and to type:

reset-all

Booting your Mac with BootX if you own an OldWorld Mac

If you own an OldWorld Mac, (pre G3 era), you don't need a boot partition. The booting process is done via MacOS. Download BootX and install it. Create a folder called "Linux Kernel" into the System folder. Copy the vmlinux file into this kernel folder. BootX and the BootX extension have to be put into the System folder. 

Go to the Apple menu and choose BootX. In the /dev/ field you fill in the partition number of your root (e.g. hda10).

in the More kernel introduce argument you can pass kernel messages like

video=atyfb: vmode: 18, cmode: 16

In this example a certain type of video is chosen with a resolution (vmode) of 1152x870 and colordepth (cmode) of thousands of colours. The options for vmode are 5.6, and 10-20, belonging to resolutions of 640x480 up to 1280x1024 Hz. The options for cmode are 8,15,16,24 and 32 of 256 up to millions colours).

Save these settings.

To boot Linux, you click the Linux button. From now on, you will end up in this menu every time you boot the Mac. It is possible to choose Linux or Mac from BootX.

What I did to get Mandrake 8.2 working

Copy the BootX extension, BootX program and linux kernels to the System folder of the first partition (in my case 147 Mb, HFS. Go to control panel, BootX App: choose vmlinux as kernel and all.gz as ramdisk (this provides 2.4.18 kernel). The size of the ramdisk has to be 32000, put it in the size window. I could not partition my PM 7600 in the graphical mode in the installer,  I therefore did a text installation. To achieve this, I added "text" in the more kernel argument field. Start Linux from BootX and the installation can begin. Take care not to restart Linux in graphical mode. With these old machines the X window system will not work out of the box probably. To fiddle around in the settings you need a working shell. In my case the mouse did not work, so an X-window system would be of no help.

After the installation we need to adjust the BootX settings, otherwise we boot from CD again. Take a kernel (Mandrake 8.2 has vmlinuz-2.4.18-6mdk) from the CD and copy this file to the kernel directory in the system folder as well as initrd-2.4.18-6mdk.img) and select initrd-2.4.18-6mdk.img as ramdisk. The size of the ramdisk is not important I think, 8192 is good. Add the following to more kernel arguments (depending on your root partition):

root=/dev/sdb8 devfs=mount

You can check the partitions under MacOS with a proram  called pdisk. This will help you to find out the root partition.

Reboot in linux and login with your name and password. Then start X with "startx". If it works you can be happy. If your X does not work out of the box, you may need to adjust the X settings. I normally perform (as root):

dpkg-reconfigure xserver-xorg

 

LILO
SuSE PPC Linux uses a special edition of the LILO (Linux Loader) for PPC Linux. It is similar to the  boot program that it is used on Intel-based computers. Lilo is put either in the MBR (Master Boot record) or in the root of Linux, to allow the booting of another operating system om Macs. In the /etc map in Linux there is a config file called "lilo.conf" which contains the settings for LILO. In SuSE Linux LILO is used to make a file which is placed in the /boot map, which contains the settings for the Mac to boot. The /etc/lilo.conf file contains a road map of your system, comparable with what is used on Intel machines:

# partition or the HFS volume holding company the pseudo system folder
boot=/dev/hda10
# how lung to wait before booting the default
timeout=100
# the default DC to boat (according to label=)
default=linux
# the kernel to boat Linux
image=/boot/vmlinux
label=linux
# insert any required/desired kernel argument
append= ""
# the root linux partition
root=/dev/hda11
# boat to an installation (e.g., type of install ate LILO promptly
image=/boot/vmlinux
label=install
append= ramdisk_size=10000
root=/dev/fd0
initrd=/boot/initdisk.gz
# boat MacOS (e.g., type of macos ate LILO boat promptly)
other=/dev/hda9
label=macos

In this example the standard HFS volume which contains yaboot and the pseudo system folder are in the /dev/hda10 partition. The MacOS partitie is /dev/hda9. The root Linux is in hda11. After amending settings in /etc/lilo.conf one has to start from within a shell in the command line:

# lilo

LILO then produces the necessary files in the /boot directory. Note that this is similar to the program ybin, which sets the settings for yaboot.

Tip: Information on LILO finds you in /usr/share/packages/lilo folder Linux.

Nice link.