Post details: Ubuntu on my Powerbook

08/20/06

Permalink 10:52:37 am, Categories: Ubuntu, Apple, 1791 words   English (US)

Ubuntu on my Powerbook

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.

Obstacle #1: try to boot my backup drive via USB

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.

Obstacle #2: getting Airport to work

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...

Obstacle #3: How the fuck do I right-click?

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?

Obstacle #4: Swapping Alt with Command key

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.

Obstacle #5: boot OS X by default damnit

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).

Obstacle #6: Accessing my OS X partition from Linux

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.

Comments, Pingbacks:

Comment from: johnny [Visitor]
Thanks for writing this, I've been thinking of putting Ubuntu on my iBook.
Permalink 08/20/06 @ 18:51
Comment from: Anshul [Visitor] · http://yavin4.anshul.info/
You've given me courage to do this myself now :) are you ok with the speed on the g4? The last time I tried installing Kubuntu on a PB (5.10 I think) it was quite slow. Also, does sleep work?
Permalink 09/14/06 @ 10:32
Comment from: Rob Randall [Visitor]
I left this on the Ubuntu forums, but no luck getting an answer.

I've tried various ways of editing my xorg.conf file so that I can can install Ubuntu from the iso CD, but I cannot see any other size on my screen except for 640x480.

I've searched the forums and gotten some information from other users and changed and saved this file various ways to no avail. I want 1152x768. I'd like someone with a Powerbook (mine's a 667 G4) to post their xorg.conf file so that I can mimic it and be able to see the Ubuntu install screen enough to install it.

I've had Gnome and KDE running on this Powerbook at various times, so I'm not completely stupid about Linux. Hopefully, this will get me going.

If anybody else has any other suggestions, please let me know.

Also, I have a free 5 Gig partition on my Powerbook that I formatted with Disk Utility. Can I just install Ubuntu on that or do I have to format it a certain way?

Thanks,

Any ideas here?
Permalink 10/11/06 @ 07:41
Comment from: Joona [Visitor] · http://joona.kuori.org/ubuntu-powerbook/
Here's few neat tricks for installing Ubuntu on powerbook: http://joona.kuori.org/ubuntu-powerbook/
Permalink 10/19/06 @ 15:14
Comment from: slaske [Visitor] · http://TUDEF.JEZZ.DK
Love ubuntu on my powerbook , in fact I have removed OS X entirely. Still have some issues with my powerbook thou , my keyboard backlight isnt working.. Let me know if you get that one working!

Permalink 10/30/06 @ 19:20
Comment from: slaske [Visitor] · http://dinglepik.dk
Have been looking at ubuntu and have gotten a lot of work done , look at the guides on the forum soon to be moved to dinglepik.dk - here is the forum url : http://tudef.jezz.dk/smf11rc3/index.php?PHPSESSID=0bb95c582c1587ed55a7aa0b69d1223f&board=13.0
Permalink 07/23/07 @ 11:32
Comment from: bazz [Visitor]
well... i tried ubuntu, but i din't like not having flash... i didn't make a partition i just installed ubuntu... now i can't install mac os, my apple hardware test cd can boot, by pressing alt when i turn on my notebook, but i can't load my rescue cd's... what should i do?
Permalink 11/14/07 @ 22:32
Comment from: Con [Visitor]
Hello,
I have a powerbook G4, and i just installed Feisty Fawn. I am having difficulties saving the interfaces file, because i dont have permission...can you please email me with help/tips/advice???
Permalink 04/19/08 @ 23:17
Comment from: Randy [Visitor] · http://apartment17.tumblr.com
Thanks for this very useful write up. This weekend I inherited a nearly dead powerbook 12" and decided to nurse it back to life and give ubuntu a try on it. Your tips for right clicking and reassigning keys were super helpful.
Permalink 06/30/08 @ 09:32
Comment from: rob [Visitor] · http://www.robloranger.ca
what keycode would i use if i wanted to set alt/option for right click instead?
Permalink 09/17/09 @ 09:49

Leave a comment:

 
 

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a

Viraj's Weblog

This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

August 2010
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 31          

Search

Categories


Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution