Installing Debian GNU/Linux on an Apple Ibook 2 Rev 10
This is an account of my installation of Debian on an ibook (600mhz)
Last Updated 14-02-03
Searched google and found a number of accounts on how to go about this. (Reference here)
Issues I have had.
Definitely need to install and compile the Benh kernel as that let me get my usb keyboard working. Was then able to switch consoles as on the mac keyboard I was unable to figure out which keys to use. It turns out that you have to press the function+Ctrl+Apple keys to switch consoles on the Ibook and even that seems a bit eratic. Often I seem to have to press the funcition+Ctrl+Alt-L key combination first before it will respond to the latter. (See www.hispalinux.es/~data/ibook/ for a map of the keyboard keys)
Getting the Kernel ref: hispanix
Download BenH kernel from rsync.penguinppc.org
rsync -avz rsync.penguinppc.org::linux-2.4-benh ../src-linux-2.4-benh
Getting the trackpad to work
I used gpm to get it working in the console. Tried mdetect to get it to detect what the mouse is as early ie 2000 stuff on the web that I found how to do it said to use /dev/adbmouse but there was an adb in /dev/ but no adbmouse and adb didn't work either.mdetect (apt-get install mdetect) showed that the mouse device was /dev/input/mouse0 but it wasnt' that device, although the mouse cursor did appear but wouldn't move. mdetect -x showed gave the protocol as imps2 which was correct. To find out which usb device the mouse was pointing to I tried cat /proc/input/mouse0 and when I moved the mouse there was no output to the screen so it wasn't that one. Then I tried cat /proc/input/mice and when I moved the mouse lots of crazy output to the screen so that was obviously the device. So to set up the trackpad to work using gpm in the console I used
gpm -m /dev/input/mice -t imps2 -Rraw
Used raw as the repeat protocol so that I could just point x to gpmdata. You should then run /usr/sbin/gpmConfig and add that info or edit /etc/gpm.conf directly.
Getting right clicking to work so I can copy from console to console or within a console using the mouse.
To get right and middle clicking you need to Configure 2 keys on the keyboard to represent the right and middle buttons on the mouse. I had a problem figuring out which keys were setup by default to use this until I found this great howto through the debian powerpc mailing list archives.
http://www.miketec.org/ibook/
To get the F10 key to be middleclick and the F11 key to be right click you need to run these the following commands:
#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
Getting the cd eject key to work
To get this to work you need to install the "ikeyd" package which will then let you use the F12 key on the ibooks keypad to eject the cdrom. The F12 key on my usb keyboard did not work as the CDROM eject however, just the laptop keyboard F12.
Getting X to work
When I first started x it failed and I also found that I was thrown back into a console that was really flickery and so dim that I could hardly read the text. I had to reboot to get the console back to normal as /etc/init.d/kdm stop had no effect.
Copied Mikes XF86Config-4 to /etc/X11/XF86Config-4
Before I tried starting X with that Config though I also downloaded the XF86Config-4 file that hispanliux recommended from http://ppc.linux.or.jp/%7Eipenguin/iBook2/XF86Config-4.iBook2. I made the one change that hispanlinux recommended which was to use "fbdev" instead of "r128".
I then installed the required packages and followed the instructions from hispalinux's website.
# apt-get install xlibmesa3-dri-trunk xserver-xfree86-dri-trunk
and the kernel-headers-2.4.20-powerpc-xfs headers which would let me compile the drm modules against the debian powerpc kernel. I had already rsync BenH kernel source and also installed the 2.4.20 source from Debian and the Benh kerenl patches from debian. I was interested in trying three different ways to see whether they would all work.
# sudo apt-get install kernel-headers-2.4.20-powerpc-xfs
Now to install drm module source and try and build it against the default debian 2.4.20 powerpc kernel.
# apt-get install drm-trunk-module-src
# cd /usr/src/
# tar zxvf drm-trunk.tar.gz
This creates a directory called modules which I renamed to another directory so I would know what it was related to
# mv modules modules_drm_trunk
# cd modules_drm_trunk/drm-trunk
Now to make the modules
# make -f Makefile.linux TREE=/usr/src/kernel-headers-2.4.20-powerpc-xfs/include/
# rmmod radeon
# rmmod agpgart
# modprobe agpgart
# insmod /usr/src/modules_drm_trunk/drm-trunk/radeon.o
I then downloaded hispalinux's latest XF86Config-4 file from here and then copied it to /etc/X11/XF86Config-4 after making sure that I had a backup on the original.
# mv /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.original
I them edited the file to set the keyboard settings to what I preffered rather that spanish.
# vim /etc/X11/XF86Config-4
Option "Device" "/dev/input/mice"
to
Option "Device" "/dev/gpmdata"
XkbLayout "es"
to
XkbLayout "us"
Ok I think I stilled need to some more on the keyboard as the layout was quite different from what I had originally had but I thought I would just give it a go and see what happened. I had upgraded to the latest xserver-xfree86 4.2 from Sid the night before and had also installed the latest kernel-image-2.4.20 and now when I tried to startx I would just get these crazy colors appear on the screen and then nothing else. When I switched back to the console I would then find that I could hardly see the writting. I had had this same problem when I initially installed this Ibook and had written down how I had fixed it. However now I couldn't remember how I did it and the only howto of mine I could find for installing debian on an Ibook stopped just as the notes started to cover the X configuration.
Tried starting X and found that I had the same problem, with this chaotic mess of colors beginning to cover my screen. This time however when I switched back to the console I found that although there was a lot of flicking like the refresh rate had suddenly slowed down, it was still bright enough for me to actually what I was doing.
I thought I would just check the yaboot.conf file of hispalinux and then have another look at the XF86Config file. The errors from the x startup was
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Fri Feb 14 13:20:58 2003
(==) Using config file: "/etc/X11/XF86Config-4"
(EE) RADEON(0): Failed to open framebuffer device, consult warnings and/or errors above for possible reasons
(you may have to look at the server log to see warnings)
(EE) RADEON(0): [dri] DRIScreenInit failed. Disabling DRI.
failed
Ok I thought it might be because I passed the option video=ofonly to the kernel at boot as this makes it use a generic framebuffeer device rather than the one that whitewashed my screen when I initially booted in the console when I first installed. Now it looks like it is not working in X because it can't find the framebuffer device.
The problem turned out to be that I hadn't run ybin after I had removed the "video=offonly" from the yaboot.conf file. I ran ybin changed the XF86Config-4 file to
Option "UseFBDev" "True"
Then I rebooted and made sure that I loaded the radeon module from the drm-trunk and then ran startx. This time X started fine and dri was working so at last I was able to use the 3D acceleration in the video card.
