Install Arch Linux PPC

From ArchWiki

Jump to: navigation, search


Contents

Install Arch Linux PPC

This is a tutorial on how to install Arch Linux PPC on Apple powerpc "newworld" machines (ie. all PowerMacs able to boot from CD). Arch Linux PPC is a project to port Arch Linux to the PowerPC architecture.

NOTE: There is a new iso available (see link below where to get it), so you are not 
forced to use the quickinst-script anymore (as described below).

Download iso

The latest ISO are available for download from:

ftp://ftp.archlinuxppc.org/iso/

Booting the install- CD

To boot a CD in most PowerMacs simply hold down C while switching on the machine. If it starts to access the CD drive all went well and you can start with the install procedure.

If it doesn't work that way, please check the version of OpenFirmware by booting into it. It should output a version when it comes up. To get in, do the same as for booting from CD but hold down: command + option + O + F

Generally it should at least be version 3.0 or higher.

You may also want to try to boot from the OpenFirmware prompt instead of doing it directly by typing: boot cd:,\\yaboot on the command prompt.

If none of the above works or if you do not own an apple-keyboard, there is an alternative way to make the cd boot. Please note that a existing installation of OS X is required for this method:

Boot into OS X and insert the Arch Linux PPC Boot CD into the drive. Now open a terminal window and wait 
until the CD has been auto-mounted. Run "mount" and search the output for a line similar to
"/dev/disk1s1s2 on /Volumes/arch-boot". In this example the CD-ROM device is "/dev/disk1s1s2".
Now run: "sudo bless -device /dev/disk1s1s2 -setBoot" to change the Open Firmware boot device.
You can now reboot the machine and install Arch Linux PPC. Once yaboot has been installed, the primary
boot device should have been reset to your harddisk automatically.

Configure the network

If your machine is e.g. a powerbook 5,6 with an airport extreme wifi card (bcm43xx), you won't be able to install over a wireless lan unless you've got the firmware ready on disk or on a separate cd/dvd/usb memory stick, see Wireless Setup for details. If your machine has an older "airport" wifi card built in (titanium; older iBooks), you can simply run

modprobe airport

to get wireless working. If you use the ethernet port, the required kernel module should have been auto-loaded. Usually this is one of "sungem" or "bmac". If the module hasn't been auto-loaded, you'll have to do it by hand (e.g. sungem):

modprobe sungem


Once you've choosen the networking device to use, run

dhcpcd <your interface>

to connect your machine to a network. To list all available interfaces execute

ifconfig -a

If dhcp is unavailable, you have to manually configure your network connection:

ifconfig <interface> <IP>
route add default gw <GATEWAY>

and edit /etc/resolv.conf with vi(m)/nano to add your DNS:

nameserver <IP.OF.NAMESERVER1>
nameserver <IP.OF.NAMESERVER2>

Creating and formatting partitions

Partition

run mac-fdisc:

mac-fdisk /dev/hda

Initialize the partition scheme

