Installing Debian GNU/Linux 3.1 on iBook G4 1GHz 12"

Introduction

Worldwide, it seems to be popular to use Debian GNU/Linux on an Apple iBook. It should be possible to use iBook in Japan as well, so please try if you want to try. (This document was initially targeted for Japanese audience.) However, please note that iBook is not particularly tailored for Debian GNU/Linux and thus does have some glitches and limitations.

This is a memo on installing Debian GNU/Linux on iBook G4 1GHz 12" model. I bought this machine on August 2004.

Initial Install

With Debian GNU/Linux 3.0 (woody) installer, ATA100 controller cannot be recognized, and internal HDD of the iBook is not recognized.

It should be fixed in 3.1 (sarge).

I used Ethan Benson's powermac xfs ISO images that I found on the net for the initial installation. It is a modified Debian 3.0 install disk to make it work with modern iBooks and PowerBooks.

For partitioning of disks, I followed Branden's orders faithfully. I have configured as a dual-boot for MacOSX and debian GNU/Linux.

mac-fdisk is used for partitioning disks. example usage:

As a result of the sequence, the following is obtained:

# mac-fdisk -l /dev/hda
/dev/hda
        #                    type name                 length   base     ( size )  system
/dev/hda1     Apple_partition_map Apple                    63 @ 1        ( 31.5k)  Partition map
/dev/hda2         Apple_Bootstrap bootstrap              1600 @ 64       (800.0k)  NewWorld bootblock
/dev/hda3         Apple_UNIX_SVR2 swap                1048576 @ 1664     (512.0M)  Linux swap
/dev/hda4         Apple_UNIX_SVR2 root               28927240 @ 1050240  ( 13.8G)  Linux native
/dev/hda5               Apple_HFS Apple_HFS_Untitled_3 28627624 @ 29977480 ( 13.7G)  HFS
/dev/hda6              Apple_Free                          16 @ 58605104 (  8.0k)  Free space

Block size=512, Number of Blocks=58605120
DeviceType=0x0, DeviceId=0x0

    

I had experienced that yaboot was not configured well when rebooting the system. Press down the 4 keys while booting: APPLE-Option-O-F to obtain OpenFirmware screen. There, enter the following command and hit return. Check your slice number for Apple_Bootstrap region to see if it should be hd:2.

      boot hd:2,yaboot
    

Problems I experienced

At initial install, video=ofonly option was required for proper display. After install, after changing to the latest kernel, video=radeonfb seems to work properly, and that was required for getting X working.

There is a kernel option to change the order of initializing internal ATA100 controller first. Debian 3.0 boot-floppies didn't have such option, but recent kernels seem to have that option enabled. Therefore, depending on the kernel you boot from, your internal disk may appear as hdc1, or hda1. It's a bit problematic when configuring yaboot.

yaboot configuration

yaboot information is written to the bootstrap partition. To update the information, /etc/yaboot.conf needs to be modified, and then ybin executed.

# ybin -v
ybin: Finding OpenFirmware device path to `/dev/hda2'...
ybin: Finding OpenFirmware device path to `/dev/hda5'...
ybin: Installing first stage bootstrap /usr/lib/yaboot/ofboot onto /dev/hda2...
ybin: Installing primary bootstrap /usr/lib/yaboot/yaboot onto /dev/hda2...
ybin: Installing /etc/yaboot.conf onto /dev/hda2...
ybin: Setting attributes on ofboot...
ybin: Setting attributes on yaboot...
ybin: Setting attributes on yaboot.conf...
ybin: Blessing /dev/hda2 with Holy Penguin Pee...
ybin: Updating OpenFirmware boot-device variable in nvram...
    

My /etc/yaboot.conf configuration looks like this:

## yaboot.conf generated by yabootconfig 1.0.7
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
## see also: /usr/share/doc/yaboot/examples for example configurations.
##
## For a dual-boot menu, add one or more of: 
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ

boot=/dev/hda2
device=/pci@f4000000/ata-6@d/disk@0:
partition=4
root=/dev/hda4
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

image=/vmlinux
	label=Linux
	read-only

image=/boot/vmlinux-2.4.23-newpmac
	label=Linux-2.4.23
	root=/dev/hdc4
	read-only

image=/boot/vmlinux-2.4.26-powerpc
	label=Linux-2.4.26
	root=/dev/hda4
	append="video=ofonly"
	read-only

