Creating a Debian RFS on Compact Flash

Creating a Debian RFS on a CF card is a two stage process. The first stage must be done on a standard x86 workstation but the second stage must be completed on the board itself.

Stage One:

Format the CF Card

On the card we will need two partitions one for the ACE file and one where we will place the RFS. We have mostly 2 GB CF cards so they were partitioned them as follows.

Partition Size Use
1 128 MB Ace File
2 1.9 GB Debian Root File System

Partitioning using parted, mkdosfs and mkfs.ext2

The command below partitions the drive as described above

FYI: Not yet tested

parted -s $CF_DEV rm 1 # Remove old partions
parted -s $CF_DEV rm 2
parted -s $CF_DEV mkpart primary fat16 0 128 # Create ACE Partition
parted -s $CF_DEV mkpart primary ext2 128 2048 # Create RFS Partition
mkdosfs -F 16 -R1 $CF_PART1
mkfs.ext2 $CF_PART2

Bootstrap using Debootstrap

In this next part will bootstrap a basic Debian system. Make sure you have internet access before attempting this part.

The first step is to mount your RFS partition. I choose to mount it to /mnt because it is common place to mount filesystems.

mount $CF_PART2 /mnt

Next using debootstrap generate an absolutely minimal Debian Etch RFS on the CF card.

debootstrap --arch powerpc --foreign etch /mnt

Stage Two:

Finish Bootstrap

At this point you have a bare minimal RFS for Debian. In order to make this a fully featured RFS you will need to boot the board using XMD or the System ACE. See BootingLinuxOnXUPV2P

There is only one special condition for booting this minimal RFS.
In Software->Software Platform And Settings select the OS and Libraries option and then append /bin/bash to the bootargs.

Once booted run this command to finish the bootstraping procedure

./debootstrap/debootstrap —second-stage

You now have a basic Debian RFS you can add more packages with apt-get and task-sel. I recommend running task-sel standard to install some basic neccesities.