Installing CRUX PPC

Supported Hardware

Packages on the official CRUX PPC ISO image are compiled with optimizations to support Power Architecture® processors. CRUX PPC works on Apple NewWorld (both 32 and 64bit PowerPC), PegasosII, EFIKA, Sam440ep, YDL Powerstation and IBM Power Systems servers. Do not try to install it on an Apple OldWorld, since it simply will not boot.

The kernel used during installation, i.e. when booting from the CRUX PPC ISO image is configured according to the platform; you will usually find support for the following disk controllers, along with USB and FireWire support (except for the kernels targeted to embedded platforms):

Subsystem Driver(s) included in bootkernels (varies with platform)
PATA Generic PCI IDE chipset, Silicon Image, ServerWorks, OSB4/CSB5/CSB6 chipsets support, CMD64x, Apple MacIO IDE, VIA82CXXX chipset support, Freescale MPC5200B, Promise PDC2027x, SIL680, Winbond SL82c105
SATA/SAS ServerWorks Frodo/Apple K2, Silicon Image, VITESSE VSC-7174
SCSI 3ware 9xxx, ACARD, Adaptec AACRAID, Adaptec AIC7xxx, Adaptec AIC79xx U320, AdvanSys, LSI Logic NewGen RAID, LSI Logic MegaRAID (SAS), SYM53C8XX, Tekram DC390(T) and Am53/79C974, IBM Power Linux RAID adapter, MESH (Power Mac internal/external SCSI), IBM ServeRAID, IBM Virtual SCSI, IBM Virtual FC
USB USB device filesystem, EHCI HCD (USB 2.0) support, UHCI (VIA, many add-on cards,...) support, OHCI (iMacs, OPTi, SiS, ALi, NEC,...) support, USB Mass Storage support, USB Human Interface Device (full HID) support, HID input layer support
Firewire OHCI-1394 controllers, Storage devices (SBP-2), IP networking over 1394