image=/boot/vmlinux-2.6.8-powerpc
	root=/dev/hda4
	initrd=/boot/initrd.img-2.6.8-powerpc
	label=Linux-2.6.8
	append="video=radeonfb"
	read-only

macosx=/dev/hda5
    

Connecting iPod via ieee1394

[11:47:10]ibookg4:/mnt/ipod> df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hdc4     ext3    14236656   2105144  11408332  16% /
tmpfs        tmpfs      128132         0    128132   0% /dev/shm
/dev/sda3  hfsplus    14614656    498836  14115820   4% /mnt/ipod
[11:47:43]ibookg4:/mnt/ipod> ls -ln
drwxr--r--  1 1000 1000    2 2004-01-09 02:03 Calendars
drwxr--r--  1 1000 1000    5 2004-08-22 17:54 Contacts
-rw-r--r--  1   99   99 1024 2004-08-22 17:54 Desktop DB
-rw-r--r--  1   99   99    2 2004-08-22 17:53 Desktop DF
-rw-r--r--  1   99   99    0 2002-02-27 01:39 Icon?
drwxr--r--  1 1000 1000    4 2004-08-22 17:54 Notes
drwxrwxrwx  1   99   99    6 2004-08-17 09:11 iPod_Control
    

dmesg

ieee1394: Initialized config rom entry `ip1394'
ohci1394: $Rev: 1223 $ Ben Collins <bcollins@debian.org>
PCI: Enabling device 0002:02:0e.0 (0000 -> 0002)
ohci1394: fw-host0: Unexpected PCI resource length of 1000!
ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[40]  MMIO=[f5000000-f50007ff]  Max Packet=[2048]
sbp2: $Rev: 1219 $ Ben Collins <bcollins@debian.org>
ieee1394: Node added: ID:BUS[0-00:1023]  GUID[000a27000274f5b0]
ieee1394: Host added: ID:BUS[0-01:1023]  GUID[000d93fffe283848]
scsi0 : SCSI emulation for IEEE-1394 SBP-2 Devices
Disabled Privacy Extensions on device c0236790(lo)
PHY ID: 4061e4, addr: 0
ieee1394: sbp2: Logged into SBP-2 device
ieee1394: Node 0-00:1023: Max speed [S400] - Max payload [2048]
  Vendor: Apple     Model: iPod              Rev: 1.51
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 29297520 512-byte hdwr sectors (15000 MB)
sda: test WP failed, assume Write Enabled
sda: asking for cache data failed
sda: assuming drive cache: write through
 sda: [mac] sda1 sda2 sda3
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
    

Connecting USB audio

To use as musical environment, I connected USB audio "ONKYO WAVIO SE-U33G" to the iBook”„ As a preparation to using audio environment in Debian GNU/Linux, add the user to audio group.

# adduser dancer audio
$ id dancer
uid=1000(dancer) gid=1000(dancer) groups=29(audio),1000(dancer)
    

For USB and sound related things, the following kernel modules are probably required. snd-powermac is for internal MAC soundcard. snd-usb-audio is read after that. I have written these to /etc/modules.

ehci-hcd
ohci-hcd
snd-powermac
snd-usb-audio
    

Checking the result is as follows. I have verified that I can play back without problems. I can also record without problems (ecasound 2.3.5, sweep).

$ cat /proc/asound/cards
0 [Snapper        ]: PMac Snapper - PowerMac Snapper
                     PowerMac Snapper (Dev 38) Sub-frame 0
1 [Device         ]: USB-Audio - KC USB Audio Device
                     KC Technology, Inc. KC USB Audio Device at usb-0001:01:1b.0-1, full speed
    

cpufreqd

apt-get install cpufreqd

CPU speed is determined by whether AC power supply is connected or not. Default configuration works decently. The fillowing is how it looks like when I pull the cable out, and push it back in.

[12:25:17]ibookg4:/etc> cat /proc/cpuinfo
processor       : 0
cpu             : 7447A, altivec supported
clock           : 533MHz
revision        : 1.1 (pvr 8003 0101)
bogomips        : 530.43
machine         : PowerBook6,5
motherboard     : PowerBook6,5 MacRISC3 Power Macintosh
detected as     : 287 (iBook G4)
pmac flags      : 0000000a
L2 cache        : 512K unified
memory          : 256MB
pmac-generation : NewWorld
[12:25:20]ibookg4:/etc> cat /proc/cpuinfo
processor       : 0
cpu             : 7447A, altivec supported
clock           : 1066MHz
revision        : 1.1 (pvr 8003 0101)
bogomips        : 1060.86
machine         : PowerBook6,5
motherboard     : PowerBook6,5 MacRISC3 Power Macintosh
detected as     : 287 (iBook G4)
pmac flags      : 0000000a
L2 cache        : 512K unified
memory          : 256MB
pmac-generation : NewWorld
    

Viewing Flash(swf) in Mozilla

After installing swf-player it was possible to view swf files. Not perfect, but it is a start.

Performance

hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   836 MB in  2.00 seconds = 417.44 MB/sec
 Timing buffered disk reads:   72 MB in  3.00 seconds =  23.98 MB/sec
    

Kernel 2.6.8 rebuild required 30 minutes (533MHz). At 1GHz it took about 15 minutes.

real    15m33.498s
user    12m32.137s
sys     1m40.159s

real    27m13.857s
user    22m27.233s
sys     2m25.411s
    

fstab configs

Current fstab looks like the following. It has iPod mount-points. To supress temp files accessing the real disk, /tmp is set to tmpfs.

/dev/hda4	/		ext3	errors=remount-ro	0	1
/dev/hda3	none		swap	sw			0	0
proc		/proc		proc	defaults		0	0
/dev/fd0	/floppy		auto	user,noauto		0	0
/dev/cdrom	/cdrom		iso9660	ro,user,noauto		0	0
/dev/sda1	/mnt/scsi1	auto	rw,user,noauto
/dev/sda3	/mnt/ipod	hfsplus	rw,user,noauto
/tmp		/tmp		tmpfs	defaults		

    

Initially, because the device names changed from the time of installation, /dev/hdc3 was specified as the swap device instead of /dev/hda3, and swap device wasn't enabled.

Mac OS X disk can be mounted on linux as hfsplus filesystem. The command-line to use will look like: mount -t hfsplus -o ro /dev/hda5 /var/tmp/imac.

Bluetooth

I personally don't use any Bluetooth devices, but I received a mail from Des Johnston that he could use Bluetooth for GPRS communication. Below are some information he gave to me.

dmesg
Bluetooth: Core ver 2.6
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.3
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM ver 1.3
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
	
rfcomm (bluetooth serial) connect command
rfcomm connect 0  MY_PHONES_HW_ADDRESS
ppp connect script for a UK GPRS service provider
#!/bin/sh
/sbin/modprobe ppp_async
/usr/sbin/pppd usepeerdns debug lcp-echo-interval 50000 lcp-echo-failure 50000 connect '/usr/sbin/chat -v -f /etc/ppp/MY_CHAT_SCRIPT' -detach defaultroute user MY_USER_NAME noipdefault /dev/rfcomm0 115200
exit 0
	
chat script
"" "\d"
"" "ATE1"
"" ATZ
OK ATDT*99***1#
ABORT "NO CARRIER"
ABORT BUSY
ABORT "NO DIALTONE"
ABORT WAITING
TIMEOUT 60
CONNECT '\d\c'
	

Problems and restrictions

I will write about problems and restrictions, that I am not satisfied with, which I discovered after trying to use Debian GNU/Linux on iBook.

Currently (Sept 2004), internal wireless lan cannot be used.

I've not yet found a good way to use the projector with my ibook. (May 2005) My current workaround is booting ibook with the lid closed and projector connected; that will force openfirmware to use the projector as the only output; and X will continue to use that output. (Nov 2005).

When I hit the keys strongly, internal mouse responds and thinks it's been clicked. This is annoying. The situation improves if you specify trackpad nopad (powerpc-utils) from the command-line, which makes touches to the trackpad ignored.

I guess iBook may be small from world standards, it is large and heavy from a Japanese standard. It is actually larger and heavier than HP nc4000 that I am using, and the powr supply cable is rather big. If you need a small and light laptop PC, consider something like Panasonic's "Let's Note".

One cannot use PCMCIA cards. Recently (as of writing, Sept 2004) larger powerbooks started to have PCMCIA card support, which is a good news.

I sometimes feel "Why am I using Linux on this iBook?", several times a day. When I am using MacOSX, I feel "Why am I not using Linux?" several times a day. (At the time of writing, August 2004)

Notes on hardware configs

lspci(2.6.9):

0000:00:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 AGP
0000:00:10.0 VGA compatible controller: ATI Technologies Inc RV250 5c63 [Radeon Mobility 9200 M9+] (rev 01)
0001:10:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 PCI
0001:10:17.0 ff00: Apple Computer Inc. KeyLargo/Intrepid Mac I/O
0001:10:18.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:10:19.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:10:1a.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:10:1b.0 USB Controller: NEC Corporation USB (rev 43)
0001:10:1b.1 USB Controller: NEC Corporation USB (rev 43)
0001:10:1b.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
0002:20:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 Internal PCI
0002:20:0d.0 ff00: Apple Computer Inc. UniNorth/Intrepid ATA/100
0002:20:0e.0 FireWire (IEEE 1394): Apple Computer Inc. UniNorth 2 FireWire (rev 81)
0002:20:0f.0 Ethernet controller: Apple Computer Inc. UniNorth 2 GMAC (Sun GEM) (rev 80)
    

lspci (kernel 2.6.8)

ibookg4:~# lspci
0000:00:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 AGP
0000:00:10.0 VGA compatible controller: ATI Technologies Inc RV250 5c63 [Radeon Mobility 9200 M9+] (rev 01)
0001:01:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 PCI
0001:01:17.0 ff00: Apple Computer Inc. KeyLargo/Intrepid Mac I/O
0001:01:18.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:01:19.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:01:1a.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB
0001:01:1b.0 USB Controller: NEC Corporation USB (rev 43)
0001:01:1b.1 USB Controller: NEC Corporation USB (rev 43)
0001:01:1b.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
0002:02:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 Internal PCI
0002:02:0d.0 ff00: Apple Computer Inc. UniNorth/Intrepid ATA/100
0002:02:0e.0 FireWire (IEEE 1394): Apple Computer Inc. UniNorth 2 FireWire (rev 81)
0002:02:0f.0 Ethernet controller: Apple Computer Inc. UniNorth 2 GMAC (Sun GEM) (rev 80)

    

Playback of DVD/DivX

It is possible to play back movies in full screen using xine. However, when using 2.6.9 kernel, ALSA driver is slow, and it was necessary to use OSS emulation layer of ALSA from xine. There are apparently more problems with this kernel. 2.6.8 used to work fine.

Configuration Keyboard

APPLE key is in the location where ALT key is found. To assign the APPLE key as the ALT key, you can do the following. You may add this in to .xsession file.

      xmodmap -e "keycode 115 = Alt_L"
    

Underscore key was broken on my Japanese keyboard, I worked around with

      xmodmap -e "keycode 211 = underscore"
    

Suspend

Closing the lid suspends. Reopening resumes. Kernel 2.6.12. When USB devices are connected, it may not function after resume.

eth0: suspending, WakeOnLan disabled
radeonfb (0000:00:10.0): suspending to state: 3...
uninorth-agp: disabling AGP on device 0000:00:10.0
uninorth-agp: disabling AGP on bridge 0000:00:0b.0
radeonfb (0000:00:10.0): resuming from state: 3...
PCI: Enabling device 0000:00:10.0 (0000 -> 0003)
radeon: PAD_CTLR_STRENGTH doesn't stabilize !
agpgart: Putting AGP V2 device at 0000:00:0b.0 into 4x mode
agpgart: Putting AGP V2 device at 0000:00:10.0 into 4x mode
PCI: Enabling device 0001:10:1b.0 (0000 -> 0002)
PCI: Enabling device 0001:10:1b.1 (0000 -> 0002)
PCI: Enabling device 0001:10:1b.2 (0000 -> 0002)
ehci_hcd 0001:10:1b.2: park 0
ehci_hcd 0001:10:1b.2: USB 2.0 restarted, EHCI 1.00, driver 10 Dec 2004
eth0: resuming
PHY ID: 4061e4, addr: 0
hda: Enabling Ultra DMA 5
hdc: Enabling MultiWord DMA 2
adb: starting probe task...
adb devices: [2]: 2 c9 [3]: 3 1 [7]: 7 1f
ADB keyboard at 2, handler 1
ADB mouse at 3, handler set to 4 (trackpad)
adb: finished probe task...
agpgart: Putting AGP V2 device at 0000:00:0b.0 into 4x mode
agpgart: Putting AGP V2 device at 0000:00:10.0 into 4x mode
[drm] Loading R200 Microcode
    

oprofile

oprofile works in time mode. MPC7447A has a performance counter, and I created a patch to make it work for 2.6.14 kernel. Somebody else has already worked on it, so I suppose it should be merged somewhere in 2.6.16.

Links

Links in English/Francaise.

About OpenFirmware


Junichi Uekawa

$Id: ibookg4.html.en,v 1.19 2006/01/14 13:10:06 dancer Exp $