Fedora 8 + iBook G4. A Love Story.
Posted by notKlaatu , 04 March 2008 · 255 views
Fedora 8 + iBook G4. A Love Story. Installing Linux on your Mac?There are a few things to consider, most beyond the scope of this HOWTO....but let's talk distros. Ubuntu no longer releases for PowerPC, so the knee-jerk choice of Xubuntu PPC or something like that might not be a great choice. Let's face it; all support for PowerPC is pretty much going away, but there are a few distros still releasing for PPC. They are: Fedora, Yellow Dog (Fedora based), Debian, and Slackintosh. So if you're going to install Linux on your PowerPC Mac, you might think in terms of who's going to have stuff in their repositories for you, and who will be releasing updates over the course of the next year or so. And by that time, when all PPC support dies completely, you can go out and get one of them fancy new multi-core processor computers.Anyway, let's talk Fedora 8 on PowerPC (iBook G4 / 933 mhz / 1.1 gb RAM / 80 gb user-installed harddrive)The installation was straight-forward and simple, with only a few notes: I needed a Mac OS partition. Fedora will allow you to use a drive's "Free Space" to create a default partition scheme for the Fedora system.....but it's not free space until you wrench it free from Mac OS X. I figured the way to do this was to simply do a clean install of Mac OS X Tiger, called an "Erase and Install" by the Mac OS install disc. Interestingly, this does NOT erase the drive! After much experimentation, I learned that to really really erase the drive, one must FIRST boot off the installation DVD, navigate to the Utilities Menu > Disk Utilities. From the Disk Utilities, erase the volume in question. After you've erased it, partition it as desired. Designate one as a Mac OS X volume, and the other as FREE SPACE. MASTER BOOT RECORD The master boot record are the few kilobytes placed at the forefront of the physical drive which will give the user the power to boot into a particular partition on the drive. Apple's bootloader is accessed by holding down the OPTION key upon start-up. It will be familiar to anyone who has dual-booted between Mac OS X and Mac oS 9, or Mac OS X and Windows (apparently some people do this). You can use this bootloader, or you can use yaboot, which will be installed by the Fedora installation. Yaboot requires no special keys to be pressed and simply gives you the options to boot into Linux, Mac OS X, CDROM, and so on. INSTALLATION Fedora has an easy-to-understand graphical installer. The first few screens set the language, date, and time. Then it's onto partitioning the drive. As long as one partition of the drive has been designated as FREE SPACE, Fedora immediately recognizes the free space and suggests a partition scheme for its self. It also offers you the option of simply erasing the entire drive and installing itself as the sole OS, or to allow a custom partition scheme. Note that this partitioner — even the "custom" option — will NOT allow you to resize the Mac OS system if you have not already partitioned the drive yourself. It will ONLY see "free space". For example: I initially had an "erase and install" clean installation of Mac OS X on the drive. I'd stripped it down to a 2gb system; no extra printer drivers or fonts, just Mac OS X and X11. So I figured I should have about 68gb free on the drive. Not so! Only about 14gb were really "free space" and so when I went to install Fedora, I only had 14gb to play with. You MUST make a partition of FREE SPACE in order to maximize the room for your Fedora installation, or possibly switch to a terminal during Fedora installation and run cfdisk or some such command-line partitioning program...but let's keep it simple. Also, take note of what /dev/hda your Mac partition is called here. You will need to know it later. If you don't get the hda number, that's OK...but it's easier if you grab it now and write it down. For example, mine was /dev/hda3 After the drive has been partitioned with a fairly typical Linux partition scheme, Fedora then asks you to set up your Firewall (what services you'll allow IN), and configure SELinux, which is a security system, and to create a user account. Finally, you are asked what kind of programs you'd like installed; you have your choice of Office & Productivity, Software Dev, and Web Server. And then the installation begins. Because there are big software programs being installed, it will take longer than, for instance, a Mac OS X installation, which installs pretty much just an OS. So wait for it. After this was finished, I was taken to the Log-In? screen and I was in business. If you are dual booting, you can then boot off the Mac OS X installation disc and install the Mac OS X system on the Mac partition. The master boot record is untouched, and the Apple bootloader recognizes the Linux partition as a bootable option - complete with a Penguin icon. LEOPARD INSTALL 933mhz G4 technically will take a Leopard installation. But not if you have only 256mb RAM. Fedora 8, released around the same time as Leopard, installs without complaint. Kinda nice. USER ACCOUNT From what I can tell, this initial user account, just like in Ubuntu and Mac OS X is a hybrid User/Admin identity....so if a bad guy finds out your user password then the bad guy just found out your root password by default. So after I've installed and set up my system, I set up a second user that I'll use on an every day basis with a unique, non-administrative password. To do this, it's quite simple: go to the System Menu > Administration > Users and Groups. The control panel that comes up is self-explanatory. WIRELESS Airport Extreme cards use a Broadcom 43xx chipset, notorious for being incompatible with Linux. My iBook's Airport Extreme card was no exception. There is, luckily, a way around this problem. It's intense, but it can be done! My research into this problem suggested that I had to "flash" new firmware onto the Airport Card, which seemed a frightening prospect; could I ruin my card entirely? If the card didn't work with Linux, could I at least go back to Mac OS X and still use the card or would it then not work with Mac OS X either? Would I have to learn C and talk in binary? To fix the Airport Extreme card, one does NOT have to "flash" the card. One instead is extracting its firmware from the card and copying it to one's Linux system, thereby enabling Linux to talk to the card. It doesn't write any new code to the card, it doesn't ruin it, it doesn't really touch the card at all. The Airport Express will still work in Mac OS X.....and it will also work in Linux. I gathered a number of tutorials on the subject; the two most significant were from Yellow Dog Linux (now only a google cached page) and one from linuxwireless.org I also received quite a bit of help from linuxquestions.org and two blokes by the names of f_newton and hellork of the #fedora IRC channel on freenode.net Here is exactly what I did: 1. Whilst in Linux, discover the exact firmware version on the card in our system: $ lspci | grep -i broadcom Mine returned this: 0001:10:12.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03) 2. Now we have to go get the software that will go into the card and get a copy of its firmware for us. I don't know the legalities of this, but I know that the resulting file cannot be re-distributed or else Broadcom shareholders would, apparently, have hemorages. Why? no-one knows. berlios.de has the software you'll need. To complicate matters, there are two versions, so get both. To be safe, we'll get copies of all the different firmware options and just leave it up to the Linux kernel, smart as it is, to use the one it finds most appropriate. 3. Now we must compile the code so we can use the software to get the firmware. First extract the downloaded files: $ tar -jxf bcm43xx-fwcutter-006.tar.bz2 $ tar -jxf b43-fwcutter-008.tar.bz2 Second, compile the code: to compile the bcm43xx program: $ cd bcm43xx-fwcutter-006 $ make to compile the b43 program: $ cd b43-fwcutter-008 $ make These should result in lots of feedback code telling you that everything went well; if you see the word "error" or "failure" anywhere, it's a bad thing and you're doing something wrong. But if you're doing well, then you'll have a little program called bcm43xx-fwcutter in one folder and a program called b43-fwcutter in the other. Now you're ready to go steal some Broadcom code. 4. To get the Broadcom code, you'll need to mount the Mac OS partition into your Linux system. (If you don't have a Mac OS X partition then you'll need to go to some machine running Mac OS X with the exact same card and do a slight variation of what we're doing here. You'll get the idea of what's going on pretty quickly, I think.) Essentially all we're going to do here is go into the Mac system, located the firmware in its system, and copy it into /lib/firmware on our Linux system. Here is how to mount the Mac OS X partition: First we need to make a place for the Mac OS X partition to mount: $ cd /mnt $ mkdir macos Now, you need to know the device name of the Mac OS X partition. This is not always easy to find out, but it ought to be "hda" and some number. The way I ended up doing this was simply by trying this: $ mount /dev/hda1 /mnt/macos and if that didn't work, I tried mounting /dev/hda2...then I'd cd into /mnt/macos and look around; if there was nothing there, or at least nothing that was obviously my Mac partition, I would then try /dev/hda3, and so on. It turned out that hda3 was the correct device to mount for me. So now we can begin to steal code. $ ./bm43-fwcutter -w /lib/firmware/ /mnt/macosx/System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/AppleAirPort2 Note that each command is really on one line; it's just a really long command. And you'll want to get the older firmware just in case... $ ./bcm43xx-fwcutter -w /lib/firmware/ /mnt/macosx/System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/AppleAirPort2 This is a pretty quick process, and the end result is that you'll notice files in /lib/firmware by the names of b43, b43legacy, and a whole series of files starting with bcm43xx. 5. Now we should add drivers just in case they're not already in the distro we're using. They can be downloaded from: http://downloads.ope...80.53.0.tar.bz2 http://downloads.ope...ta-188.8.131.52.o You'll need to untar these and place the document called "wl_apsta-184.108.40.206.o" in the BOTH the b43-fwcutter-008 and the bcm43xx-fwcutter-006 folders. Place the document called "wl_apsta.o" in the b43-fwcutter-008 folder. 6. Do this as root: For bcm43xx: # bcm43xx-fwcutter -w /lib/firmware wl_apsta-3. 130.20.0.o For b43legacy: # b43-fwcutter -w /lib/firmware wl_apsta-220.127.116.11.o and for b43: b43-fwcutter -w /lib/firmware wl_apsta.o 7. You're done! The hard stuff, anyway... I rebooted my system so that the kernel would pick up on the new drivers. And when the system was back up, I discovered that, alas, I had no wireless connection. I had kind of expected this because all of my wireless configuration experience had been with Slackware, Debian, and Ubuntu...so the /etc folder was pretty foreign to me on a Red Hat system. But the troubleshooting tools are still the same, right? # /sbin/iwconfig revealed that there was an apparently active wireless device on something called wlan0, which sounded quite foreign to me...but certainly would make sense if that were my wireless card. However, try as I might, I could not get the thing to attach itself to my network. After much trial and error, I realized the problem was really with my network, in a way. Whatever WPA key my network was using just wasn't agreeing with what I was doing in iwconfig — it has to do with wpa_supplicant. Anyway, solutions were found having more to do with network configuration than with the card or drivers itself. No big deal. Just remember that while getting the card online, it certainly helps to have an OPEN network so that the security protocol you're using is not a variable! Don't waste 3 hours like me trying to figure out why your Airport Express Card isn't working only to find out later it's your choice of WPA key. Another invaluable troubleshooting tool was a simple $ dmesg | grep bcm and $ dmesg | grep b43 as well as, obviously: $ lsmod From all of this, I found out that in fact the modules HAD loaded upon reboot, so my iwconfig was not lying. There really was a card called wlan0 active and alive in my system. A sure-fire way to see if the card is sending out signals and receiving signals was to do this: Bring the card onto the network: # iwconfig wlan0 essid NameOfNetwork then scan the network: # /sbin/iwlist wlan0 scan ...which returns a LOT of data about the surrounding wireless environment — all the networks in range, signal-to-noise, etc. Very handy! Network Manager Applet Somewhere along the line, it struck me that I was doing everything the Slackware way, when I'd really kind of expected Fedora to have a more Ubuntu GUI kind of way of doing things. Not that I mind so much, but it was odd because Gnome is well known for its friendly graphic interface. Turns out that I didn't have the nm_applet enabled. The nm_applet is the "Network Manager" applet — a little icon that sits at the top of the screen and helps you find the list of networks around you, which one you'd like to join, and so on. To turn this on, go to the System Menu > Administration > Services and turn on the two nm_applet services there. You may have to prompt it to start in the terminal or a reboot, but the nm_applet will from then on appear in the top right corner of the screen and help you locate your networks without resorting to iwconfig and iwlist. Fedora And so my iBook G4 now happily is running Fedora, and already I've installed Blender and will soon enjoy a much more robust support for a much wider array of codecs than in Mac OS X. Say good-bye to transcoding! The only complaint I have is that I do now have as much RAM as I should have to run Fedora well. But I have ordered an upgrade and will soon be enjoying a faster system. All in all, I'm quite impressed so far with Fedora, and am happy to be running it. I'm also quite glad to have a small, portable machine like this iBook running Linux; taking my Sony Vaio out is OK, but the iBook is even smaller and lighter, so it's kind of nice to have it running a proper form of *nix with all the great software that comes along with it. Fedora 8 PPC - I applaud you! And the people over at Berlios — brilliant work for cracking the Broadcom code!!