So, I have this old iBook, it has been doing nothing for a couple of years, so I decided to do something with it. not having any machine in the house with a BSD on it, I thought I would install NetBSD on it.
The iBook is old. The CD drive doesn’t work, the airport card doesn’t work, but it does have a largish HD and 640MB RAM. Because of the broken CD drive, I figured that I’d net install whatever I was going to install on it. Yes, I know there are other options, I could have put an install image on a firewire disk, booted into target disk mode, and installed something that way, etc. I guess I really just wanted to try net installing something
Reading the NetBSD docs that I could find made me think that I would need a TFTP server, NFS server, and to mess with my DHCP settings. So I installed TFTP on my Fedora 13 system, and went to my OpenWRT router and looked at changing the config for dnsmasq.
So I added to my /etc/config/dhcp:
config boot linux
option filename 'ofwboot.xcf'
option serveraddress '10.0.0.11'
option servername 'tw'
(tw is the hostname of my Fedora system).
Getting the DHCP options was harder, the openwrt docs suggested ‘list dhcp_option
‘, but that didn’t work, nor did any of the other things I tried until, after reading the shell scripts in /etc/init.d, I added
option 'dhcp_option' '17,/export/client/root 42,10.0.0.4 66,tw 67,ofwboot.xcf 128,10.0.0.11'
This seemed to work, with each space separated option being added to the dnsmasq command line (I was happy for /proc/[pid]/cmdline here – it made checking very easy).
Booted the iBook to openfirmware and tried to get it to boot the NetBSD installer kernel like this:
boot enet:0,\ofwboot.xcf
But that did not work, although the ofwboot.xcf boot loader loaded from TFTP, the netbsd kernel did not load from either TFTP or NFS. Eventually, after much messing about, I discovered that:
boot enet:0,\ofwboot.xcf enet:0,\/netbsd
caused the ofwboot.xcf boot loader to load from TFTP and the netbsd kernel to load from NFS (server 10.0.0.11, path /export/client/root, as specified with DHCP).
WooHoo, so I ran the installer, said it should take the whole disk, etc. And installed everything.
It did not boot.
I was sad, and then went to read the INSTALL docs from the NetBSD macppc page. Indeed, it was quite clearly noted that with open firmware version 3.0 or later NetBSD would install an unbootable system if you just chose the installer defaults. The docs that I found on how to do it properly involved using your Mac OS system to partition the disk and so on prior to installing NetBSD. Of course, I had just overwritten the Mac OS system with a non bootable NetBSD. I was now mad. Mad enough to install Linux on what was supposed to be my BSD system.
I first went to install Fedora (because I am used to it), but discovered that Red Hat and powerpc are no longer friends, not that I can blame them for not supporting the architecture, but it meant I had to keep looking. The ubuntu netinstall kernel etc from http://ports.ubuntu.com/ubuntu-ports/dists/maverick/main/installer-powerpc/current/images/powerpc/netboot/ did not boot (yaboot loaded, the kernel loaded, but did not run). So I tried debian. It booted (with the boot loader, kernel and other files all loading from TFTP, no need for an NFS server, or another argument for the boot loader. All that was required was
boot enet:0,yaboot
The installer did not ask me to set up the network (unlike the NetBSD installer), it got all the settings from DHCP. It seemed strange that both Open Firmware and the Debian installer was capable of getting my network settings from DHCP, but the NetBSD installer was not able to do so.
The Debian installer allowed me to partition my disk, and the resulting install booted. All in all it took me less than an hour to install a working debian system, where it had taken me significantly longer to install a non booting NetBSD. Still I did not give up. When installing debian I added a 2GB HFS+ partition, and left a large amount of free space. And I went to install NetBSD again.
This time, while carefully reading the INSTALL document, I was able to netboot the installer, mount an NFS directory with a pdisk binary, format the partitions I wanted, and eventually install NetBSD and have it boot.
Of course, X11 did not work. Why would it? “Working” and “NetBSD installation” don’t seem to be terms that go together. Yes, I was getting madder. However, rebooting the system into debian, installing kde, and running it, showed that X11 wasn’t all that happy on Linux either. Ok, so maybe that wasn’t NetBSD’s fault
. A little google and a little guessing, led me to the following changes to my NetBSD 5.0.2 xorg.conf:
To the “Monitor” section, I added:
HorizSync 25-51
VertRefresh 43-60
To the “Device” section, I added:
Option "UseFBDev" "False"
and to the “Screen” section, I removed everything but:
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768"
EndSubSection
EndSection
And viola, working NetBSD install with working X11. Finally, happy, I wondered what on earth I was going to use it for. I still don’t know, but I’m sure I will think of something. Like maybe letting it sit idle for another couple of years.
You must be logged in to post a comment.

No comments
Comments feed for this article
Trackback link: http://pogma.com/2010/10/31/ibook-g3-netbsd-and-linux/trackback/