Linux, Ubuntu & A Powerbook G4

OK, before I continue I’ll warn you I haven’t completed this post. I will when I get round to it (a time consuming business is installing stuff not designed for what you are installing it on to) but hopefully some of the information will be useful to someone.

My set up is:

Apple Powerbook G4 | Machine Model PowerBook5,2 | Build 8L127

Which versions of Ubuntu work on my Powerbook G4?

I have drawn up this simple table to show which versions of Ubuntu I have had success with and which I have not. I plan to add my findings relating to wireless internet, bcm43xx, and other mods for keyboard and the like as soon as I have worked them out.

This is only for my specific machine. It may not be the same for you. For more reference, see here http://en.wikipedia.org/wiki/Comparison_of_Linux_distributions#Architecture_support and here http://en.wikipedia.org/wiki/Ubuntu_%28Linux_distribution%29#Releases

Version Code name Tested Conclusion
4.10 Warty Warthog   No   NA
5.04 Hoary Hedgehog   No   NA
5.10 Breezy Badger   No   NA
6.06 LTS Dapper Drake   Yes   Boots To GUI Desktop
 
6.10 Edgy Eft   Yes   Boots To GUI Desktop
7.04 Feisty Fawn   Yes   Boots To GUI Desktop
7.10 Gutsy Gibbon   Yes   Fails To Boot To GUI Desktop
8.04 LTS Hardy Heron[55]   No   NA

 

 

Problem Booting Powerbook G4 Using Ubuntu Live CD

I had trouble getting Ubuntu and Kubuntu 6.06, 6.10 and 7.04 on my Powerbook G4 to boot correctly using either of the two following suggested commands:

live

Or

live video=ofonly

After some reading I found this post at http://robrohan.com/2007/12/10/moving-from-mac-to-ubuntu/ which helped and on my Powerbook G4 (Machine Model PowerBook5,2) the following works well across all version to boot from the live CD:

live resolution=1024x768 vga=795

Of course I assume that this will work for any Powerbook G4, and in fact any machine as long as the resolution and vga values match those of your machine.

Error Messages - e.g

Booting then worked fine with 6.06, 6.10 and 7.04 (7.10 on a Powerbook G4 fails to boot completely - see here) and everything started fine, but I then got 9 pop-up alerts when I got to the desktop:

  • Sorry, the program “bonobo-activation-serve” closed unexpectedly.
  • Nautilus can’t be used now due to an unexpected error.
  • The panel encountered a problem while loading “OAFIID:GNOME_ClockAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_NotificationAreaAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_ShowDesktopAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_MixerAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_WorkspaceSwitcherAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_WindowListAplet”.
  • The panel encountered a problem while loading “OAFIID:GNOME_Panel_TrashAplet”.

ubuntu-7.04-feisty-fawn-powerbook-g4-screengrab-10

I tried versions 6.06 and 6.10 of both Ubuntu and Kubuntu but still had the same errors. After a lot of reading I found this post http://ubuntuforums.org/showthread.php?t=353378 which showed similar problems and then this post http://ubuntuforums.org/showthread.php?t=244685&highlight=hwclock which solved my problem completely. It turns out that if your internal battery is dead and /or your system clock has reset (my Powerbook had been turned off and not charging for nearly a year..), GNOME applications will not work correctly and display the errors I have been seeing.

This is relatively easy to solve, and I first tried:

date mmddhhmmyyyy

This works fine after logging out and loggin back in but of course this needs to be entered again after every time the computer is shut down. A more permanent solution I found in the second link is:

hwclock -w

date mmddhhmmyyyy

Finally, set the hardware clock again:

hwclock -w

This worked great for me and I have shut down, restarted and used my Powerbook both plugged in to mains power and from the battery with no more system clock problems. Many thanks to Ubuntu forum users Javahead and DirtDawg respectively.

Wireless Internet / Airport - Card BCM43xx

Curse this wireless card.

I have been following the instructions on https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx/Feisty after a fresh install of Feisty.

I could not for the life of me get wireless working, although I could connect my network and use WPA after following the above.

So I then tried step 4 of the above link (Configuration Of WPA) despite it telling me that I did not need to do this. I did it anyway and still nothing. Before at least I could see my network and connect to it by clicking on the network image on the top bar, but now there is no wireless network showing up. Hmm..

I then restarted, deleted the /etc/wpa_supplicant.conf file I had just created, deleted the following line I had added to /etc/network/interfaces:
auto ethX

iface ethX inet dhcp

wireless-essid <your accesspoints essid>

wpa-driver wextwpa-conf /etc/wpa_supplicant.conf

