Installing Debian Etch on AMCC PPC 440EPx "Sequoia" Board
Abstract
This Application Note describes how to install the Debian 4.0 (Etch)
Linux distribution on the AMCC PPC 440EPx
"Sequoia" Board. There are other
ways to achieve the same result but still this document outlines the
general approach.
Author
This document was written by
ZuZhihui (zuzhihui {at} gmail {dot} com).
Installation Requirements
In order to install Debian Etch on the Sequoia board
you need the following hardware and software components:
- a target AMCC PPC 440EPx Sequoia board with a hard disk attached.
- a development host running DENX ELDK (4.1 or newer).
If you want to generate the image files (such as kernel image, ramdisk,
filesystem image and Debian image) by yourself, you also need:
- a powerpc running Linux
- AMCC's resource CD for 440EPx Sequoia evaluation kit
My hardware setup is:
- a Sequoia board with a Silicon Image Serial ATA hard disk.
- a Mac Mini with ppc CPU running Fedora Core 4
This Application Note is based on my hardware. If your setup is
different, you need to identify if you need to change the drivers.
Installation
Don't want to compile the images by yourself? Just want Debian Etch
to run on your board? Follow here. Otherwise please look at
Compile
Download Image Files
Download the following image files and put them into your tftp server:
Download
http://219.238.170.12/~john.zu/debian-amcc/ppc-etch-image.tgz and put them
where your tftp server can see them.
Boot
Boot the board:
tftp 200000 uImage.amcc
era FE000000 FE17FFFF
cp.b 200000 FE000000 ${filesize}
tftp 200000 ramdisk.img.amcc
era FE180000 FE3FFFFF
cp.b 200000 FE180000 ${filesize}
tftp 0x200000 sequoia.flashfs.amcc
era FE400000 FFF5FFFF
cp.b 0x200000 0xfe400000 ${filesize}
setenv bootcmd 'run flash_self'
setenv flash_self 'run ramargs addtty;bootm ${kernel_addr} ${ramdisk_addr}'
setenv addtty 'setenv bootargs ${bootargs} console=ttyS0,${baudrate}'
setenv kernel_addr FE000000
setenv ramdisk_addr FE180000
setenv baudrate 115200
setenv ramargs 'setenv bootargs root=/dev/ram rw'
saveenv
boot
Copy files to hard disk
The boot process should be smooth and leave you with a busybox prompt,
if this is not the case check that you followed the steps above closely.
Now use the
fdisk command to partition your hard disk.
The device name of the serial ATA hard disk should be
/dev/sda.
Create a new partition
/dev/sda1 with at least 200MB spaces.
fdisk /dev/sda
Now create a filesystem on
/dev/sda1 and extract the Debian image files to it.
Then reboot the board. Of course be sure to adjust the ftpget command to the mirror
you intend to use.
mkfs.ext2 /dev/sda1
mkdir /mnt/sata1
mount /dev/sda1 /mnt/sata1
cd /mnt/sata1
ftpget -u FTPUSER -p FTPPASSWORD FTPSERVER ppc-etch-image.tgz REMOTEPATH/ppc-etch-image.tgz
tar zxf ppc-etch-image.tgz
mv ppc-etch-image/* .
rm -rf ppc-etch-image*
cd
umount /mnt/sata1
reboot
Boot into Debian Etch
setenv bootcmd 'run flash_sata'
setenv flash_sata 'run sataargs addtty;bootm ${kernel_addr}'
setenv sataargs 'setenv bootargs root=/dev/sda1 rw'
saveenv
boot
Debian Etch should boot on your board, login, and apt-get what you need, enjoy!
Compile
Download AMCC resource CD
Download AMCC's resource CD for 440EPx Sequoia board at
http://www.amcc.com/Embedded/Downloads/download.html?item=458 and mount it to /mnt.
We need /mnt/software/linux/kernel/linux-2.6-denx.tar.gz and /mnt/software/linux/rootfs/filesystem.tar.gz
Compile Kernel
On the development host, compile kernel using kernel source from the AMCC resource CD:
make sequoia_defconfig
make menuconfig
make uImage
Be sure to select the following items while make menuconfig:
- File Systems --> ext3 journalling file system support
- General setup --> Configure standard kernel features --> Support for hot-pluggable devices
- The SATA driver, mine is Device drivers --> Serial ATA and Parallel ATA drivers --> Silicon Image SATA support
Because:
- We may use ext3 filesystem on hard disk
- The initrd(ramdisk) of Debian Etch depends on the hotplug support in kernel.
- Silicon SATA is my SATA driver, you may change it according to your SATA type.
When finished, rename the
uImage file to
uImage.amcc, that's the kernel image we need.
Compile Ramdisk and filesystem
Extract all the files from filesystem.tar.gz, read the README.filesystem file and follow it.
Then you should have the files
ramdisk.img and
sequoia.flashfs, rename them to
ramdisk.img.amcc,
sequoia.flashfs.amcc since they
are AMCC official.
Make Debian Etch Image
We'll bootstrap the Etch image using our Power Architecture® server.
The ppc server must run Linux, even better Debian Etch.
My ppc server runs Fedora 4 so I have to install
debootstrap on it.
You can skip installing debootstrap if you run Debian Etch on the ppc server.
These steps must be done by root:
cd
wget debootstrap_0.3.3.2_all.deb
mkdir tmp
ar -x ../debootstrap_0.3.3.2_all.deb
tar zxf data.tar.gz
mv usr/lib/debootstrap/ /
mv usr/sbin/debootstrap /debootstrap/
After debootstrap is installed, then we can bootstrap a Etch image:
debootstrap --arch powerpc etch /home/ppc-etch-image http://ftp.us.debian.org/debian
#chroot into it and make some changes:
LANG=C chroot ppc-etch-image/ /bin/bash
#remove the APT caches
apt-get clean
#modify the hostname
echo "etchamcc440" >/etc/hostname
Create the serial devices, because we'll let Linux console runs on serial port:
mount -t proc proc /proc
cd /dev
./MAKEDEV ttyS
umount /proc
Then we should modify the
/etc/fstab file, this file lists the filesystems to be mounted after boot.
My
/etc/fstab file looks like this:
/dev/sda1 / ext2 defaults 0 1
proc /proc proc defaults 0 0
Modify
/etc/network/interfaces file to configure the loopback network device.
The contents of
/etc/network/interfaces:
auto lo
iface lo inet loopback
Change the
/etc/hosts file as:
127.0.0.1 localhost localhost.localdomain etchamcc440
The most important change is in the
/etc/inittab file, we should
remove the line shown below since we do not want CTRL+ALT+DEL to reboot the system.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
Furtheron remove the following lines:
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
and add the line:
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
We only have the serial console, so we should only respawn the login program
on the serial console.
Now the Etch image is ready. We need to exit the chroot environment and make a tgz file of the Etch image. That's it!
exit
tar czf ppc-etch-image.tgz /home/ppc-etch-image