CRUX PPC
A lightweight GNU/Linux distribution for PowerPC!
author: Acrux
HOWTO install GNU/Linux CRUX PPC on Genesi EFIKA
or eventually any other MPC5k2 SoC
The Genesi EFIKA 5200B is a board based around the MPC5200B PowerPC® System-on-Chip from Freescale Semiconductor. A 32 Bit PowerPC with FPU, 603e processor core (e300) with access to 128MB DDR RAM (266MHz) of main memory. EFIKA provides small form factor design and high performance and integration, for multiple embedded, thin client, industrial applications, from a single board.
There are several way to install CRUX PPC on this kind of machine and we'll reproduce three scenarios.
Install CRUX PPC via NFS
Hard Drive install from CDROM
Hard Drive install from USB pendrive
The Future
Install CRUX PPC via NFS
We, now, describe the installation of CRUX PPC 2.2 from a NFS server of your local network. This may be useful if you have a running CRUX box and you cannot install CRUX PPC on your other computer via CD-ROM, or, more conceivable, because EFIKA doesn't have any CD-ROM drive.
Mount the CRUX PPC CD-ROM (or the CRUX PPC ISO image) to a directory of your server, e.g. to the directory /mnt/hd0. To export the above directory with NFS, put the following line into /etc/exports, and restart your NFS server. Be sure you have the required entry in /etc/hosts.allow too.
/mnt/hd0 *(ro,no_root_squash,sync,no_subtree_check)
and remember to start the NFS Server
# /etc/rc.d/nfsserver start
You need a PowerPC machine to native compile it or a working cross toolchain.
All our kernels include NFS client support therefore you can skip this section.
Make a backup of your current kernel configuration:
# cp /usr/src/linux/.config /usr/src/linux/.config.save
Get the configuration file for the CRUX PPC bootkernel from the ISO. This file is always named like linux-2.6.20.config and copy it into your kernel source tree:
# cp linux-2.6.10.config /usr/src/linux-2.6.10/.config
Goto /usr/src/linux-2.6.20, run make menuconfig and add to the configuration:
Networking ---> [*] Networking support Networking options ---> [*] Unix domain sockets [*] TCP/IP networking [*] IP: kernel level autoconfiguration [*] IP: DHCP support [*] IP: BOOTP support [*] IP: RARP support Device Drivers ---> [*] Network device support ---> add your network interface card(s) File systems ---> Pseudo filesystems ---> --- /proc file system support [*] /proc/kcore support [*] Virtual memory file system support (former shm fs) [*] Network File Systems ---> [*] NFS file system support [*] Provide NFSv3 client support [*] Root file system on NFS
Don't use modules, all options must be compiled into the kernel. Build the kernel as usual and only enable stuff you really need.
You can, simply, copy the EFIKA tuned kernel image from our ISO on a USB pendrive and use it to boot or you can set up an ad hoc TFTP server so that the EFIKA can fetch it over the network.
When you power up the EFIKA, you should get the SmartFirmware (an implementation of the OpenFirmware IEEE standard 1275-1994 plus errata changes) prompt:
EFIKA 5K2 Boot Strap [RELEASE BUILD] (c) 2002-2006 bplan GmbH (BUILD 2006110113) Running on CPU PVR: 0x80822014 Running on system SVR: 0x80110022 BIOS Code position: 0xFFF040D0 Setup System Config... Done. Setup Memory Config... Done. Setup PCI... Done. Setup ATA... Done. Setup USB... Done. Setup ETH... Done. Memory Test skipped (Warmboot detected) cpu0: PowerPC,G2 CPUClock 396 Mhz BUSClock 132 Mhz (Version 0x8082,0x2014) channel 0 unit 0 : ata | IBM-DBCA-204860 | BC3OA87F ATA device not present or not responding Welcome to SmartFirmware(tm) for bplan EFIKA5K2 Version 1.3 (20061107101950) SmartFirmware(tm) Copyright 1996-2001 by CodeGen, Inc. All Rights Reserved. Pegasos BIOS Extensions Copyright 2001-2006 by bplan GmbH. All Rights Reserved. ok
In this scenario we have a 2.5" 4.8GB hard disk drive and a 256MB USB pendrive attached on the EFIKA. Here you can see the situation from the OF prompt:
ok devalias Alias Device Path -------------------------------------------------- ide /builtin/ata/disk@0,0 hd /builtin/ata/disk@0,0 scsi /builtin/usb/scsi@1/disk@0,0 hd0 /builtin/usb/scsi@1/disk@0,0 eth /builtin/ethernet ok ls hd0 DOS partition 0: linux (0x83) DOS partition 1: fat32/lba (0xC) ok
We are going to install CRUX PPC on the 4.8GB HDD (ide) using an USB pendrive (scsi) already partitioned with GNU Parted :
GNU Parted 1.8.2 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: WinFast Disk 256 MB (scsi) Disk /dev/sdb: 258MB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 31.7kB 36.3MB 36.3MB primary ext2 2 36.3MB 258MB 221MB primary fat32 lba
We have copied our kernel image on the USB pendrive into the ext2 partition as you can see from OF prompt too:
ok ls hd0:0 . .. lost+found zImage-Efika ok
Let's go to prepare the board for netbooting. It's possible to set the EFIKA's ip for TFTP and the TFTP server's ip address in NVRAM (instead of specifying them in the boot command), for further info about this OF release please refer to Genesi EFIKA HowTo Guide. Here just an example:
ok setenv server-ip 192.168.0.11 server-ip = 192.168.0.11 ok setenv client-ip 192.168.0.27 client-ip = 192.168.0.27
But we have choose to fetch the kernel and start the boot process, simply, from our USB pendrive then:
ok boot hd0:0 zImage-Efika nfsaddrs=cip:sip:gip:netm nfsroot=/mnt/hd0 console=ttyPSC0 panic=10
replacing in nfsaddres argument with:
- sip: ip address of your server (e.g. 192.168.0.11)
- cip: ip address of your client (e.g. 192.168.0.27)
- gip: ip address of your gateway (e.g. _blank_) (optionally)
- netm: your netmask (e.g. 255.255.255.0)
we now have:
ok boot hd0:0 zImage-Efika nfsaddrs=192.168.0.27:192.168.0.11::255.255.255.0 nfsroot=/mnt/hd0 console=ttyPSC0 panic=10
If all the procedure goes well, you should see on your own serial terminal the following.
zImage starting: loaded at 0x00400000 (sp: 0x017ffe90) Allocating 0x4aaf1c bytes for kernel ... OF version = 'EFIKA5K2,1.3' gunzipping (0x1800000 <- 0x407000:0x61ae01)...done 0x48c6b0 bytes Finalizing device tree... using OF tree (promptr=01003ed8) OF stdout device is: /failsafe command line: nfsaddrs=192.168.0.27:192.168.0.11::255.255.255.0 nfsroot=/mnt/0 memory layout at init: alloc_bottom : 01caf000 alloc_top : 30000000 alloc_top_hi : f000c000 rmo_top : 30000000 ram_top : f000c000 Looking for displays instantiating rtas at 0x07ffb000 ... done Applying EFIKA device tree fixups copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x01cb0000 -> 0x01cb06c6 Device tree struct 0x01cb1000 -> 0x01cb3000 Calling quiesce ... returning from prom_init Using Efika machine description Linux version 2.6.20-Efika (root) (gcc version 4.0.3 (CRUX PPC)) #1 Mon F7 arch/powerpc/platforms/52xx/efika-pci.c: PCI bus 0 controlled by /pci Zone PFN ranges: DMA 0 -> 32768 Normal 32768 -> 32768 early_node_map[1] active PFN ranges 0: 0 -> 32768 Built 1 zonelists. Total pages: 32512 Kernel command line: nfsaddrs=192.168.0.27:192.168.0.11::255.255.255.0 nfsroo0 MPC52xx PIC is up and running! PID hash table entries: 512 (order: 9, 2048 bytes) Console: colour dummy device 80x25 Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 125012k/131072k available (4324k kernel code, 5904k reserved, 184k dat) Mount-cache hash table entries: 512 NET: Registered protocol family 16 PCI: Probing PCI hardware MPC52xx BestComm inited Generic PHY: Registered new driver SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 4096 bind 2048) TCP reno registered JFS: nTxBlock = 977, nTxLock = 7823 SGI XFS with no debug enabled io scheduler noop registered io scheduler cfq registered (default) Generic RTC Driver v1.07 Macintosh non-volatile memory driver v1.1 Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled Serial: MPC52xx PSC UART driver f0002000.serial: ttyPSC0 at MMIO 0xf0002000 (irq = 129) is a MPC52xx PSC RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize loop: loaded (max 8 devices) eth0: mpc52xx-fec at 0xf0003000,<6>eth0: Phy @ 0x10, type GENERIC (0x00008201) Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx ata: MPC52xx IDE/ATA libata driver ata1: PATA max PIO4 cmd 0x0 ctl 0xC9006A5C bmdma 0x0 irq 135 scsi0 : mpc52xx_ata ata1.00: ATA-4, max UDMA/33, 9514260 sectors: LBA ata1.00: ata1: dev 0 multi count 0 ata1.00: configured for PIO4 scsi 0:0:0:0: Direct-Access ATA IBM-DBCA-204860 BC3O PQ: 0 ANSI: 5 SCSI device sda: 9514260 512-byte hdwr sectors (4871 MB) sda: Write Protect is off SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPA SCSI device sda: 9514260 512-byte hdwr sectors (4871 MB) sda: Write Protect is off SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPA sda: RDSK (512) sda1 (SWP^@)(res 2 spb 1) sda2 (LNX^@)(res 2 spb 1) sda3 (RFS) sd 0:0:0:0: Attached scsi disk sda sd 0:0:0:0: Attached scsi generic sg0 type 0 ppc-of-ohci f0001000.usb: OF OHCI ppc-of-ohci f0001000.usb: new USB bus registered, assigned bus number 1 ppc-of-ohci f0001000.usb: irq 134, io mem 0xf0001000 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected Initializing USB Mass Storage driver... usb 1-2: new full speed USB device using ppc-of-ohci and address 2 usb 1-2: configuration #1 chosen from 1 choice scsi1 : SCSI emulation for USB Mass Storage devices usbcore: registered new interface driver usb-storage USB Mass Storage support registered. usbcore: registered new interface driver usbhid drivers/usb/input/hid-core.c: v2.6:USB HID core driver mice: PS/2 mouse device common for all mice i2c /dev entries driver i2c-parport: adapter type unspecified TCP cubic registered NET: Registered protocol family 1 NET: Registered protocol family 10 NET: Registered protocol family 17 drivers/rtc/hctosys.c: unable to open rtc device (rtc0) eth0: config: auto-negotiation on, 100HDX, 10HDX. IP-Config: Complete: device=eth0, addr=192.168.0.27, mask=255.255.255.0, gw=255.255.255.255, host=192.168.0.27, domain=, nis-domain=(none), bootserver=192.168.0.11, rootserver=192.168.0.11, rootpath= Looking up port of RPC 100003/2 on 192.168.0.11 Looking up port of RPC 100005/1 on 192.168.0.11 VFS: Mounted root (nfs filesystem) readonly. Freeing unused kernel memory: 180k init INIT: version 2.86 booting The system is coming up. Please wait. scsi 1:0:0:0: Direct-Access WinFast Disk 256 MB PQ: 0 ANSI: 2 SCSI device sdb: 503808 512-byte hdwr sectors (258 MB) sdb: Write Protect is off sdb: assuming drive cache: write through SCSI device sdb: 503808 512-byte hdwr sectors (258 MB) sdb: Write Protect is off sdb: assuming drive cache: write through sdb: sdb1 sdb2 sd 1:0:0:0: Attached scsi removable disk sdb sd 1:0:0:0: Attached scsi generic sg1 type 0 INIT: Entering runlevel: 2 CRUX PPC (ttyPSC0) login:
And you can be happy to start a standard CRUX PPC installation!
CRUX PPC (ttyPSC0) login: root You should really read the CRUX PPC Install Guide to make sure you know how to install CRUX PPC. The Install Guide is part of the CRUX PPC HandBook, it's available on our website, you can read it online or open it here: vi /crux/handbook.txt Greetings from the CRUX PPC team! http://cruxppc.sunsite.dk No mail. # uname -a Linux 192.168.0.27 2.6.20-Efika #1 Mon Feb 5 14:21:01 UTC 2007 ppc GNU/Linux
Hard Drive install from CDROM
It's an easy way. If you have an adaptor you are able to install directly from CDROM otherwise you can install a basic system, from another PowerPC, into an 2.5" disk through USB cable and then move it on EFIKA.
For further info please refer to CRUX PPC Handbook for a regular installation.
Hard Drive install from USB pendrive
It's the easiest way but the slowest one caused by USB 1.1 data transfer rate. You can copy the content from the ISO to an USB pendrive already prepared with GNU Parted (remember msdos or amiga partition table and formatted as ext2 with 128-byte inodes).
Then you are able to start:
boot scsi:0 ppc/efika/zImage.chrp root=/dev/sdb1 rootdelay=5 panic=10 console=ttyPSC0
For further info please refer to CRUX PPC Handbook for a regular installation.
The Future
In the near future we'll release a starter kit and we're considering two options and probably we'll produce both..
A first solution is a very trimmed system in a tar file, so it's ready to be untarred on an usb pendrive and then configured and used, or used for a more complete install on some other media. The second one is a live CD for PPC and a live CD for x86 with TFTP server and NFS share ready, so the EFIKA can boot the installer from network.