I then reinstalled the bcm43xx (I got from here http://packages.ubuntu.com/feisty/utils/bcm43xx-fwcutter) and wl_apsta-3.130.20.0.o (I got here http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o) then:

sudo modprobe bcm43xx
iwconfig
sudo iwlist ethX scan

Wireless worked. No restart, no log out. Interesting to note that when I have done this before, on typing

iwconfig

my Bit Rate has always been 1 Mb/s (despite trying to change this in /etc/interface/network as shown here) and my Nickname has always been the say as my network name (my ESSID).

I now get:

IEEE 802.11b/g ESSIS:”my network name” Nickname:”Broadcom 4306″

Mode:Managed Frequency=2.437 GHz Access Point: 00:15:E9:CF:BD:92

Bit Rate:11 Mb/s Tx-Power=15 dBm

RTS thr:off Fragment thr=off

Link Quality=58/100 Signal level=-65 dBm Noise level=-69dBm

Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:0

Tx excessive retries:0 Invalid misc:0 Missed beacon:0

On looking in /etc/network/interface, this is what I now have:

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet dhcp

auto eth1

iface eth1 inet dhcp

auto eth2

iface eth2 inet dhcpauto ath0

iface ath0 inet dhcpauto wlan0

iface wlan0 inet dhcp

Hmm… I have put nothing I have read to add in there, but did I have that bottom line before when I have tried this?

auto wlan0

iface wlan0 inet dhcp

I wish I could remember, maybe it would be of use.

Immediately the wireless started working I got a prompt to upgrade software which I am currently doing in the hope than when I restart I will still have wireless connection.

  • On Log out then Log In (no restart)I still have connection.
  • On restart I am back to where I was before. In the top bar network menu I can see my wireless network again, I am asked for a WPA key when I try to connect (this is right) but then my computer cannot connect to the network.

Frustrating.

My /etc/network/interface file is the same.

And on typing iwconfig, my data rate is back to 1 Mb/s, although my Nickname is still Broadcom 4306. Also, my Access Point is invalid

If i run iwconfig while connecting to the network (after entering WPA and while connecting) I get the results I had before.

Interesting…

But on reinstalling as I did before, nothing… This is frustrating. I don’t know how what happened before happened and is not now.

Not specifying a Network Name (ESSID) defaults you to wireless roaming.

If you choose wireless roaming you need to select the network (which shows up) from the top bar network icon.

If you don’t select a network, you get an access point but 1mb/s data rate and no internet connection. down gives you ifdown: interface eth1 not configured and up gives you Ignoring unknown interface eth1=eth1.

I then selected my wirelessnetwprk and entered my WPA password. The network seemed to connect and showed signal, but I have also tried entering false passwords, and these work too connecting in the same way. Datarate was first 11mb/s and access point is valid but then on trying firefox this dropped to 11mb/s and access point became invalid. Even after sudo ifdown eth1 sudo ifup eth1 which return ifdown: interface eth1 not configured and Ignoring unknown interface eth1=eth1 respectively still on 1mb/s.

If you choose static ip you get 11m after sudo ifdown eth1 sudo ifup eth1 but would not connect to internet and had no where to enter WPA.

Using DHCP showed an access point and 11M after sudo ifdown eth1 sudo ifup eth1 but would not connect to internet and had no where to enter WPA.

in etc/network/interfaces you need to have an entry :eth1 for sudo ifup eth1 to work.

you can’t do ifdown if ifup has not been done

just put nothing, it works!!

Ubuntu 7.10 & Mounting As Read-Write A Firewire Drive Formatted As HFS+ (Mac OS Extended) Journaled

Solution

1. Disable Journalling for the HFS+ drive you wish to mount.

To do this, with your drive connected in OS X Terminal type (replacing yourvolume with the correct drive name):

diskutil disableJournal /Volumes/yourvolume

2. Start Ubuntu, plug in your drive if you unplugged it and the drive will mount as Read-Write.

N.B Please read on to see why I recommend turning off journaling using terminal and not disc utility.

You can read more about what Journaling is here.

Background Information

Firewire Drives Formatted as HFS+ (Mac OS Extended) Journaled will not mount under Ubuntu 7.10 (see here). I find this odd because I have my single internal hard drive partitioned into 3 (1 ext3 for Ubuntu, 1 HFS+J for OSX and 1 HFS+J for storage) and running Ubuntu I can mount both of these drives with no problems, but a HFS+J Firewire drive will not mount.

Fortunately if the drive is formatted as pretty much anything else it will mount under Ubuntu 7.10. This includes HFS+(Mac OS Extended) Non Journaled. I moved everything over to another drive, reformatted the drive as non journaled. Of course on reading this I found I could have just turned journaling off in the file menu of OSX Disc Utility without formatting my drive and moving my data all over the place. Oh well.

This worked fine and my drive mounted as rw allowing me to read files and save a file to the drive.

However after this initial spell of success the drive became read only. Going back to here “the driver will refuse to mount the filesystem read/write if it was not cleanly unmounted” and then looking here “If it ever occurs where your system is locked up and you have to force reboot, then the HFSplus disk will not be cleanly unmounted” and I did indeed restart my machine.

So my next step was to check the drive using OSX, repair permissions, turn on then off journalling then try the drive on Ubuntu again. If that doesn’t work, I’ll follow the information here to do this in Ubuntu.

As the instructions indicate, there is some kind of error with Disk Utility under OSX whereby being able to enable and disable journalling does not work correctly. I could turn journalling on but not off but using the following command in terminal in OSX works (and can be seen to work in Disk Utility if you have it open):

diskutil disableJournal /Volumes/yourvolume

N.B The command is spelt wrong (diskuilt instead of diskutil) on the instruction pages refered to above here so don’t copy it.

The drive then mounted as rw in Ubuntu (I started up with the drive plugged in) - I could read, write and delete files. I then right clicked the drive, unmounted it and restarted. The drive again worked fine as rw. I then restarted without first unmounting the drive. This also worked fine. This is good news as under normal conditions the drive seems to mount as rw fine. I think the disk check at start up may cause problems as I went through one. I should induce that again to check, but for now I’m running my script at last.

I wanted to do all this because I have been trying for some time to run a duplicate removal script on my drive which uses the uniq command with the -w flag. This is not included in Darwin bash on OSX and I don’t have enough experience to port the script over which effectively forces me to work out how to read/write this drive on Ubuntu. Needless to say I have had many obsticals; more here (when i write it).

Linux, Ubuntu 7.10 (Gutsy Gibbon) & A Macbook Pro

Ubuntu 7.10 on a 15″ Powerbook G4 was not so easy to get working, but it was possible. Based on this and that Jay has had 7.10 running on his 1st Generation (Core Duo, not Core Duo 2) Macbook for a few weeks with no problems other than a few key modifications and the brightness keys not working (the volume keys do) I reasoned that as my Macbook Pro also uses the same Intel processor architecture (i386) running 7.10 should present no problems. I was mistaken, but the problems I have had so far can be solved. Here are the solutions I used to solve my problems; hopefully they will also help others.

Installing

I originally used the regular 7.10 install disc (here) which worked OK, but I wanted to look at all the options on install so I used the 7.10 Alternate disc (here).

From previously installing different version of Ubuntu on other machines I know that if you install with your ethernet cable connected (so your computer can access the internet) a number of updates are downloaded on install. Not downloading these on install seems to create more problems that it is worth so I would recommend installing with an internet connection.

When you boot the disc (hold C at startup) you a presented with a series of option screens. Most things are self explanatory. I would recommend choosing your keyboard from the list and not pressing keys to define it - I had to go and change this in System > Preferences > Keyboard to Macintosh as it set me up with a universal keyboard layout which was a bit odd. I was also able to select my screen size of 1440 x 900. Installation ran smoothly and on restart I entered my username and password and I’m straight to the desktop.

Updates

On reaching the desktop I was presented with a prompt to install updates. This obviously only happens if you have an internet connection, so keeping your ethernet cable plugged in is also advantageous here.

Ubuntu 7.10 Macbook Pro 15

I was also prompted to install restricted drivers from ATI for my display which I did. After each install, I was prompted to restart but first I navigated to System > Administration > Software Sources to tick the appropriate boxes thus ensuring all software was available to me (On default all the correct things seem to be ticked which is why I was prompted to download restricted drivers - good stuff). I then opened System > Administration > Update Manager and clicked ‘Check’ to scan for any new software not picked up at first. I got told my system is up to date, so I restarted.

On restart I now have a much crisper display, so the ATI drivers seem to have worked well.
No Wireless Networking

UPDATE 30/04/08

This works fine with 8.04 Hardy Heron.

A glaring problem was that I had no wireless connection. I could not select other than wired network, so I had a search and came up with this great tutorial from http://ubuntu-tutorials.com

  1. sudo aptitude install build-essential
  2. wget -c http://snapshots.madwifi.org/madwifi-trunk-current.tar.gz
  3. tar -zxf madwifi-trunk-current.tar.gz
  4. cd ‘to the folder madwifi was unzipped to’
  5. make
  6. sudo make install
  7. sudo modprobe ath_pci
  8. sudo modprobe wlan_scan_sta

Run all that through terminal and you’re sorted.
Thanks to Christer Edwards of http://ubuntu-tutorials.com and Madwifi for this.
No Sound

This was a bit more of a problem and took a frustrating day of trying various reported solutions and having assorted documented problems along the way, but I now have sound working correctly:

  • Sound out of speakers
  • Sound out of line out
  • Sound using headphones
  • Pluging in line out turns off speakers
  • Volume controlled from keyboard and/or internal mixer slider

N.B. I haven’t tested the microphone or line in yet and to be honest I don’t really need them so I probably won’t worry about them. I should test them though and post it up here…

Sound in, either microphone or line in does not work.

To get all this working I first followed the tutorial in the official Ubuntu wiki here and that failed. I was able to download the drivers and kernal for ALSA, but on running ./hgcompile I got a load of files and folders not found and permission denied errors. I tried various different approaches but there seems to be some problem with either the download source, the tutorial or both so I abandoned this approach.

I then found this post in the Ubuntu user forums which was a great help (as the Ubuntu user forums increasing are to me). In this post, there are a number of ways to sort out your sound. I tried them all and had no success until I compiled the ALSA drivers from source. To do this, you need to know what sound card you have so you can install the correct drivers. Things are made a bit more difficult because the 15″ Macbook Pros apparently uses different soundcards and drivers to pretty much every other mac.

To get the information needed, in terminal type:

lspci -v

This will bring up a big list of devices. Near the top should be your soundcard. I have the following:

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
Subsystem: Sigmatel Unknown device 7680
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at 50400000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>

Go to http://www.alsa-project.org and navigate to ‘Soundcards’. Here you can choose the vendor based on what lspci -v returned. In my case I chose Intel which led me to this page where you can choose your specific driver. As my card is part of the ICH7 family and a High-Definition Audio controller (HDA) as shown by lspci -v, I chose ‘ICH southbridge HD-audio and modem’ and clicked ‘Details’ to view the driver documentation. At the top of this page is the driver name that you need. In my case it is snd-hda-intel.

Now you know the specific driver you need for your soundcard the following method should work (It did for me):

  1. sudo apt-get install build-essential linux-headers-$(uname -r) module-assistant alsa-source
  2. sudo dpkg-reconfigure alsa-source
  3. At the blue dialog box answer yes (for ISA-PNP - recommended by package maintainers), then yes again (for debugging - recommended by package maintainers).
  4. Select which driver you want to install. In my case, I deselected ‘all’ then selected ‘hda-intel’.
  5. sudo module-assistant a-i alsa-source

You a presented with a progress bar while the nessarcary files are transfered.

6. Once this is complete, enter the following to reload the driver:

sudo modprobe snd-hda-intel

7. To ensure the driver is loaded when you turn on your computer add snd-hda-intel (or what ever your driver name is) to the bottom of this file:

/etc/modules

After all this, restart and sound should be all working fine. If not, double click the speaker icon at the top right of the screen, select Edit > Preferences and ensure that PCM is selected and the volume is up.

ALSA Volume Control Preferences Ubuntu 7.10 Macbook Pro 15

To get your volume slider working with this ensure that PCM is selected in Volume Control Preferences which can be reached by right clicking on the speaker icon at the top right of the screen and selecting Preferences.

ALSA Volume Control Preferences Ubuntu 7.10 Macbook Pro 15

To get the volume keys working, ensure Main Menu -> System > Preferences > Sound Preferences has PCM selected.

Ubuntu 7.10 Macbook Pro 15

This all worked fine for me with no distortion and I can happily listen to all my music now. Buzzin.

Keyboard Layout / Right Click

I want the ctrl key when combined with a single mouse click to be right click. I am frustrated that I either have to use an external mouse or set Preferences > Mouse > Touchpad to ‘tap to click’ so I can use three finger right clicks. In doing this, single finger taps are left clicks and this is annoying when trying to select things - windows change, text gets selected. Blah. It is also annoying that backspace is backspace but ctrl or alt or apple keys and backspace are not delete. Grrrr. Need a way to combine multiple button/mouse presses into a single command. I need to learn more about keymodmaps.

As a temporary solution which is working fine for me so I might not change I followed this Ubuntu help document for installing Ubuntu on a Macbook Pro and remapped my key as follows:

First go to > System > Preferences > Keyboard, and click on ‘Accessibility’ button. check ‘Enable keyboard accessibility features’ and then go to ‘Mouse keys’ tab and check ‘Enable Mouse Keys’ and hit ‘Close’ button.

Then create a text file as ~/.xmodmap containing the following text (Note: This sets Right Apple key as Right mouse click and Left Enter Key as Alt Gr key)

keycode 116 = Pointer_Button3
keycode 108 = ISO_Level3_Shift

Add a call to xmodmap to your startup applications (System > Preferences > Sessions) [example]:

xmodmap /home/yourusername/.xmodmap

Restart X (Ctrl+Alt+Backspace) for the changes to take effect.

This worked great for me. Interestingly enough I have just installed jUploader (a Flickr uploader for Linux) and in this program I can press ctrl and click and this has the same function as pressing the right apple key, which is set to be right click. Hmmmm….