iBooks Love Linux
Pages: 1, 2
Installing Debian
I won't document the ins and outs of a Debian install: they're described in detail in other places. I will describe, however, the quirks that are specific to the iBook.
Debian is often criticized as being difficult to set up. In part, this is due to the poor user interface at the package selection stage. My personal policy is to select as little as possible for installation during the install process, and install the software you need later. In particular, selecting the laptop-specific package isn't much use for the iBook, as it has a different style of power management and doesn't have any PCMCIA devices (even if you have an Airport card, it does not use PCMCIA).
The machine booted the first time with a Debian 2.2.x series kernel. One of my first steps was to install a 2.4.x series kernel (Debian PowerPC currently has 2.4.16). I then proceeded to try and configure as much as I could. I had read that to get the most from the iBook you needed to compile your own kernel, but I intended to see how far I could get with the standard kernel as provided in Debian.
I had no problems at all with the built-in ethernet port, screen,
USB ports, or CD-ROM drive. They all worked just fine. Even
configuring X Windows turned out to be easy enough: just run
dpkg-reconfigure xserver-xfree86 and answer the
questions.
Getting Airport to Take Off
Setting up the Airport wireless access was a little more difficult. For users accustomed to using wireless PCMCIA cards on Intel laptops, there are some differences. The main one is that there's no wireless.opts file that you can edit to set up your wireless network configuration, so when the machine enables the Airport card it can't find which network to join. I set up a simple workaround for this, after installing the wireless-tools package.
In /etc/network/interfaces, I added:
iface eth1 inet dhcp
pre-up /usr/local/bin/inet_wireless.sh eth1
And created the /usr/local/bin/init_wireless.sh script:
#!/bin/bash
IFACE=$1
iwconfig $IFACE nick MyMachineName mode Ad-Hoc
iwconfig $IFACE rate Auto
iwconfig $IFACE essid MyNetworkName
iwconfig $IFACE enc on
iwconfig $IFACE enc s:MyNetworkPassword
iwspy $IFACE 00:02:2D:02:9D:9D
It would be easy to adapt this script for your own needs, and indeed write some housekeeping scripts so you can easily change between wireless networks. Note that I run an ad-hoc network, rather than owning a base station. That iwspy line enables me to keep a log of the signal strength to the machine I'm using as a gateway to the rest of my network.
Support for the Airport can either be started manually, by
running modprobe airport as root, or by adding
airport into your /etc/modules file.
As soon as the Airport card worked I breathed a sigh of relief: the rest of the configuration could take place from the comfort of my armchair!
Installing a New Kernel
One major physical difference with the iBook is that the trackpad has only one button. To do the install, I plugged in a USB mouse to circumvent this problem. However, a more permanent solution needed to be found. Another issue was that I had no access to sound, either. Investigation on both of these scores led me to conclude that the time had come to compile a new kernel.
The hero of the PowerPC Mac Linux scene is Ben Herrenschmidt. He
maintains a version of the Linux kernel with all the latest toys in
it, as well as some other useful tools. I followed the directions
on his page to obtain a copy of his kernel. Compiling a new kernel
for Linux isn't really that scary, and it went without pain for me.
I was helped along the way by following the excellent instructions
at
iBookLinux.net. The only additional information I required to
enable sound I found in
a posting on iBookLinux, which showed me which options I
needed. I added i2c-core, i2c-keywest,
i2c-dev, soundcore,
dmasound_core and dmasound_pmac
lines to /etc/modules, rebooted, and was away.
Adding second and third mouse button emulation was quite simple. The latest "benh" kernel sets up an easy way to get Linux to interpret keyboard keys as mouse keys. I simply had to run these commands in order to make F10 work as the middle button and F11 as the right-hand button.
echo "1" > /proc/sys/dev/mac_hid/mouse_button_emulation
echo "68" > /proc/sys/dev/mac_hid/mouse_button2_keycode
echo "87" > /proc/sys/dev/mac_hid/mouse_button3_keycode
Every Silver Lining...
I got everything I've mentioned so far here done within 24 hours, even managing a little sleep. However, there was one fly in the ointment. According to all the newsgroup posts I'd read, there should be no problems using the iBook's internal modem. However, I had no joy.
Further scouring of newsgroups turned up the suspicion that Apple had recently changed to using a software modem inside the iBooks, as they had done recently with the PowerBooks. Repeating the steps one of the posters had gone through confirmed that I, too, had a software-based modem. Resourceful though the Linux community is, it's highly unlikely that a driver will emerge for this modem for some time, if at all.
This left me with an obvious problem, as a modem connection while travelling is important to me. A search of the Linux USB hardware compatibility charts turned up some likely options. I particularly liked the look of the Multi-Tech MultiMobileUSB modem, as it was tiny. It is also quite expensive, so I had a quick look through eBay. I managed to find that modem's bigger brother for a fraction of the price, and settled for that. It's still smaller than an average paperback book, so won't add too much to my luggage -- especially as it's USB bus-powered and doesn't need an external power adapter. The modem works fine with the iBook, using the "acm" driver.
Handy Toys
To get the best from owning your iBook, there are several useful packages you can install.
Power Management
The iBook uses a different power management architecture from PC laptops. Whereas PCs use "APM," iBooks use "PMU." I installed the pmud and pmud-utils packages from Debian. Power management controls what happens when you close your iBook lid in order to put it to sleep, and when to spin down the hard disk to save power. I was really happy with the way power management worked: sleep and resume were near instantaneous, and a lot more reliable than with my old Dell laptop.
Special Keys
The iBook has keys for adjusting the volume and screen brightness, as well as ejecting the CD. With a "benh" kernel install, the brightness keys worked but neither of the others did. Stefan Pfetzing has written a small program called ikeyd, that makes the other keys work as advertised with a minimum of pain for the user.
Hot Plugging
Since most of the devices I will plug into my iBook are USB-based, I don't want to be manually configuring all the kernel modules I need to drive these devices. Instead I installed the hotplug system. Hotplug implements plug-and-play, and loads the correct device drivers when you plug the devices in. This also keeps your /etc/modules file down to a short and manageable size.
So far, I've verified compatibility with a USB mouse, my Frontier NEX II MP3 player, Kodak DC3400 digital camera -- and all work just the same as with the PC.
The Verdict
Buying the iBook for its hardware alone turned out to be an excellent decision. It is, however, a big change for PC laptop users. There are no mouse, parallel, serial, or docking ports. Instead you get two USB ports, a Firewire port, a mini-VGA port for external monitor (adapter provided), and a speakers/headphone jack. The biggest difference is probably the lack of PCMCIA slots. This inevitably means that if you own any PCMCIA cards, this investment will be lost if you move to an iBook. This also puts you more at the mercy of whatever hardware Apple decides to put into the machine.
One of the iBook's best features is the screen, which is rock solid, bright, and very sharp. I was a little worried that such a small screen would be a problem, but my fears turned out to be unfounded, even at the maximum resolution of 1024x768 pixels. The keyboard is easy to type on, and feels satisfying to use. The sound through the built-in speakers works surprisingly well: a lot less tinnier than I had expected.
The iBook is very portable. Although not the world's lightest laptop, at just over 2kg it's eminently totable, and appears pretty rugged in its construction. It also runs at a pretty cool temperature, so you can use it resting on your legs for prolonged periods. Putting the iBook to sleep by closing the lid works just fine, and waking it up again takes next to no time. Both Windows and Linux have problems doing this reliably on many PC laptops, so I was delighted to find how well it worked on the iBook.
Visually, the iBook is a winner. It has some great little touches, such as the LED indicator on the power cord that shows whether the battery is being charged. The machine's simplicity is very appealing. With other PCs there's a trend to add many blinking lights and extra keys to the keyboard: Apple has chosen the minimalist route with great success. There are some cute surprises too: the first time I put the iBook to sleep, it was late at night and dark in my office. I nearly fell off my chair when I noticed the book "breathing in its sleep" with a little white light next to the lid clasp slowly pulsating.
There was one disappointment, however -- that Apple changed the modem inside the iBook to one that wouldn't work with Linux. As described above, I've got a remedy, but I'd love to see native support for the internal modem.
All in all, I'm exceedingly happy. The iBook feels, both inside and outside, as though it was designed to be a whole. It is a pleasure to work with: so much so, that I'm considering replacing the Windows PC on my home network with an iMac. Modem troubles aside, the iBook makes a fine platform for running Linux.
Edd Dumbill is co-chair of the O'Reilly Open Source Convention. He is also chair of the XTech web technology conference. Edd conceived and developed Expectnation, a hosted service for organizing and producing conferences. Edd has also been Managing Editor for XML.com, a Debian developer, and GNOME contributor. He writes a blog called Behind the Times.
Return to Mac DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 13 of 13.
-
Thank You!
2003-04-05 23:35:25 anonymous2 [Reply | View]
I would just like to thank you for this article. I just purchased a used bkueberry iBook (yes, one of the originals), and your article has been a great help to me. I was disappointed to learn that Slackware has no power PC distro, so I went ahead with debian, and aside from some wonky media issues (Bad scratched CD!) it has been going smoothly.
Thank you very much!
-
Trackpad driver with "zone" support?
2002-05-03 08:57:00 stevenkan [Reply | View]
Just curious--does a Linux trackpad driver exist that provides "tap zones" and "drag zones?"
i.e. I've used some trackpads (synaptics?) on Windows that allow the right edge of the trackpad to be used as a virtual scrollbar. And most support tap, double-tap, and tap-drag.
It'd be interesting to see the upper left/right corners be implemented as left/right mouse clicks, or something similar (and, no doubt, infinitely customizable).
-
Early Adopter
2002-04-25 21:30:10 johnthughes [Reply | View]
I got in on the iBook2 when it first came out(~may of 2001), with the sole puprose of running Linux on it. I have been using linux in various forms since just before the 2.0 kernels....so, grain of salt, I am use to having to tinker. I knew that it would be work...and it was. A lot of stuff wasnt supported....I spent a great deal of time pestering the heck out of people like BenH to figure out what was just my fault...and what was really just not supported. All that being said....That was a Year ago. Linux on the iBook2 is really an amazing thing now. I have since rebuilt the whole laptop to Debian(from Yellow Dog) and it couldnt have been easier(grain of salt again. I woouldn't necesarily expect my Mom to do it, but if you have some decent Linux xperience...should be no problem). Addressing some of the comments:
Kernel Builds:
First, this ain't your fathers x86 machine. You better be darn familiar with building a kernel in the first place before you go blindly trying to compile a ppc kernel. Does it mean you shouldn't? No, just follow the how-to's pointed out by the article till you are familiar with your piece of hardware and the ppc kernel.
Expandability:
the iBook2 I bought has bouilt in USB, Firewire, 10/100 ehternet, Airport, VGA out, cdrom, cd-r, cdr-w, dvd, modem(hardware). What else am I gonna need?? Ok, I added a 512mb dimm and a 30gb hd. The ram took about all of 2 minutes...and 90 seconds of that was figuring out how the 3rd hook of the keyboard came loose. The Hard drive...well, that wasn't fun. ok, in fact it was horrible, but only cause I didn't print out one of the 3 million how-to's on the net before hand(and that stupid snap on bottom plate, argh!). Not like a Apple dealer couldnt do it for you for a few bucks.
Ram: I got Ram off the net.....had to wait 6 weeks before it was available. I havent had a problem with it ever....and it ain't Mac OEM ram. Just ram from a decent name dealer(think I found it on www.dealnews.com).
Do I have any complaints? Sure. One. Flash support is pretty much non-existent. thats it. I could complain about the battery life...but it lasts 4-5 hours at a go...and batteries them selves are only about a $100 so having two ins't a hardship. Not much else to say other than....its a great fit. Apple Hardware and Linux.
John
john@fallenbit.com
-
Open Firmware
2002-04-19 19:05:33 renduy [Reply | View]
Funny your mentioning Open Firmware "reminded me of the boot managers of Sun Sparc workstations," because it is!
A quick google search http://www.google.com/search?hl=en&q=open+firmware will give you more than enough info.
http://playground.sun.com/1275/ (IEEE 1275)
Macs have been using Open Firmware since they moved to PCI hardware (PowerMac 7500, etc)
-
Installing debian not as smooth as it sounds..
2002-04-16 12:47:01 raarts [Reply | View]
Even worse, I *did* manage to install it, but no kernel I compiled myself wil boot reliably on my brandnew iBook 14". Sometimes it does, and sometimes it doesn't. And if it does it totally screws up my keyboard. Originally I was very happy but I'm dead stuck now. My iBook does not love linux. (BTW not only Debian failed on it, so did Yellow Dog Linux).
-
One snag: external monitors
2002-04-10 14:46:13 Edd Dumbill |
[Reply | View]
A further update: unfortunately the external monitor output doesn't work properly yet under Linux. I used the "m3mirror" program, which can switch the CRT output on OK.
Unfortunately there's an issue with the sync on the signal, which means the picture is unusably wobbly. So, if you intend to use an external monitor for say, projecting slides, you'll have to do that bit in MacOS X.
-
DVD update
2002-04-09 08:34:06 Edd Dumbill |
[Reply | View]
Just to confirm that the DVD drive works fine. I was able to play DVDs with the "ogle" DVD player.
-
Why not run XDarwin with Gnome?
2002-04-09 08:26:11 ajohnson99 [Reply | View]
I'm amazed that you were able to get Linux running on an iBook.
But what were the reasons you didn't just run XDarwin with Gnome under OSX? I just downloaded and installed XonX and fink to get Gnome running on my iMac G4. Are there programs you need to run that aren't available for OSX yet? -
Why not run XDarwin with Gnome?
2002-04-10 00:49:26 Edd Dumbill |
[Reply | View]
I think the opening section answers your question adequately: Debian GNU/Linux is my OS of choice. I have multiple machines on my network, and I want the same OS irrespective of the underlying hardware.
-
iBook is good 'as is' but what about expandability?
2002-04-02 23:55:48 eliasbiris [Reply | View]
I have also been an owner of an Apple iBook 2001(aka icebook) similar to the one mentioned in the article. I ran SuSE Linux on it while I had it. Great distro, easy installation, and knowledge-base support for any issues.
While I do not disagree with the article itself, I should mention a couple of non-linux related issues from my experience:
My verdict is that the iBook is a good solution 'as is' if you do not plan to manually expand it in any way. The only 'easy' thing that you can change on your own is memory, and for that you have to dig quite a bit under the keyboard. Other components, notably the HD, are almost out of reach unless you really know what you are doing...
So for any new components (apart from memory), and to avoid voiding your warranty, you must ask for support by official Apple engineers, and to accept whatever HW Apple supports (you cannot add *any* HD or RAM modules for instance). This kind of dependability proved the reason that I got the iBook returned after 5 months, getting a refund.
On this support aspect you should also be aware that quality of Apple support varies from country to country. In the UK, where I am, it was the worst nightmare: the machine went to Apple in perfect order but came back within 3 months (!) after the initial 'check-in' with Apple and horribly deformed (surface was scratched beyond expectation). A single case? I am not so sure about that. Check local newsgroups before making any move to get the iBook, no matter how 'sweet' is the pill that they offer. -
iBook is good 'as is' but what about expandability?
2002-04-19 14:04:21 lally [Reply | View]
In defense of my new favorite platform:
Firstly, it's about a 3 minute job to install new memory on an iBook. I added it to my TiBook in class while waiting for the teacher to start his lesson! (and he wasn't late).
Secondly, adding other upgrades (like the disk, etc), won't void your warranty unless it's actually your fault. Apple support is pretty cool in this regard. For example, if your LCD dies, it's covered under warranty even if you've replaced your HDD.
But, my experiences with Apple are from the US, so YMMV. -
iBook is good 'as is' but what about expandability?
2002-04-03 12:21:59 Edd Dumbill |
[Reply | View]
Thanks for the heads-up and your support experiences. I agree that expandability isn't its prime asset (is it for any laptop?), but neither is it a prime concern for me as I do not use the laptop as my main machine. I might add that I never had cause to go inside my old Dell laptop apart from to fit memory either. Linux has a way of extending the life of hardware...
I can't personally think of any way to fill the 30GB HD as it is, apart from video stuff, which I'd be tempted to buy an external Firewire HD for anyway.
Perhaps the best thing I can do is promise to come back and write a followup one year down the line...
-- Edd







I've followed various guides and how-tos but allways seem to hit some problem or another that cannot be fixed.
Currently it's the appletalk services with debian, i hit a kernel panic when they load up, I'm heading back to the package selection to see if I can remove them...
This is getting really frustrating :\.