Installing Fedora Core 7 Linux on AMCC PPC 440EPx "Sequoia" Board
Abstract
This Application Note describes how to install the Fedora Core 7
Linux distribution on the AMCC PPC 440EPx
"Sequoia" Board.
Note: this guide will also work on other PowerPC systems which
are based on a 32 bit
CPU with a full Floating Point Unit (FPU),
like the AMCC PPC 440EP ("Yosemite" board),
Freescale MPC5200 ("Lite5200B" etc.), Freescale MPC82xx, etc.
Note that a 2.6 kernel is required.
Supported Target Environments
The installation of Fedora Core 7 requires a storage device.
Depending on available hardware and/or project requirements you may
want to use ATA, S-ATA or SCSI harddisk drives;
alternatively, a pure NFS network
server based installation may be used.
Installation Requirements
In addition to the AMCC PPC 440EPx "Sequoia" evaluation board
you need the following hardware and software components:
- a DENX ELDK 4.x based Linux development host
which must be configured
to provide access to the serial console port
and to work as a TFTP and NFS server.
Please see http://www.denx.de/wiki/view/DULG/SystemSetup
for details.
- a storage device for the Fedora Core 7 file systems; typically this will
be a harddisk drive
- a storage controller to attach harddisk drive to
the "Sequoia" board; in this case we use standard ATA drives:
Here we use a IT8212 PCI ATA controller.
Unfortunately there is a small problem with this
controller, i. e. the current driver code does not work with
DMA enabled, so we have to patch the Linux kernel code to
disable DMA, for example with this patch:
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index e9bad18..31906ce 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -703,9 +703,9 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
if (!hwif->dma_base)
goto fallback;
- hwif->ultra_mask = 0x7f;
- hwif->mwdma_mask = 0x07;
- hwif->swdma_mask = 0x07;
+// hwif->ultra_mask = 0x7f;
+// hwif->mwdma_mask = 0x07;
+// hwif->swdma_mask = 0x07;
hwif->ide_dma_check = &it821x_config_drive_for_dma;
if (!(hwif->udma_four))
Also, we must disable RAID mode of this driver by passing a
"it821x.noraid=1" boot argument to the Linux kernel.
Please use this kernel configuration file.
Preparations:
- On the host system,
select your preferred Fedora Core 7 mirror site,
create a directory in the ELDK target file system
and download a minimal set of Fedora Core 7 RPM's:
$ MIRROR=ftp://ftp-stud.fht-esslingen.de/pub/fedora/linux/core/development/ppc/os/Fedora
$ cd /opt/eldk/ppc_6xx/tmp/
$ mkdir FC7
$ cd FC7
$ while read rpm ; do wget "${MIRROR}/${rpm}"; done <fc7-stage1.list
- Boot target system with root file system over NFS
and verify that you can access the downloaded Fedora Core 7 RPM's:
# cd /tmp/FC7/
# ls
...
- Create a working directory for a (temporary) installation
of a minimal Fedora Core 7 system:
# mkdir /tmp/FC7/work
- Install the downloaded RPM's into this working directory:
# cd /tmp/FC7/
# rpm --root=/tmp/FC7/work --initdb
# rpm --root=/tmp/FC7/work -i --nodeps *.rpm
You will see a lot of error messages and warnings, please ignore these.
- Run a second round of RPM installation.
Yes, this is a quick and dirty hack,
but we will use this stuff just once and then throw it away:
# rpm --root=/tmp/FC7/work -i --nodeps --replacepkgs coreutils-*.rpm
# rpm --root=/tmp/FC7/work -i --nodeps --replacepkgs *.rpm
Now you should see just a single warning
"... Header V3 DSA signature: NOKEY ..."
and a few error messages "... unable to flush ..."
- Populate the
/dev directory in our work environment:
# find /dev | cpio -pdum /tmp/FC7/work/
Make sure that /tmp/FC7/work/dev now contains especially the necessary device nodes
für your disk drive, i. e. the required hd* or sd* entries.
- Format your disk as seems fit using
fdisk,
create an ext3 file system on the chosen partition:
# mke2fs -m1 -j /dev/hda6
- Now use
chroot to start a shell in our newly created temporary
Fedora Core 7 environment.
# chroot /tmp/FC7/work /bin/bash
Note: depending on your configuration, you may have to adjust network
configuration in this chroot environment; for example, you may have
to create a "/etc/resolv.conf" file.
- Mount the /proc file system, nd the partition where the real Fedora core 7
shall beinstalled into:
# touch /etc/fstab
# mount -t proc proc /proc
# mount -t ext3 /dev/hda6 /mnt
- Initialize RPM database on your target file system and
install the
"fedora-release-*" RPMs:
# mkdir -p /mnt/var/lib/rpm
# rpm --root=/mnt --initdb
# MIRROR=ftp://ftp-stud.fht-esslingen.de/pub/fedora/linux/core/development/ppc/os/Fedora
# wget ${MIRROR}/fedora-release-*.noarch.rpm
# rpm --root=/mnt -ivh --nodeps fedora-release-*.noarch.rpm
- Now use the
"yum" tool to perform a full installation of the "Base" system:
# yum --installroot=/mnt -y groupinstall Base
- Download
Gentoo "stage3" image for PowerPC:
$ cd /opt/eldk/ppc_4xxFP/tmp/
$ ncftpget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/releases/ppc/2006.1/ppc32/stages/stage3-ppc-2006.1.tar.bz2
- Download latest "portage" image:
$ cd /opt/eldk/ppc_4xxFP/tmp/
$ ncftpget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/snapshots/portage-latest.tar.bz2
- Configure and build the Linux kernel:
-> cp sequoia.config-??? .config
-> make ARCH=PPC CROSS_COMPILE=ppc_4xxFP- oldconfig
-> make ARCH=PPC CROSS_COMPILE=ppc_4xxFP- uImage
Alternatively, use one of the provided kernel images:
| For ATA disk drives | using an IT8212 PCI ATA controller: | uImage-IT8212 |
- Copy the kernel image to TFTP directory:
-> cp -vp arch/ppc/boot/images/uImage /tftpboot/sequoia/
- Set up the target board for standard operation with ELDK.
Boot with the ELDK provided root file system mounted over NFS.
For details please see the DULG.
The following U-Boot variable settings were used for this example installation:
=> setenv bootfile /tftpboot/sequoia/uImage
=> setenv nfsargs 'setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}'
=> setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off'
=> setenv addtty 'setenv bootargs ${bootargs} console=ttyS0,${baudrate}'
=> setenv addmisc 'setenv bootargs ${bootargs} ${more_args}'
=> setenv more_args panic=1 it821x.noraid=1
=> setenv net_nfs 'tftp 400000 ${bootfile};run nfsargs addip addtty addmisc;bootm'
=> saveenv
With these settings, you can start the installation
by typing:
=> run net_nfs
- Use
"fdisk" to partition your
harddisk. Create a small partition (say, 1 GiB) for swap space
and a bigger one (say, 16 GiB) as root file system.
Use "mkswap" to initialize the swap partition,
and "mke2fs" to create an ext3 file system:
bash-2.05b# fdisk /dev/hda
...
bash-2.05b# mkswap /dev/hda1
bash-2.05b# mke2fs -j /dev/hda3
- The mount the partition that shall become your root file system on
some directory:
bash-2.05b# mount /dev/hda3 /mnt
- Also make sure your target has at least a somewhat reasonable
setting of the system time; for example, run:
bash-2.05b# ntpdate -b 0.pool.ntp.org
This assumes that you have set up your network correctly to
provide valid default route and name servers.
- Then uncompress the Gentoo "stage3" tarball into the target file system:
bash-3.00# cd /mnt
bash-3.00# tar -jxpf /tmp/stage3-ppc-2006.1.tar.bz2
- Install the Gentoo Portage snapshot into the
"/usr" directory of
the target root file system:
bash-3.00# cd /mnt/usr
bash-3.00# tar -jxpf /tmp/portage-latest.tar.bz2
See also:
Installing the Gentoo Installation Files
Installing the Gentoo Base System
- Now prepare the runtime environment on the target
by running the Gentoo distribution in a
chroot environment:
bash-3.00# chroot /mnt /bin/bash
- Set up network configuration:
sequoia / # echo nameserver 192.168.0.1 >/etc/resolv.conf
sequoia / # mount -t proc proc /proc
sequoia / # route add default gw 192.168.0.1
Note: these settings are temporary,
i. e. they will not persist when you reboot the system.
- Adjust
"/etc/make.conf" (if needed)
- Install
"mirrorselect" tool:
sequoia / # emerge mirrorselect
- Run mirrorselect to update GENTOO_MIRRORS and SYNC variable settings:
sequoia / # mirrorselect -i -o >>/etc/make.conf
Please select your desired mirrors:
[X] Uni Erlangen-Nürnberg (Germany/ftp)
[X] University of Applied Sciences, Esslingen
[X] Intergenia AG (Germany/http)
[X] files.gentoo.org
sequoia / # mirrorselect -i -r -o >>/etc/make.conf
Please select your desired mirror:
[X] Europe
- Now we can update the portage tree:
sequoia / # emerge --sync --quiet
- Now let's add some useful tools we need later:
vim, syslog-ng, vixie-cron, and slocate
sequoia / # emerge vim
sequoia / # emerge syslog-ng
sequoia / # rc-update add syslog-ng default
sequoia / # emerge vixie-cron
sequoia / # rc-update add vixie-cron default
sequoia / # emerge slocate
sequoia / # emerge xinetd
sequoia / # rc-update add xinetd default
sequoia / # emerge ntp
- Finally, we adjust the system configuration to our needs:
- Patch
/etc/locale.gen
- Patch
/etc/rc.conf
- Patch
/etc/fstab
- Patch
/etc/conf.d/hostname
- Patch
/etc/conf.d/net
NOTE: insert your own network settings here!
- Patch
/etc/inittab
- Set timezone:
sequoia / # cp -p /usr/share/zoneinfo/MET /etc/localtime
- Add net.eth0 to the default runlevel:
sequoia / # rc-update add net.eth0 default
- Set the root password (we used
"1tux@work" in this example):
sequoia / # passwd
- Add "console" (was: "tts/0") to /etc/securetty
sequoia / # echo console >> /etc/securetty
- Enable ssh deamon:
sequoia / # rc-update add sshd default
- Since we don't have a RTC on the Sequoia board,
we modify the system to use NTP to initialize the system time:
- State saved as: gentoo-ppc-stage.DNX1-2007-01-08.tar.bz2
- Reboot the system, and adjust boot arguments to boot from the
newly installed root file system:
=> setenv gentoo 'tftp 400000 ${bootfile};setenv bootargs root=/dev/hda3 ro;run addip addtty addmisc;bootm 400000'
=> saveenv
=> run gentoo
This should boot you into a Gentoo Linux system; log in on the serial
console as user "denx", password "1tux@work".
--
WolfgangDenk - 19 Mar 2007