I had been considering building my own server for a home network and decided to buy an old garage Power Mac G4 400. This is a good computer and will work great as a server definitely so I decided to install Ubuntu Server on it. I’m a Gentoo user normally but being the adventure that I am I decided to try something new.
Ubuntu official doesn’t support PowerPC documentation or installation-CDs anymore but the community do still produce installtion-CDs.
Processor - G4 400MHz RAM - 512 MB Videocard - Rage 128 Pro, AGP 4xsl Hard Drive - 10.3 Quantum Fireball LM10.2 Network - Built-in Sun GEM Gigabyte Ethernet - TRENDnet TEG-PCITXR Gigabyte Ethernet - uses Realtek 8169 chipset
The best place to begin with an old computer is to test the hardware. Apple has done a good thing and made their PowerPC Hardware Test CDs available for download. You’ll need Mac OS X to burn CD dmg images though, I’ve tried various Windows (MagicISO) and Linux utilies (dmg2iso, dmg2img, acetoneiso2) that don’t work.
I’m building a server to use as a firewall so all the hardware is there except an additional network card. Another network card will be needed to route to another computer. Here’s good list of Power Mac G4 network cards that work in OS X, check and see if there is a Linux driver for them. The card listed above does.
The firmware will need to be updated to the most recent available. You can check this by booting into Open Firmware (Apple + Option + O + F) at boot and looking at the OF version on the top then compare it to the newest on Apple’s website.
This firmware update requires Mac OS 9.1, luckily I have an old iBook 9.0 install disk that installed. The old software update panel doesn’t work any more though but the 9.1 update can be downloaded. I downloaded the files onto my Linux desktop and burned them to disk:
mkisofs -o PowerMacG4-Updates.iso G4_FW_Update_4.2.8.smi.bin \ Mac_OS_9.1_Update.smi.bin cdrecord -v -dao PowerMacG4Firmware.iso
Reset NVRAM, PRAM, Clock
It’s a real good idea to reset the NVRAM, PRAM and Clock in case any values are set incorrectly:
- Remove or disconnect the memory battery. Leave the battery disconnected for 5-10* minutes.
- Reinstall or reconnect the battery.
- Depress the CUDA (aka PMU) button (for 5 seconds) with a non-metallic (plastic, wood, etc.) device.
- If this doesn’t work, change the RAM. Either add or remove a stick then zap the PRAM (Apple+Option+P+R), wait for three chimes. After that shutdown, add/remove the RAM and start again.
Clock Set, Optional Password
Boot into Open Firmware again and set the clock (military time):
decimal dev rtc sec min hour day month year set-time
Optionally you can add security so no one can tamper your Open Firmware settings, and add protection from being able to be able to boot directly to disk, CD, or netboot.
I used Linux to download and burn the install CD, Ubuntu CD’s can be found here.
And burned them with:
cdrecord -v dao name.iso
The Power Mac G4 Sawtooth Open Firmware only has rudimentary support for Linux and cannot boot Linux CD’s by holding down C or holding down option. Rather you will need to direct OF to the Linux InstallCD’s yaboot file:
Select Kernel and Options
The Ubuntu Installer will now ask what kernel to load and will tell of a few options that can be passed to the kernel. For most people, the default install-ppc will do – use -smp for duelcpu systems. I decided on the expert-powerpc.
Switch to Console for a Couple Tasks
When the installer begins a couple tasks may need to be done. First if you didn’t use the Apple Hardware Test Disk, check the hard disk now for bad blocks. Also the console too add the ide-scsi device to the kernel, the Debian installer fails to recognize it. Get to the second console by pressing Ctrl + Alt + F2.
Check for Damaged Blocks on Drive(s):
Bad blocks can cause serious problems running software. If you discover a bad block it will be marked and not used but be warned when drives begin to get bad blocks the drive is almost always failing.
mac-fdisk -l mke2fs -j -c /dev/sda
DVD/CD-ROM Drive Not Detected
On this computer, the installer failed to load the driver to have the DVD/CD-ROM work (go ahead – it won’t hurt if you don’t need it):
Return to the install by doing Ctl + Alt + F1
Time to Build
Basically you just go step by step. Select you langauge and in keyboards select “macintosh” for keyboard. “Detect and Mount CD-ROM” should now work, then “Load debconf…” and then “Load installer components from CD”. I did this quickly after the “Detect and Mount…” option because once the CD was forgoten by the installer.
In “…InstallerComponents” the only option I choose was “mirror select” but its buggy and didn’t work for me. You can find the mirrors available and then you have to enter the mirror without any subdirectories (e.g. ftp.osuosl.org) in the next dialog enter the subdirectorties (e.g /pub/ubuntu-releases/). I ended up choosing the default UK mirror. The mirror can later be change in
You’ll need to have to download some files for the download to complete so setup the network.
When you get to partitioning choose the one right for you. I decided on the LVM with encryption. This too has a bug. I got a dialog that said “No NewWorld boot partition was found…”. Yaboot (the Mac bootloader) requires this to boot. As I said its a bug and you can ignore it. It will ask you, “Go back to the menu and resume partitioning?” Select “No” and write the partition table.
The rest should be pretty self explanitory, configure the package manager, users… I opted to have a root account because I know “rm -f /” is bad. ;) Install the software you need. The Ubuntu Server Guide details plenty of options: a dns server, firewall, web server… I installed OpenSSH server because it’s easier just to have one monitor on my desk. LAMP to use apache for webadmin tasks (OSSEC-HID, snort) and DNS Server to setup a local LAN.
Now install the yaboot bootloader (skip LTSP), and thats all you need to do. End the installtion and it’ll ask you what type of clock you want. I set the clock to UTC time.
Reboot system and see your new Ubuntu server.
I’ve built a script to use from the command line that I’ve put on the Ubuntu Forums for package management.
change console font in
Debians bashrc tanks – better bashrc
Good luck with your new OS!