Install Arch Linux PPC
From ArchWiki
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.
Contents |
Download
The latest ISO are available for download from here
Booting the install-CD
To boot a CD in most PowerMacs simply hold down C while switching on the machine. If it starts continue to the install procedure.
If the CD doesn't boot, check the version of OpenFirmware by booting into it. You get to the Open Firmware by booting you computer and immediately pressing Apple+Option+O+F. Your Open Firmware version will be displayed on the top. Only newer versions of Open Firmware are able to boot certain types of CDs. Generally it should at least be version 3.0 or higher. If you are able, it is recommended you update your Open Firmware before proceeding. If you have the newest firmware, you may have to direct Open Firmware to boot the CD and direct it to the bootloader configuration:
boot cd:,\\yaboot
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 an 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 load the driver to get wireless working:
modprobe airport
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 can do it by (e.g. sungem):
modprobe sungem
Once you enter the installer, you can use it's dialog option to start the network, or you can do it now by:
dhcpcd <your interface>
To list all available interfaces do:
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 Domain Name Server (DNS) addresses:
nameserver <IP.OF.NAMESERVER1> nameserver <IP.OF.NAMESERVER2>
Partitioning
Apple computers use a different partition layout to hold the bootloader and partition table. The installer uses cfdisk and you will not be able to define your partitions from there. Also the traditional fdisk command cannot be used. Rather you have to use mac-fdisc.
An example way to partition your disk:
mac-fdisk -l # to see partitions mac-fdisk /dev/hda # enter disk editor of hda storage device p # print current partition map i # init new partition map b # Open Firmware needs an Apple bootstrap partition 2p # on second partition c # create (for swap) 3p 768M # twice the size of the physical RAM swap # name c # for root 4p 4p # to the end of the physical drive / # name w # write partition map q # quit
Your swap partition size will depend on your memory. For lightweight desktops, the very minimum will be around 512MB accumulative. For heavier desktops it is good to have 1GB or more. To avoid constant thrashing on the hard drive, you should attempt to use desktops like Gnome or KDE unless you have at least 512MB of physical RAM.
An 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
Formatting partitions
Formatting can be done from the installer when you choose your mountpoints, or can be done here.
ext3 is the recommended stable filesystem, some users like to use others like reiserfs. How to format from the example above:
mkfs.ext3 /dev/hda3 mkfs.ext3 /dev/hda5
and for the swap partition:
mkswap /dev/hda4
Install
Start the installer and follow the steps one by one:
/arch/setup
When you get to the step where it asks you for the mirror address, enter:
ftp://www.archlinuxppc.org/
Configuration files
Except for yaboot, configuration should be the same as a regular Arch Install, see Beginners'_Guide.
/etc/fstab, /etc/rc.conf, and /etc/hosts files:
Fstab
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
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.
hosts
The hostname you entered in /etc/rc.conf needs to be added to /etc/hosts:
127.0.0.1 localhost.localdomain localhost your-machine-name(hostname)
Install kernel
For installing the kernel and Yaboot bootloader, you must first chroot into the install environment. Switch consoles (but don't exit the installer) by Ctl+Opton+FN+F2. Note that the installer, mounts the install partition to just /mnt.
pacman -Sy kernel26-pmac
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
Be sure the exit the chroot and umount the temporary filesystems as defined in Change Root.
Add Root Password and Rebooot
Return to the first console (Ctl+Opton+FN+F1) finish the install, then:
reboot
VoilĂ , Arch Linux PPC is installed. You only need to install X, ... like in Arch Linux :).
Rest on [[1]]]
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 ftp://ftp.archlinux.org/extra/os/i686/extra.abs.tar.gz tar -xvf extra.abs.tar.gz cd extra/abs/
Add ppc to arch list in 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.
Pre 2009-03-30 CD Setup
For CDs' before the 2009-03-30 CD, a good deal of manual congiguration is necessary.
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
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