In order to install CRUX PPC, your disk controller must be present in the list above. Some add-on controllers (the ones your openfirmware won't be able to boot from) are supported with modules. If your hardware is not supported or you have other problems installing CRUX PPC you might find a solution in Section 3.4, Alternative Installation Methods but consider they could be intended for different hardware.

Installing From CD-ROM

1. Download the CRUX PPC ISO image (crux-ppc-2.7.iso or crux-ppc64-2.7.iso). To ensure that the download was successful you should examine its checksum using md5sum.
Compare the output with the file crux-ppc-2.7.iso.md5 (or crux-ppc64-2.7.iso.md5), which can be found in the same directory as the ISO image on the download site. If the checksums match the download was successful and you can continue with burning the ISO image on a CD.

2. The ISO image is bootable, on Apple computers just insert the newly burned CD into the first CD-ROM drive, reboot your computer and keep the C key pressed to boot from CD. Select at the boot prompt the kernel chrp32 for 604e cpu based systems, apple32 for G3/G4 cpu based systems, apple64 and ppc970 for G5 and PPC970 cpu based systems or pseries for RS64/POWERn cpu based machines.

On PegasosII systems you have to access the SmartFirmware? prompt and type:

 boot cd ppc/pegasos2/zImage.chrp root=/dev/sr??

where sr?? is the device of the CD-ROM Drive with the CRUX PPC CD-ROM inserted in (e.g. sr0 or scd0).

On YDL PowerStation and others Maple/Bimini SLOF motherboard based systems, as the cd does not autoboot, you have to access the SLOF prompt, holding the S key during startup, and type:

 boot cdrom [ENTER]

and when you are presented with the yaboot prompt, type:

 cdrom:0,/ppc/ppc64/vmlinux root=/dev/sr0  [ENTER]

On Sam440ep and IBM Power Systems, if the cd does not autoboot, you have to set up your cdrom as a bootable device in the multi-boot menu (F1 or 1 at the startup for IBM Power Systems or Enter for Sam440ep).

On all systems you might have to adjust the root= parameter (that defaults to /dev/sr0) to your cdrom device. Please keep in mind that device names vary according to your hardware configuration: The first SCSI, SATA (or EFIKA IDE) disk is called /dev/sda, while the first SCSI cdrom is called /dev/scd0 or /dev/sr0; the first IDE disk or cdrom is called /dev/sda too. For more information about harddisk naming conventions please checkout this HOWTO.

3. Login as root (no password required).

4. Use mac-fdisk (on Macs), parted (on PegasosII, EFIKA and Sam440ep), fdisk or cfdisk (on RISC/6000 and pSeries) to create and format the partition(s) you want CRUX PPC to be installed on.

 $ mac-fdisk /dev/sd?
 $ mkreiserfs /dev/sd??
 $ mkswap /dev/sd??
A special bootstrap partition of 800k is needed to install the yaboot loader on Macs; mac-fdisk has a special key to do this. Also consider that yaboot can't read kernel images from JFS and Ext4fs partitions, so if you intend to use those as root filesystem, a supplementary ext2/ext3 partition is needed to store the boot kernel images. Please note that mac-fdisk works with existing MacOS partition tables, it can create/delete partitions on a drive with MacOS installed; cfdisk and fdisk do not recognize MacOS partition table and will destroy it creating a PC compatible table from which you won't be able to boot, so use mac-fdisk on Apple computers.
If you're using a PegasosII system or an EFIKA embedded board, you should use parted to create an Amiga partition table; the partition where the kernel image resides should be a primary one and formatted as ext2 with 128-byte inodes.
If you're using a Sam440ep, you should use parted to create an Amiga partition table; the partition where the kernel image resides should be formatted as ext2 with 128-byte inodes.
If you're using an IBM Power System, creating PC-Style partition table is recommended; cfdisk or fidks are suitable for this. You will need a special PReP Boot partition (type 41) of 8 megabytes.

The amount of disk space you need depends on how many packages you choose to install. I recommend having at least a 1G root partition (CRUX PPC will use about 200MB-500MB depending on your configuration).

Using ReiserFS is recommended, but there is support for Ext2fs/Ext3fs/Ext4fs, XFS, JFS and BTRFS as well. Further, I highly recommend separating system data from user data, i.e. use a separate partition for /home (and possibly /var) since that will make your life a lot easier the day you want to upgrade/reinstall/remove your system.

5. Mount the partition on which you want to install this distribution.

 $ mount -t type /dev/sd?? /mnt

If you want the installation to span more than one partition, mount those partitions as well. For example, if you want to have a different partition for /home or /var, then do:

 $ mkdir /mnt/var
 $ mount -t type /dev/sd?? /mnt/var

6. Activate your swap partition(s).

 $ swapon /dev/sd??

7. Type setup to start the package installation script. The script will ask where you mounted your new root partition and which packages you want to install. Just select the packages you want and nothing else will be installed. However, I recommend at least installing all the packages marked core.

Once it has installed the selected packages, the setup script will display an installation log. Make sure the last line in the log says "0 error(s)".

If you at a later stage find that you need some additional packages you can just mount the CRUX PPC CD-ROM and use pkgadd to install them.

There is only a simple package dependency checking. This means that it is up to you to figure out that if you for example install the exim package you also need to install the db package.
On Sam440ep you need opt/mkimage package to compile your own kernel.
On EFIKA boards you should now create the device /dev/ttyPSC0 needed for the serial port of the console.
$ mknod /mnt/dev/ttyPSC0 c 204 148

8. Now it's time to compile your kernel and do basic system configuration. The kernel compilation requires that you "chroot" into your new CRUX PPC installation.

 $ mount --bind /dev /mnt/dev
 $ mount --bind /tmp /mnt/tmp
 $ mount -t proc proc /mnt/proc
 $ mount -t sysfs none /mnt/sys
 $ chroot /mnt /bin/bash

You can type setup-chroot instead of issuing the previous commands to chroot in the system installed in /mnt

9. Set the root password.

 $ passwd

10. Edit /etc/fstab to configure your filesystem(s). Editors vim, nano and mcedit are available.

If you want access your computer via serial console (as it should be for IBM RS/6000, pSeries, Apple Xserve or Genesi EFIKA users) you also have to add ttyS0 (ttyPZ0 for Xserve or ttyPSC0 for EFIKA) in the /etc/securetty and c7:2:respawn:/sbin/agetty 9600 ttyS0 (c7:2:respawn:/sbin/agetty 57600 ttyPZ0 for Xserve or c7:2:respawn:/sbin/agetty 115200 ttyPSC0 for EFIKA) in the /etc/inittab file. For IBM Power Systems (POWER5 and newer) and PPC970 cpu based systems if you want access your computer via serial console (and to have a working prompt using keyboard/monitor too) you also have to add hvsi0 or hvc0 in the /etc/securetty and c7:2:respawn:/sbin/agetty 19200 hvsi0 (or c7:2:respawn:/sbin/agetty hvc0) in the /etc/inittab file.

11. Edit /etc/rc.conf to configure font, keyboard, timezone, hostname and services. See Section 6.1.3, Configuration Variables in /etc/rc.conf for details about /etc/rc.conf .

12. Generate locales for your system. See Section 6.1.4, Generating Locales for more information.

13. Edit /etc/rc.d/net, /etc/hosts and /etc/resolv.conf to configure your network (ip-address/gateway/hostname/domain/dns).

14. Go to /usr/src/linux-2.6.36.x, configure and compile a new kernel.

On some systems, you should apply the provided patches; these patches are found in the file /usr/src/

On a 32 bit system:

 $ cd /usr/src/linux-2.6.36.x
 $ make menuconfig
 $ make all
 $ make modules_install
 $ cp vmlinux /boot/vmlinux (for IBM RS/6000)
 $ cp arch/powerpc/boot/zImage.pmac /boot/zImage (for Apple)
 $ cp arch/powerpc/boot/zImage.chrp /boot/zImage (for PegasosII, Efika)
 $ cp arch/powerpc/boot/cuImage.sam440ep /boot/uImage (for Sam440ep)
 $ cp System.map /boot/System.map

On a 64 bit system:

 $ cd /usr/src/linux-2.6.36.x
 $ make menuconfig
 $ make all
 $ make modules_install
 $ cp vmlinux /boot/vmlinux
 $ cp System.map /boot/System.map

Useful kernel config files are placed into the /usr/src directory. They are the config files used to build the boot kernels.

15. On Apple computers, edit /etc/yaboot.conf to boot the kernel you just compiled and run mkofboot -v to install yaboot into the boostrap partition, then ybin -v to make the new system bootable.

On IBM RS/6000 and pSeries/System_p computers, edit /etc/yaboot.conf to boot the kernel you just compiled and type dd if=/usr/lib/yaboot/yaboot.chrp of=/dev/sd?? where sd?? is the device corresponding to the disk and PReP Boot partition.

Remember that where /etc/yaboot.conf resides must be the first Ext2fs formatted partition available on your disk.

On PegasosII systems, enter the SmartFirmware? and type boot hd:Y-1 boot/zImage root=/dev/sd?Y where hd?Y is the disc and partition and Y is the number of the partition where CRUX PPC has been installed.

On Sam440ep you could use Parthenope as your second level bootloader. Create the file /boot/menu.lst with the following syntax:

delay 5

title CRUX PPC 2.7
    root ide 0:X
    kernel /uImage root=/dev/sdaY console=tty0 quiet

Where X is the partition number where is located the kernel image and Y is the root partition.
You also need to install Parthenope in the RDB with the following command:

 $ parthenope-install /usr/share/parthenope/Parthenope

Parthenope is smart enough to search for other operating system and boot them.

16. Remove the CRUX PPC CD-ROM from your drive and reboot from harddisk.

Upgrading From CD-ROM

1. Download the CRUX PPC ISO image (crux-ppc-2.7.iso or crux-ppc64-2.7.iso). To ensure that the download was successful you should examine its checksum using md5sum.
Compare the output with the file crux-ppc-2.7.iso.md5 (or crux-ppc64-2.7.iso.md5), which can be found in the same directory as the ISO image on the download site. If the checksums match the download was successful and you can continue with burning the ISO image on a CD.

2. The ISO image is bootable, on Apple computers just insert the newly burned CD-ROM into the first CD-ROM drive, reboot your computer and keep the C key pressed to boot from CD-ROM. Select at the boot prompt the kernel chrp32 for 604e cpu based systems, apple32 for G3/G4 cpu based systems, apple64 and ppc970 for G5 cpu based systems or pseries for RS64/POWERn cpu based machines.

On PegasosII systems you have to access the SmartFirmware? prompt and type:

 boot cd ppc/pegasos2/zImage.chrp root=/dev/sd??

where sd?? is the device of the CD-ROM Drive with the CRUX PPC CD-ROM inserted in (e.g. sr0 or scd0).

On YDL PowerStation and others Maple/Bimini SLOF motherboard based systems, as the cd does not autoboot, you have to access the SLOF prompt, holding the S key during startup, and type:

 boot cdrom [ENTER]

and when you are presented with the yaboot prompt, type:

 cdrom:0,/ppc/ppc64/vmlinux root=/dev/sr0  [ENTER]

On Sam440ep and IBM Power Systems, if the cd does not autoboot, you have to set up your cdrom as a bootable device in the multi-boot menu (F1 or 1 at the startup for IBM Power Systems or Enter for Sam440ep).

On all systems you might have to adjust the root= parameter (that defaults to /dev/sr0) to your cdrom device. Please keep in mind that device names vary according to your hardware configuration: The first SCSI, SATA (or EFIKA IDE) disk is called /dev/sda, while the first SCSI cdrom is called /dev/scd0 or /dev/sr0; the first IDE disk or cdrom is called /dev/sda too. For more information about harddisk naming conventions please checkout this HOWTO.

3. Login as root (no password required).

4. Mount your CRUX PPC root partition.

 $ mount -t type /dev/sd?? /mnt

If your installation spans over more than one partition, then mount those partitions as well. For example, if you have a different partition for /var, then do:

 $ mount -t type /dev/sd?? /mnt/var

5. Activate your swap partition(s).

 $ swapon /dev/sd??

6. Type setup to start the package installation script. The script will ask you where you mounted your root partition and which packages you want to upgrade. It is a good idea to upgrade all packages, else you might get into trouble later, e.g. in case a new version of some library isn't 100% backwards compatible.

The setup script uses the /etc/pkgadd.conf of the target system to determine which files to upgrade and which files not to upgrade. The files that are not upgraded are put in /var/lib/pkg/rejected/ (Section 4.2.2, Upgrading a Package).

When the setup script has upgraded the selected packages an upgrade log will be displayed. Make sure the last line in the log says "0 error(s)".

If you at a later stage find that you need some additional packages you can just mount the CRUX PPC CD-ROM and use pkgadd to install them (e.g. pkgadd /mnt/crux/opt/package#1.0-1.pkg.tar.gz).

7. Now it's time to compile your kernel. The kernel compilation requires that you "chroot" into your CRUX PPC installation.

 $ mount -o bind /dev /mnt/dev
 $ chroot /mnt /bin/bash

8. Go to /usr/src/linux-2.6.36.x, configure and compile a new kernel.
Useful kernel config files are placed into the /usr/src directory. They are the config files used to build the boot kernels. Adjust /etc/fstab if needed.

udev reads files in /sys/* and /proc/*. Make sure that those pseudo filesystems are enabled in your kernel configuration and available during system-startup. Also note that unlike devfsd, udev doesn't automatically mount /dev/pts. Terminal applications such as xterm(1) will not work if you forget to mount it. If you want udev to detect your connected USB hardware you'll need the USB-Filesystem mounted on /proc/bus/usb. We highly recommend you check your fstab file.

9. On Apple computers, edit /etc/yaboot.conf to boot the kernel you just compiled and run mkofboot -v to install yaboot into the boostrap partition, then ybin -v to make the new system bootable.

For IBM RS/6000 and pSeries/System_p computers, edit /etc/yaboot.conf to boot the kernel you just compiled and type dd if=/usr/lib/yaboot/yaboot of=/dev/sd?? where sd?? is the device corresponding to the disk and PReP Boot partition.

Remember that where /etc/yaboot.conf resides must be the first Ext2fs formatted partition available on your disk.

For PegasosII systems, enter the SmartFirmware? and type boot hd:Y-1 boot/zImage root=/dev/sd?Y where hd?Y is the disk and partition and Y is the number of the partition where CRUX PPC has been installed.

10. Remove the CRUX PPC CD-ROM from your drive and reboot from harddisk.

Alternative Installation Methods

Network Installation

If you do not have a CD burner, are unable to boot your machine using the CRUX CD-ROM or for any other reason are unable to install CRUX the normal way (Section 2.2, Installing From CD-ROM) you might want to check out HOWTO install GNU/Linux CRUX PPC on Genesi EFIKA or HOWTO install CRUX via NFS by Juergen Daubert.