Linux for PowerPC on iBook 的一些心得整理
安裝部份:
磁碟分割:
HOWTO: Resize your HFS+ partition for free
http://www.ubuntuforums.org/showthread.php?t=89960
FC5 下的 fdisk 在 Linux PPC 上是沒辦法用的
Ubuntu 6.06 下的 fdisk 是 link 到 mac-fdisk 的
SuSE 10.1 下則是用 pdisk
要裝 Linux 需要三種分割區:
1.Apple Bootstrap 分割區
要有一個 800Kb 以上的 Apple_Bootstrap 分割區
且要在 MacOS 的分割區(hfs+)之前
格式化指令:
mkofboot -b /dev/hda2
2.Swap 分割區
格式化指令:
mkswap /dev/hda8
3.Ext3 分割區
格式化指令:
mke2fs -j /dev/hda4
mke2fs -j /dev/hda5
mke2fs -j /dev/hda6
mke2fs -j /dev/hda7
我的 iBook 總共割了 7 個分割區,如下:
[root@ibook:~] fdisk -l
/dev/hda
# type name length base ( size ) system
/dev/hda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/hda2 Apple_Bootstrap Boot 1954 @ 64 (977.0k) NewWorld bootblock
/dev/hda3 Apple_HFS Mac 58593751 @ 2018 ( 27.9G) HFS
/dev/hda4 Apple_UNIX_SVR2 Ubuntu 19531251 @ 58595769 ( 9.3G) Linux native
/dev/hda5 Apple_UNIX_SVR2 FC 19531251 @ 78127020 ( 9.3G) Linux native
/dev/hda6 Apple_UNIX_SVR2 SuSE 16777216 @ 97658271 ( 8.0G) Linux native
/dev/hda7 Apple_UNIX_SVR2 Share 37959750 @ 114435487 ( 18.1G) Linux native
/dev/hda8 Apple_UNIX_SVR2 swap 3906251 @ 152395237 ( 1.9G) Linux swap
Block size=512, Number of Blocks=156301488
DeviceType=0x0, DeviceId=0x0
我總共裝了 MacOSX、Ubuntu Dapper 6.06、Fedora Core 5、SuSE 10.1 四個作業系統
/dev/hda7 是用來讓各種作業系統共享資料的分割區
安裝系統:
安裝的部份我就不做介紹了,下載安裝光碟,照著一步一步做,就可以順利安裝了
我是分別用 FC5 ppc DVD 版 及 SuSE 10.1 ppc 版 5 片 CD 來安裝的
而 Ubuntu 6.06 則是用 ppc 版的 Alternate CD 來安裝,因為我無法使用 Desktop CD 來進行安裝
檔案系統:
在 Ubuntu Dapper 6.06 下的 hfs+ 的支援是有問題的
無法寫入,要就升級或重編 Kernel
或是把 hfs+ 的 Journal Disabled 掉
到 Mac 底下:
cd /Volumes/ sudo diskutil disableJournal Tiger # Tiger 是我的 MacOSX Volume 名稱
若要再 Enable Journal 可以下底下的指令:
sudo diskutil enableJournal Tiger
開機選項:
因為我總共裝個四個作業系統,因此需要使用 yaboot 來管理多重開機的部份
可以利用 yabootconfig 指令來設定 yaboot
或是直接修改 yaboot.conf (我都直接修改)
[root@ibook:~] cat /etc/yaboot.conf
## yaboot.conf generated by the Ubuntu installer
##
## 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:
delay=5
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
enableofboot
enablenetboot
macosx=/dev/hda3
defaultos=linux
timeout=50
image=/boot/vmlinux
partition=4
root=/dev/hda4
label=Ubuntu
read-only
initrd=/boot/initrd.img
append="quiet splash"
image=/boot/vmlinuz-2.6.17-1.2157_FC5
partition=5
root=/dev/hda5
label=Fedora
read-only
initrd=/boot/initrd-2.6.17-1.2157_FC5.img
append="rhgb quiet root=/dev/hda5"
image=/boot/vmlinux
partition=6
root=/dev/hda6
label=SuSE
read-only
initrd=/boot/initrd
append=" quiet sysrq=1"
每次修改完後記得要再執行:
ybin -v
Ubuntu 跟 Fedora 都是使用 yaboot
反而 SuSE 比較奇怪,是使用 lilo 來設定的
[root@ibook:/etc] cat lilo.conf
# Modified by YaST2.
activate
timeout = 50
default = Ubuntu
boot = /dev/hda2
# Ubuntu
image=/Ubuntu/boot/vmlinux
root=/dev/hda4
label=Ubuntu
initrd=/Ubuntu/boot/initrd.img
append="quiet splash"
# FC
image=/FC/boot/vmlinuz-2.6.17-1.2157_FC5
root=/dev/hda5
label=Fedora
initrd=/FC/boot/initrd-2.6.17-1.2157_FC5.img
append="rhgb quiet root=/dev/hda5"
# SuSE
image=/boot/vmlinux
root=/dev/hda6
label=SuSE
initrd=/boot/initrd
append=" quiet sysrq=1"
# Mac OS X
other=/dev/hda3
label=MacOSX
另外,在安裝 Linux 之前,我是先把 Mac OS X 裝起來
否則,在安裝 Mac OS X 之後,會把 OpenFirmware 改掉,造成無法開機進入 Linux
解決方式:
先進到 OpenFirmware (同時按下 Command+Option+o+f)
> boot hd:4,yaboot
在進入 Linux 系統後,再執行 ybin 指令再寫到 OpenFirmware 中
硬體支援:
USB:
支援
kernel module: ohci_hcd ehci_hcd
Firewire:
支援
kernel module: ohci1394
Bluetooth:
支援
kernel module: bluetooth
我是使用 SMC BT-10 的藍芽棒,跟內建的 Bluetooth 模組用的是一樣的晶片
搭配羅技的藍芽滑鼠及跟我的 SonyEricsson W800i 手機透過藍芽傳送檔案都正常
Ethernet:
支援
kernel module: sungem
Wireless:
支援(但需要手動安裝 firmware)
kernel module: bcm43xx
需要 bcm43xx-firmware 才能正常使用
先安裝 bcm43xx-fwcutter 套件
apt-get install bcm43xx-fwcutter
然後利用 MacOSX 上的 Airport Driver 來取得 firmware
我是先把我的 MacOSX 的 Partition 掛載在 /Mac 目錄底下
fwcutter /Mac/System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/AppleAirPort2
sudo cp *.fw /lib/firmware/
接下來 modprobe bcm43xx 就可以用了
FC5 下 Airport Extreme 開機後啟動的問題
修改 /etc/sysconfig/modules/udev-stw.modules 把 bcm43xx 加進去:
#!/bin/sh
for i in nvram floppy bcm43xx parport_pc parport lp;do
modprobe $i >/dev/null 2>&1
done
Audio:
支援
kernel module: snd-powermac
若覺得音質不好或聲音不夠大聲,可到 Gnome 的音量控制程式去調整 “DRC Range” 來解決
FC5 下 音效卡開機後啟動的問題
一樣是修改 /etc/sysconfig/modules/udev-stw.modules 把 snd-powermac 加進去:
#!/bin/sh
for i in nvram floppy bcm43xx snd-powermac parport_pc parport lp;do
modprobe $i >/dev/null 2>&1
done
Keyboard Fn Key and Touchpad:
支援
使用 pbbuttonsd
可以利用 gtkpbbuttons 或 powerprefs 等程式來設定
或是直接修改 /etc/pbbuttonsd.conf 也可以
[root@ibook:~] cat /etc/pbbuttonsd.conf # Configuration file for pbbuttonsd >= version 0.5 # for options see man pbbuttonsd.conf [SYSTEM] #userallowed = "" ; user who is allowed to use IPC autorescan = no ; automatic rescan of event devices CmdTimeout = 8 ; timeout in seconds for launched scripts, etc. [MODULE PMAC] dev_PMU = "/dev/pmu" dev_ADB = "/dev/adb" TPModeUpKey = 225 + alt TPModeDownKey = 224 + alt TPMode = lock ; 'notap', 'tap', 'drag' or 'lock' KBDMode = fkeysfirst ; 'fkeyslast' or 'fkeysfirst' Batlog = none ; 'none', 'cycle' or 'log' NoTapTyping = no ; switch trackpad to 'notap-mode' while typing [MODULE POWERSAVE] onAC_Policy = performance ; 'nochange', 'powersave', 'custom' or 'performance' onAC_TimerAction = none ; 'none', 'suspend-to-ram', 'suspend-to-disk', 'blankscreen' or 'shutdown' onAC_CoverAction = none ; see TimerAction for possible values onAC_KeyAction = none ; Action (see TimerAction) for the sleepkey onAC_SuspendTime = 0 onAC_DimTime = 0 onBattery_Policy = powersave ; 'nochange', 'powersave', 'custom' or 'performance' onBattery_TimerAction = none ; 'none', 'suspend-to-ram', 'suspend-to-disk', 'blankscreen' or 'shutdown' onBattery_CoverAction = suspend-to-ram ; see TimerAction for possible values onBattery_KeyAction = none ; Action (see TimerAction) for the sleepkey onBattery_SuspendTime = 0 onBattery_DimTime = 0 SleepKey = 116 SleepKeyDelay = 0 ; values > 0 may be dangerous, if the power key is used to trigger sleep BWL_first = 22 ; first battery warnlevel, time in minutes BWL_second = 10 ; second battery warnlevel, time in minutes BWL_last = 3 ; last battery warnlevel, time in minutes Script_PMCS = "/etc/power/pmcs-pbbuttonsd %s %s %s" EmergencyAction = sleep ; action, if battery is critically low HeartbeatBeep = no ; beep, if nothing else showed that the computer lives CPULoad_sleeplock = yes CPULoad_min = 20 ; value in percent CPULoad_period = 20 ; time in seconds NETLoad_sleeplock = yes NETLoad_min = 4096 ; traffic in Bytes/s NETLoad_period = 20 ; time in seconds NETLoad_device = "eth0" [MODULE DISPLAY] LCD_Brightness = 15 ; initial LCD brightness level LCD_FadingSpeed = 5 ; 0 = no smooth fading LCD_AutoAdjust = yes ; only on Aluminum PowerBooks LCD_IllumUpKey = 225 LCD_IllumDownKey = 224 LCD_Threshold = 94 ; ambient light threshold in percent for backlight autoadj. LCD_AutoAdjMin_Bat = 2 ; autoadjustment range parameters LCD_AutoAdjMax_Bat = 7 LCD_AutoAdjMin_AC = 1 LCD_AutoAdjMax_AC = 15 KBD_Brightness = 0 ; initial keyboard illumination level KBD_OnBrightness = 5 ; initial level if KBD on/off key is pressed KBD_FadingSpeed = 5 ; 0 = no smooth fading KBD_AutoAdjust = yes ; only on Aluminum PowerBooks KBD_IllumUpKey = 230 KBD_IllumDownKey = 229 KBD_IllumOnKey = 228 KBD_Threshold = 28 ; ambient light threshold in percent for keyboard light autoadj. dev_FrameBuffer = "/dev/fb0" UseFBBlank = yes DimFullyDark = no CRT_MirrorKey = 65 + ctrl [MODULE CDROM] dev_CDROM = "/dev/cdrom" EjectCDKey = 161 EjectCDKeyDelay = 0 [MODULE MIXER] SoundSystem = ALSA ; 'none', 'auto', 'OSS' or 'ALSA' OSS_Device = "" OSS_Channels = "volume, speaker" Volume = 52 ; initial volume level Speakers_muted = no ; mute after startup? VolumeUpKey = 115 VolumeDownKey = 114 MuteKey = 113 MixerInitDelay = no ALSA_Card = "default" ALSA_Elements = "Master, 'PC Speaker'"
Touchpad 部份,在 FC5 底下是使用 apmud 而不是 pbbuttonsd
[root@ibook:~] cat /etc/sysconfig/trackpad # The following trackpad option gets run at startup # by /etc/init.d/trackpad. The available options are: # notap, tap, drag, lock TRACKPAD_OPT="lock"
Three Button Mouse Emulation:
支援
修改 /etc/sysctl.conf 加入:
dev.mac_hid.mouse_button_emulation=1 # fn + alt - 模擬右鍵 dev.mac_hid.mouse_button2_keycode = 97 # fn + ctrl - 模擬中鍵 dev.mac_hid.mouse_button3_keycode = 100 # 或是想要用 F11 來模擬右鍵 F12 來模擬中鍵 # F11 #dev.mac_hid.mouse_button2_keycode=87 # F12 #dev.mac_hid.mouse_button3_keycode=88
我是習慣用 fn + alt/ctrl 的方式
Alt_L 跟 Super_L (Command) 的設定:
[candyz@ibook:~] cat .Xmodmap clear mod1 clear mod4 add mod1 = Super_L Hyper_L add mod4 = Alt_L Meta_L
Two_fingers scrolling:
沒試成功
參考: http://lanpartei.de/~mirage/
相關的討論: http://www.ubuntuforums.org/showthread.php?t=82850
wget http://lanpartei.de/~mirage/stuff/synaptics_two_fingers.4.diff.gz wget http://web.telia.com/~u89404340/touchpad/files/synaptics-0.14.4.tar.bz2 tar jxvf synaptics-0.14.4.tar.bz2 cd synaptics-0.14.4 gunzip ../synaptics_two_fingers.4.diff.gz |patch -p1 make
修改 /etc/X11/xorg.conf 找到 Identifier “Synaptics Touchpad” 的那個 Section 加入:
Option "HorizScrollDelta" "10"
Option "VertScrollDelta" "10"
Option "TwoFingerScroll" "3"
#1 - enable horizontal scrolling
#2 - enable vertical scrolling
#3 - enable both directions
#0 - disable two-finger scrolling or leave the Option out
Vedio and Display:
支援
顯示器支援 1024×768 全彩
顯示卡是 ATI Radeon Mobility 9200
[root@ibook:~] cat /etc/X11/xorg.conf
Section "Files"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
EndSection
Section "Device"
Identifier "ATI Technologies, Inc. M9+ 5C63 [Radeon Mobility 9000 (AGP)]"
Driver "ati"
BusID "PCI:0:16:0"
Option "XAANoOffscreenPixmaps"
Option "AGPMode" "4"
Option "RenderAccel" "yes"
Option "DynamicClocks" "on" # Save Energy
EndSection
Section "Monitor"
Identifier "COLOR LCD"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
EndSection
Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies, Inc. M9+ 5C63 [Radeon Mobility 9000 (AGP)]"
Monitor "COLOR LCD"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
EndSection
Section "DRI"
Mode 0666
EndSection
Section "Extensions"
Option "Composite" "true"
EndSection
Xgl + Compiz:
支援
雖然沒有 fglrx 的 3D Driver
不過透過 DRI 還是可以跑 Xgl + Compiz 的
外接延伸螢幕:
沒試過
Xinemara
Fan:
支援
kernel module: therm_adt746x
加到 /etc/modules 中: (50 + 5 度)
therm_adt746x limit_adjust=5
Power Management:
支援
使用 pbbuttonsd (舊的是使用 pmud,現在 pbbuttonsd 可以完全取代 pmud)
而在 FC5 上則是用 apmud
snooze 是 Suspend to RAM 的指令
Suspend to Ram: OK
Suspend to Disk: 在 Ubuntu 上不行,但在 FC5 上是 OK 的
Modem:
沒試過
可以去下載 http://www.mayin.org/aragorn/computers/hcf-usb-modem-ppc.tar.gz
編譯好後使用 hcfmodem 這個 driver
聽說是可以用
軟體支援:
IBM-Java for PowerPC:
https://help.ubuntu.com/community/Java
http://www-128.ibm.com/developerworks/java/jdk/linux/download.html
選擇 SDK for 32-bit iSeries/pSeries
sudo apt-get install java-package make-jpkg ibm-java2-sdk-50-linux-ppc.tgz sudo update-alternatives --config java sudo dpkg -i ibm-j2sdk1.5_1.5.0_powerpc.deb
測試:
cd /usr/lib/j2sdk1.5-ibm/demo/applets/TicTacToe ../../../bin/appletviewer example1.html
for mozilla/firefox:
mkdir -p ~/.mozilla/plugins cd ~/.mozilla/plugins ln -s /usr/lib/j2sdk1.5-ibm/jre/bin/libjavaplugin_oji.so #ln -s /usr/lib/j2sdk1.5-ibm/jre/bin/libjavaplugin_oji.so /usr/lib/firefox/plugins
MultiMedia for PowerPC:
使用 mplayer + 然後加上 jserv 的 patch file - wmv3-support-via-vc1.diff.gz
另外,下載及安裝 https://helixcommunity.org/download.php/1346/realplay-10.0.5.756-linux-2.2-libc6-gcc32-powerpc.bin
把 [RealPlayer]/codecs/ 下的檔案複製一份到 /usr/lib/win32 底下
這樣就可以用 mplayer 來播放 rmvb 的檔案了
至於 Flash 部份,我試過安裝 swf-player libswfdec gnash 等套件,有一些 flash 的網頁在可以看
不過,到目前為主,YouTube 及 Google Video 還是無法看的
參考文件:
http://cmr.forestfactory.de/ibook/linux/ibook_linux.html
http://pinguin.uni-psych.gwdg.de/~ihrke/wiki/index.php/Installing_Ubuntu_on_iBook
http://tiger.chem.uw.edu.pl/~poszwa/ibook/
http://www.alessandroronchi.net/wiki/LinuxOnIBookG4
http://www.linux-on-laptops.com/apple.html
http://www.thouters.be/LinuxOniBook