Erase all existing partitions (don't forget to backup if necessary): type "i" in mac-fdisc

Create Apple Boot partition

Type "p" to display the the starting sector, then "b" and input this number.

Create partitions

Create a partition scheme like

/ -> 15G
swap -> 1,5G
/home -> 55 G

Type "c", to create a partition. "p" to list current partitions and sectors to see where you can add new partitons. For the swap partition use the name "swap".


Example result:

        #                    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 root                31457280 @ 1664
( 15.0G)  Linux native
/dev/hda4         Apple_UNIX_SVR2 swap                 3072000 @
31458944  (  1.5G)  Linux swap
/dev/hda5         Apple_UNIX_SVR2 home               121770544 @
34530944  ( 58.1G)  Linux native

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

Format partitions

ext3 is recommended on powerpc. Format your partitions:

mkfs.ext3 /dev/hda3
mkfs.ext3 /dev/hda5

(Note: reiserfs was said to be unstable, but all bugs should have been fixed nowadays, I've been using it for almost a year and haven't experienced any problems - Armin)

Format swap

mkswap /dev/hda4

Create chroot

You can both install using the Arch-Setup script (/arch/setup) or quickinstall (be warned there's a bug: no wget on the iso, so you need to correct to snarf manually)

Mount partitions

partitions are mounted on /mnt

mount /dev/hda3 /mnt
mkdir /mnt/home
mount /dev/hda5 /mnt/home

Install base

Install base on /mnt with the quickinstall script. The quickinstall script can't create a directory for pacman's database so add it:

mkdir -p /mnt/var/lib/pacman

Also quickinstall will need wget:

snarf ftp://ftp.archlinuxppc.org/core/os/ppc/wget-*ppc.pkg.tar.gz
pacman -U wget-*ppc.pkg.tar.gz

Start the quickinstall script:

cd /tmp
/arch/quickinst ftp /mnt ftp://ftp.archlinuxppc.org/core/os/ppc

Note: My notes on installing can be found here: Installing ArchLinux PPC on my Powerbook Titanium

Mount chroot

cp /etc/resolv.conf /mnt/etc/resolv.conf
mount -t proc none /mnt/proc
mount -t sysfs none /mnt/sys
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash
source /etc/profile
grep -v rootfs /proc/mounts > /etc/mtab

Edit configurations files

(See the Official Install Guide for more information)

/etc/fstab; /etc/rc.conf, /etc/hosts files...

Example of /etc/fstab with previous partition schema

none          /dev/pts      devpts    defaults            0 0
none          /dev/shm      tmpfs     defaults            0 0
#tmpfs         /tmp          tmpfs     defaults            0 0

/dev/cdrom    /media/cd   auto    ro,user,noauto,unhide   0 0
#/dev/dvd      /media/dvd  auto       ro,user,noauto,unhide   0 0

/dev/hda3     /            ext3      defaults,noatime     0 0  
/dev/hda4     swap         swap      defaults             0 0
/dev/hda5     /home        ext3      defaults,noatime     0 1


Example of /etc/rc.conf

LOCALE=en_US.utf8
HARDWARECLOCK="localtime"
TIMEZONE=Europe/Paris
KEYMAP=mac-fr-ext_new
CONSOLEFONT=lat9w-16
CONSOLEMAP=
USECOLOR="yes"
MOD_AUTOLOAD="yes"
MOD_BLACKLIST=()


MODULES=(sungem !usbserial)
USELVM="no"
HOSTNAME="name-mac"
lo="lo 127.0.0.1"
eth0="eth0 192.168.0.4 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(lo eth0)
gateway="default gw 192.168.0.254"
ROUTES=(gateway)
DAEMONS=(syslog-ng !hotplug !pcmcia network netfs crond sshd)

Note : If you want to use airport, add airport to modules.

Example of /etc/hosts

The hostname you entered in /etc/rc.conf needs to be added to /etc/hosts:

127.0.0.1       name-mac               localhost

/etc/locale.gen

Select your localization in /etc/locale-gen, save the file and run:

locale-gen

Install kernel and openssh

pacman -Sy kernel26-pmac openssh

Install Yaboot Bootloader

Yaboot can be installed automatically or manually.

Automatic Installation

To automatically generate the bootloader configuration file (/etc/yaboot.conf) and install yaboot on the bootstrap partition:

yabootconfig

When it asks for your kernel image, input /boot/vmlinux26 and for the initrd /boot/kernel26.img.

Manually

The Yaboot configuration file will need to be edited in /etc/yaboot.conf. An example:

boot=/dev/hda2
device=/pci@f4000000/ata-6@d/disk@0:
partition=3
delay=10
timeout=40
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
image=/boot/vmlinux26
	label=Linux
	root=/dev/hda3
	initrd=/boot/kernel26.img
	read-only

Note: To find the device path run this in the shell:

ofpath /dev/hda

Then install yaboot to the bootstrap partition by:

mkofboot
ybin -v

Change root password

passwd

Add a user

adduser <your username>

Reboot

Exit chroot:

exit

Umount partitions :

umount /mnt/proc /mnt/sys /mnt/home /mnt/dev /mnt

Execute the command :

reboot

VoilĂ , Arch Linux PPC is installed. You only need to install X, ... like in Arch Linux :)

Post-Install

To update your system here are a few tips.

Adding Packages

Some packages are available in the main repository (core and extra) and can be added with Pacman.

ABS

Arch Linux PPC includes many packages in common with it's i686 and x86_64 but not all of them. If you need a package that is a part of the i686/x86_64 repository you can install the Arch Build System. ABS "is a 'ports-like' system for building and packaging software from source code" and is used to build the current packages in the i686, x86_64, and ppc repositories.

The abs tools package is not in the PPC repository and will need to be added manually. First the development tools will need to be added:

pacman -S base-devel

Then as a regular user:

mkdir abs && cd abs
wget http://ftp.archlinux.org/extra/os/i686/extra.abs.tar.gz
tar -xvf extra.abs.tar.gz
cd extra/abs/

Add ppc to PKGBUILD. Now the package can be built (and dependencies installed) with:

makepkg -s PKGBUILD

To add the abs package, as root:

pacman -U /home/<user>/abs/extra/abs/abs*-ppc.pkg.tar.gz

The abs tool can now be used to download the ABS tree. More on ABS can be found on the ABS page.

Other Packages

The Arch User Repository (AUR) has more packages that are available. There are even a few PPC binary packages available. Adding a package from AUR can be done with Yaourt. For packages that are built from source in AUR you can add 'ppc' to the PKGBUILD when Yaourt prompts you and most packages will be able to build.

Personal tools