This weekend I decided to take the adventure of installing Ubuntu 6.06 (Dapper Drake) on my Powerbook G4. I wasn't sure what to expect as to hardware support, and learned alot along the way. I am writing this from Firefox in Linux on my Powerbook though, so it's been somewhat successful
.
I've been wanting to have a good Linux box to hack on. I did install Xubuntu on an old Thinkpad, but it's falling apart and the battery lasts a whopping 10 minutes. I've heard some good things about Ubuntu on PowerPC, so decided to give it a go.
I have OS X Panther on my Powerbook. I have never had the chance to upgrade to Tiger. I have a 70G drive and had plenty of free space, so my first task was to resize and repartition. Now I'm pretty familiar with doing this on the PC, but not on Macs. I have been using SuperDuper for backups to an external USB drive, so I was set for backups. I actually wouldn't mind it if my Panther partition got trashed, as it would give me an excuse to upgrade to Tiger. In the end nothing bad happened, so I was still luckily (or unluckily) stuck with Panther.
Back to resizing. Out of whim, I tried booting the Ubuntu CD to see if it had an easy resizing tool like it did for Intels. Nope, it just wanted to erase my whole disk. I read that it is possible to do resizing with free tools, but it was late and I didn't feel that brave. I decided to purchase and download iPartition, which seemed similar to Partition Magic. Of course, it couldn't resize the live running boot partition, so I needed to boot something else. The manual first recommends trying to boot off of a backup drive, and if that doesn't work to use the boot CD creator tool that comes with iPartition.
I thought this would be a good test of by 'backup strategy.' I plugged in my external USB drive. After some digging around, I found out that you can have the Mac scan for bootable media at powerup by holding down the Option key while powering on. This brings up a nice GUI boot screen and showed my USB drive! I selected it, and after some crunching it eventually came up with a no smoking sign and didn't boot
. Oh well I guess my backup isn't that cool. It does have files on it though, so I am backing up something, just not something that will boot. I tried some other hackery mentioned on the web, by booting into the Open Firmware by holding down the twister-inspired key combination of Command-Option-O-F while powering up, and changing the boot-device with setenv. I swear, Apple is trying to give me arthritis. Anyway, no luck with that, and I later realized that setenv actually writes the NVRAM, so I had to remember the old setting and undo this. Fuck booting from my 'backup.'
Next I created an iPartition boot CD with their CD creator tool. I booted it (again with the Option key held at boot to select CD), and successfully shrunk my OS X partition by 10G and left the free space. This operation was done so fast I thought it didn't do anything. I booted back into OS X. It booted ok (whew), and I verified in Disk Utility that the partition shrunk by 10G. So far so good.
Now on to installing Ubuntu. I booted the CD. I wanted to see if the Airport wireless worked, so went to System -> Administration -> Networking. It detected the Airport but failed to configure it, and I remember seeing boot messages about firmware errors. I did some research beforehand and it turns out the driver is not open, and it was up in the air whether it would work or not. I figured I could fool with it after installation. I grabbed a wireless card from my Thinkpad, and voila that worked like a charm in my Mac. At least I would have internet access while I debugged the Airport driver later.
I ran the installer, and specified for it to use my free space. The text that is shown before making the partition gave the impression it was going to wipe my HD, i.e. it was not obvious it would use my free space. I thought whatever, if it trashes it that's ok. It didn't (whew), and after a 40 minutes or so, I rebooted. I was given a LILO-like boot menu with my OS X still there. I tested OS X, and that still worked (whew). Next I rebooted into Linux! It was speedy and worked like a charm. My wireless was working, but with the PC card, not with the internal Airport.
I started searching the discussion boards for Airport support. Now Ubuntu forums are interesting. They are mostly filled with non-Linux users seeking help. That's cool and all, but it just makes my searching more difficult with crappy results. I finally found this guide which was generally what I did except for the part about installing 'Network Manager', whatever that was. I figure I should be able to use the Network setting app that is already part of Ubuntu. I found some other good docs, the latter being very helpful. Eventually I got it working whenever I brought up the interface in the Networing app, but it would take a very long time, and would never work at bootup. From those docs, I added the following to /etc/network/interfaces:
auto eth1 iface eth1 inet dhcp pre-up ifconfig eth1 up pre-up iwconfig eth1 rate 11M pre-up iwconfig eth1 ap any wireless-essid myssid
I rebooted and voila, Airport works! No more PC card needed. Everything, even sound, was working. But after using Ubuntu for some time on the Mac, I realized a big annoyance...
I realized early that Ubuntu is not very usable with a 1-button mousepad. After some searching I found out that F12 (or maybe it was F11, it's not working now) was mapped to right-click. WTF, there is no way in hell I'm using any F key for right-clicking. In OS X I can do it by ctrl-clicking, so I should be able to do it in Linux too. I came across this posting about installing mouseemu. I did so, and added to /etc/default/mouseemu:
MID_CLICK="-middle 125 272" # Command key + mouse click RIGHT_CLICK="-right 29 272" # Control key + mouse click
Once I did that and restarted mouseemu (sudo /etc/init.d/mouseemu stop/start), I was able to right-click with ctrl-click. Yay! But then after realizing that I have to use Alt-Tab instead of Command-Tab to switch windows, I was annoyed further because the Alt key on the Mac is proven to increase the risk of arthritis and why the hell do I have to remember a different keystroke for Linux when Command-Tab works in OS X?
I found somewhere on the web that xmodmap can be used for this. I created a ~/.xmodmap file that contained:
keycode 115 = Alt_L
One thing very cool is Ubuntu will notice your .xmodmap and ask you to load it on next startup. There was some discussion on whether to use .xmodmaprc, or .Xmodmaprc, or .Xmodmap, or .muhahhayouWillneverFigureitOutrc. But I will tell you .xmodmap works
.
After booting back and forth between OS X and Linux, I realized that the boot manager was defaulting to Linux. I didn't want that. I wanted OS X by default. Such began my journey into yaboot, the LILO for Mac's.
It was a short journey. I edited /etc/yaboot.conf and added after the macosx= line:
defaultos=macosx
This is described in 'man yaboot.conf'. I rebooted, but whaddaya know, it still booted into Linux by default. I was optimistically thinking this would be like GRUB, where I didn't have to run anything to update the boot sector. Turns out I need to run ybin, which copied my changes in. I didn't know what arguments to give, so being inspired by 'lilo', I just ran 'ybin.' That worked, and I was booting OS X by default. Yay.
Now I worked a bit more in Ubuntu and realized that I needed to copy some files off of my OS X partition (namely, my SSH config file).
I had no idea if OS X's HFS+ partition was supported in Linux. I found this document which states that it is, and the fs type is hfsplus. However, 'man mount' only shows hfs, not hfsplus. I stuck with hfsplus anyway. I found this post about a user mounting his partitions. All I wanted to do was copy a file, and I'd be pretty pissed if Linux screwed up my OS X partition accidentally. I decided to mount it read-only. But what's my OS X partition? I easily found that from the macosx= line in /etc/yaboot.conf, which was /fev/hda3. dev has been replaced with fev to protect the innocent. For some reason either my webhosting provider or blogging software won't let me post dev. I ran the following commands:
mkdir /tmp/mnt
mount -o ro -t hfsplus /fev/fda3 /tmp/mnt
cp my file
umount /tmp/mnt
At this point there are only a few things left that annoy me. The mouse sensitivity seems quite different from OS X. I tried adjusting the acceleration settings, but it still just seems wierd. My fan seems to be constantly running, and my guess is Linux is not as nice on the CPU as OS X. Finally, cutting and pasting with a 1-button mouse in Linux is a bitch. Why do I have to shift-ctrl-anything to copy text in Terminal anyway? Why can't I just select and have it auto-copy? Maybe there is a way, but I haven't figured it out yet. Maybe it is time for me to get a real mouse and keyboard.
The fn, ctrl, alt, and command keys on the Mac cause me no end of grief. I constantly forget which incantation to use to switch workspaces, switching firefox tabs, closing windows, closing firefox tabs, etc. But that's more of a rant towards the Powerbook keyboard in general. Also forget about Flash and other plugins, they are nonexistent for PowerPC Linux.
In general, it was a fun adventure to figure out how to do things and cool to have Linux on my Powerbook. It runs beautifully and I'm sure I'll be hacking on it for some time.
This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |