Installing Gentoo on an Ibook G3

This page cover the installation of gentoo 2006.1 universal install CD.

Hardware specifications

  • model : Ibook G3 500MHz (white+2usb slots),
  • memory : 128mo (base) + 512mo,
  • display : 12”,
  • hdd : 10Go,
  • optical-drive : cd/dvd-rom,
  • Wireless : No airport card installed,
  • Sound : it works.

Get the media

You can fetch the universal cd for ppc architecture here. Choose ppc 32 bits and burn the iso.

Boot time and preparing the disk

Insert the CD, reboot the laptop and hold ‘c’ to boot with the media. Personally, I have to pass by the openfirmware to change the date before booting from openfirmware. (see troubleshooting section).

Changing the keymap

Default is qwerty.

# loadkeys fr-latin1

Network configuration

The dhcpcd configuration works great, there is nothing to do (if you have a DHCP server of course).

Hard-drive partitioning

This is quite different than x86.

#mac-fdisk /dev/hda1

Delete all the partition with d followed by the number of the partition. Ths list is given with the p key.

The result should be :

Command (?) : p
/dev/hda
     #                     type   name  length        base   (size)    system
/dev/hda1   Apple_partition_map   Apple    63         @ 1     (31.5k)  partition map
/dev/hda2      Apple_free_extra   Extra    19640816   @ 64    (9.4G)   Free space

Create the Apple bootstrap partition

Command (?) : b
First block : 2p
Command (?) : p
/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    (9.4G)   New world bootblock
/dev/hda3      Apple_free_extra   Extra    19639216   @ 1664  (9.4G)   Free space

Create the swap :

Command (?) : c
First block : 3p
Length (...) : 512M
Name .. : swap
Command (?) : p
/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       (9.4G)   New world bootblock
/dev/hda3      Apple_UNIX_SVR2    swap      1048576    @ 1664     (512M)   Linux swap
/dev/hda4      Apple_free_extra   Extra     18590640   @ 1050240  (8.9G)   Free space

And finish with the root partition :

Command (?) : c
First block : 4p
Length (...) : 4p (yes, again !!)
Name .. : root
Command (?) : p
/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       (9.4G)   New world bootblock
/dev/hda3      Apple_UNIX_SVR2    swap      1048576    @ 1664     (512M)   Linux swap
/dev/hda4      Apple_UNIX_SVR2    root      18590640   @ 1050240  (8.9G)   Linux native

then write (w) and quit (q).

Create the filesystem

For an ext3 :

# mkfs.ext3 /dev/hda4

Activate the swap :

# mkswap /dev/hda3
# swapon /dev/hda3

Mount the root partition :

# mount /dev/hda4 /mnt/gentoo

Install the files

We just have to copy a snapshot of the gentoo tree on the hard drive mounted on /mnt/gentoo/.

Get the snapshot archive

The best way is to get the lastest one one the net rather to use the one on the cd.

links http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/

Go in ./releases/ppc/current/ppc32/stages/ and download stage3-ppc-2006.1.tar.bz2.

Get the .DIGEST too, and check the archive integrity :

# md5sum -c stage3-ppc-2006.1.tar.bz2.DIGESTS
stage3-ppc-2006.1.tar.bz2: OK

Untar the archive (in /mnt/gentoo/) :

# tar xvjpf stage3-ppc-2006.1.tar.bz2

Install Portage

Portage is the package manager. Go get a snapshot on a mirror :

links http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/snapshots/portage-latest.tar.bz2

and untar it in /mnt/gentoo/usr/ :

# tar xvjf portage-latest.tar.bz2 -C /mnt/gentoo/usr

Set the compile options

Here we edit /etc/make.conf :

# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -fno-strict-aliasing -pipe"
CHOST="powerpc-unknown-linux-gnu"
CXXFLAGS="${CFLAGS}"
USE="alsa avi bash-completion dri X kde qt3 qt4 svg directfb postgres hal ieee1394 xcomposite xscreensaver -gtk -gnome tiff bzip2 cairo tetex "
ACCEPT_KEYWORDS="~ppc"
VIDEO_CARDS="r128"
INPUT_DEVICES="keyboard mouse ps2mouse"
LINGUAS="fr"
PORTDIR_OVERLAY="/usr/local/layman/xeffects"
ALSA_CARDS="powermac"

LINGUAS and PORTDIR_OVERLAY variables are optional (I tried Xgl/Beryl, It works but it is damn slow !). Set the USE flags at your convenience, this is the power of this distribution. ACCEPT_KEYWORDS=”~ppc” means we want to merge the “unstable” package versions. VIDEO_CARDs and INPUT_DEVICES are X related.

Chrooting

Before we need to copy /etc/resolv.conf and mount proc and dev in the new environment :

# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

Enter the new env :

# chroot /mnt/gentoo /bin/bash
# env-update
>> Regenerating /etc/ld.so.cache...
# source /etc/profile

Update portage

emerge --sync

Merge a few packages

Nano sucks :

emerge vim

We need the laptop special keys to be mapped (for ~ by example) :

emerge pbbuttonsd

FIXME pb with pbbuttons daemon, can’t found /dev/pmu..

Set time

cp /usr/share/zoneinfo/Europe/whateveryouwant /etc/localtime

Install the kernel

Get the sources

emerge gentoo-sources

Configure

Configure you kernel. Here a .config for a 2.6.19-gentoo-r6.

cd /usr/src/linux
make pmac32_defconfig
make menuconfig
make 
make modules_install
cp vmlinuz /boot/kernel-2.6.19-r6

Configure the system

The fstab file

/etc/fstab

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed; notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda4               /               ext3            noatime         0 1
/dev/hda3               none            swap            sw              0 0
#/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,ro,user  0 0
/dev/hdb                /mnt/cdrom      iso9660         noauto,ro,user  0 0
/dev/sda1               /mnt/ipod       vfat            noauto,user     0 0
#/dev/fd0               /mnt/floppy     auto            noauto          0 0

# NOTE: The next line is critical for boot!
proc                    /proc           proc            defaults        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

Change the cdrom is necessary. The mine is at /dev/hdb (odd, I know).

hostname

/etc/conf.d/hostname

HOSTNAME="stanbook"

/etc/hosts

127.0.0.1       stanbook.homenetwork stanbook localhost

root password

Do not forgot that !

#passwd

Network : dhcp client

emerge dhcpcd
rc-update add dhcpcd default

Add a user

useradd -m -G users,wheel,audio,video,portage -s /bin/bash stan
passwd stan

The bootloader : yaboot

Exit chroot to mount /dev and /sys if not already done :

# exit  # this will exit the chroot
# mount -o bind /dev /mnt/gentoo/dev
# mount -o bind /sys /mnt/gentoo/sys
# chroot /mnt/gentoo /bin/bash
# /usr/sbin/env-update && source /etc/profile 

Install yaboot

emerge yaboot

exit the chroot

exit

run yabootconfig

yabootconfig --chroot /mnt/gentoo
...
...
Enter path to kernel : /mnt/gentoo/boot/kernel-2.6.19-r6
....

Check your newly created /etc/yaboot.conf (need to re-chroot) :

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

boot=/dev/hda2
device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:
partition=4
root=/dev/hda4
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

image=/boot/kernel-2.6.19-r6
        label=Linux
        read-only


now you can reboot.

X server

Direct rendering may works if you let the color depth a 16bits. It will not works in 24 bits due to the lack of memory (need 10MB and got 8MB). Unfortunately, I am not (no more) able to make it works since I have rebuild my box :-(. however, direct rendering is not very useful on this kind of machine, and getting true colors is more comfortable (my opinion, of course).

Just emerge xorg :

emerge -pv xorg-x11 Xorgautoconfig

And run Xorgautoconfig to auto-create /etc/X11/xorg.conf. Change the keyboard layout if necessary.

Here the xorg.conf. I have modified some options to get the altGr on the right apple key :

# This file was generated by Xorgautoconfig v0.2.2.
Section "ServerLayout"
        Identifier      "X.Org Configured"
        Screen          0  "Screen0" 0 0
        InputDevice     "Mouse0" "CorePointer"
        InputDevice     "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
# Multiple FontPath entries are allowed (which are concatenated together),
# as well as specifying multiple comma-separated entries in one FontPath
# command (or a combination of both methods)

# For X Font Server support, uncomment this and comment the other FontPaths
# Note that this is not required for most configurations
#       FontPath        "unix/:-1"
        FontPath        "/usr/share/fonts/ttf-bitstream-vera/"
        FontPath        "/usr/share/fonts/util/"
        FontPath        "/usr/share/fonts/encodings/"
        FontPath        "/usr/share/fonts/100dpi/"
        FontPath        "/usr/share/fonts/100dpi/:unscaled"
        FontPath        "/usr/share/fonts/75dpi/"
        FontPath        "/usr/share/fonts/75dpi/:unscaled"
        FontPath        "/usr/share/fonts/cyrillic/"
        FontPath        "/usr/share/fonts/misc/"
        FontPath        "/usr/share/fonts/Type1/"
        FontPath        "/usr/share/fonts/default/"
EndSection

Section "Module"
        Load    "extmod"
        Load    "dri"
        Load    "dbe"
        Load    "record"
        Load    "glx"
        Load    "type1"
        Load    "freetype"
EndSection

Section "Extensions"
#       Option "Composite"      "Disable"       # Experimental
EndSection

Section "ServerFlags"
        Option  "blank time"    "10"    # 10 minutes
        Option  "standby time"  "20"
        Option  "suspend time"  "30"
        Option  "off time"      "60"
### Uncomment this Server flag if X should not change resolutions.
### This is useful if mode changing crashes / corrupts the X server
#       Option  "DisableVidModeExtensions"
EndSection

Section "InputDevice"
        Identifier      "Keyboard0"
        Driver          "kbd"
# Change "XkbModel" to "macintosh_old" if you are using
# the deprecated adb keycodes.
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "fr"
        #Option                 "XkbOptions"    "compose:rwin"
        Option          "XkbOptions"    "lv3:lwin_switch"
### Uncomment this if your layout uses nodeadkeys
        #Option         "XkbVariant"    "nodeadkeys"
EndSection

Section "InputDevice"
        Identifier      "Mouse0"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Protocol"       "auto"
        Option          "Device"         "/dev/input/mice"
EndSection

Section "Monitor"
        Identifier      "Monitor0"
        UseModes        "Modes0"
        ModelName       "Monitor Model"
        Option          "DPMS"
        HorizSync       30-70
        VertRefresh     50-160
EndSection

Section "Modes"
        Identifier      "Modes0"

        # Generated
        # D: 64.994 MHz, H: 48.359 kHz, V: 59.998 Hz
        Modeline "1024x768" 64.994 1024 1064 1200 1344  768 771 777 806  -HSync -VSync
EndSection

Section "Device"
        Identifier      "Card0"
        ### Available Driver options:
        Option "DMAForXv"       "true"  # Use DMA for XV, reduces CPU usage
                                        # Can cause stability problems
        #Option "SWcursor"      "false" # Use Software Cursor
        #Option "NoAccel"       "false" # Disable Hardware Acceleration
        #Option "Display"       "FP"    # Display mode for devices which
                                        # support Flat Panels.  Modes:
                                        # "FP" - Use Flat Panel
                                        # "CRT" - Use CRT
                                        # "Mirror" - Use both FP and CRT
        ### See "man r128" for additional options

        ### Warning: If your r128 has less than 10MB of ram, you will only be
        ###          able to use dri in 16bit color.
        Driver  "r128"
#       BusID   "PCI:0:16:0"
EndSection

Section "Screen"
        Identifier      "Screen0"
        Device          "Card0"
        Monitor         "Monitor0"
        DefaultDepth    16
        SubSection "Display"
                Depth           8
                Modes           "1024x768"
        EndSubSection
        SubSection "Display"
                Depth           16
                Modes           "1024x768"
        EndSubSection
        SubSection "Display"
                Depth           24
                Modes           "1024x768"
        EndSubSection
EndSection

Section "DRI"
        Group 0
        Mode 0666
EndSection

Window manager

KDE runs pretty smooth, but it take a while to compile (20h !!) :

To be able to compile hal (automounter), we have to compile pciutils without zlib flag :

# echo "sys-apps/pciutils -zlib" >> /etc/portage/package.use

emerge pciutils kdebase-startkde konsole
rc-update add hald default

To start kde with the startx command, add this in ~/.xinitrc

exec startkde

The sound system : Alsa

I have trouble with built-in drivers, so I compile them as modules in the kernel :

Device Drivers  --->
  I2C support  ---> 
    <*> Powermac I2C interface  

  Sound  --->
    <*> Sound card support
    <>PowerMacDMAsoundsupport
      Advanced Linux Sound Architecture  --->
      <*> Advanced Linux Sound Architecture
      <*>   Sequencer support
      <*>     Sequencer dummy client
      <*>   OSS Mixer API
      <*>   OSS PCM (digital audio) API
      [*]     OSS PCM (digital audio) API - Include plugin system
      [*]   OSS Sequencer API
      [ ]   Dynamic device file minor numbers
      [*]   Support old ALSA API
      [*]   Verbose procfs contents 
      [ ]   Verbose printk
      [ ]   Debug
      ...
      ALSA PowerMac devices  --->
         <M> PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)
         [*]   Toggle DRC automatically at headphone/line plug-in
      Apple Onboard Audio driver  --->
        < > Apple Onboard Audio driver
        < > Apple Soundbus support

      Open Sound System  ---> 
       < > Open Sound System (DEPRECATED)

add snd-powermac to /etc/modules.autoload.d/kernel-2.6 and reboot with your new kernel if needed.

Check your make.conf file :

...
ALSA_CARDS="powermac"

Then emerge the alsa-utils package :

emerge alsa-utils

Run alsaconfig and you will be prompted to choose a card between two. Choose the PowerMac and say yes to modules.conf update.

Now you can start the init script and add it to the boot runlevel :

stanbook stan # /etc/init.d/alsasound start
 * Loading ALSA modules ...
 *   Loading: snd-card-0 ...                                              [ ok ]

stanbook stan # rc-update add alsasound boot
 * alsasound added to runlevel boot

now you can play with the mixer as normal user (in audio group) by running alsamixer. Use m to unmute.

If it do not runs :

stan@stanbook ~ $ alsamixer

alsamixer: function snd_ctl_open failed for default: No such device

restart udev, as root :

stanbook stan # killall udevd; udevstart
udevd: no process killed

Java

Sun did not released a ppc version of its virtual machine. You can use the free jvm Blackdown but I prefer the IBM® one although it is not free and you need to register on their web site.

For a web support, do not forget the nsplugin USE flag.

# echo "dev-java/ibm-jdk-bin nsplugin" >> /etc/portage/package.use
# emerge ibm-jdk-bin

Follow the instructions concerning the binaries download and emerge –resume.

More informations here : http://www.gentoo.org/doc/en/java.xml

Keyboard layout

For kde users

emerge kxkb


Troubleshooting

openfirmware prompt

If you need to access the openfirmware, press apple+alt+O+F at boot time.

To set the time (e.g. 23th februry 2007 at 2.48pm and 10 seconds):

decimal dev rtc 10 48 14 23 02 2007 set-time

To reset the PRAM and the NVRAM, hold apple+alt+P+R at boot time.

To reset the MPU :

:linux:ibookreboot.gif

kernel panic : yaboot issues

reboot with the cd

Links

 
linux/gentoo_install_ibookg3.txt · Dernière modification: 2007/03/16 19:10
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki