FPGARM4ULinux RFS

From Fpga4u

Jump to: navigation, search

Root file system

Get and configure the Root file system

Download the packages for a basic Root File System from the Debian repository

# cd /root/
# debootstrap --verbose --foreign --arch arm etch ./RFS http://ftp.ch.debian.org/debian

Go back to the Linux's sources directory and install the modules.

# cd /root/linux-2.6.24.7/
# make modules_install INSTALL_MOD_PATH=/root/RFS

Then, go to the config_rfs directory and run the script config.sh.

# cd /root/config_rfs/
# ./config.sh

If you would like to access the Internet through a RJ-45 wire, you have to follow the instructions below. Otherwise, you should follow this guide.

You have to edit the MAC address of your FPGARM4U and uncomment the two lines above it. Two bytes are missing. The first four bytes are used in this way : 3 bytes for the EPFL MAC addresses class, 1 byte for the FPGARM4U subclass.

Look at the allocated MAC addresses list for knowing what MAC address you can use. Or, if you are doing a course with the FPGARM4U, look at your sheet.

For modifying the MAC address, you have to edit the hwaddress field in the interfaces file. Replace the two bytes marked as XX with your number.

# vim /root/RFS/etc/network/interfaces

Go to the RFS directory and compress the files.

# cd /root/RFS/
# tar cpvzf fpgarm4u_rfs.tar.gz *

Move the file into the final directory.

# mv fpgarm4u_rfs.tar.gz /root/final/

Autonomous system : prepare the USB Key

Clean an USB disk which will be used to store the RFS. <X> has to be replaced by the right letter (usually b) in this virtual machine.

# dd if=/dev/zero of=/dev/sd<X> bs=4M

Create two partitions in the USB disk. The first will be used for the root file system and the second as swap.

Name Flags Part Type FS Type Size
sd<X>1 Boot Primary Linux (83) as much as you can
sd<X>2 Primary Linux swap / Solaris (82) 128 MB

If you do not want to create a swap, please delete the line swap in /root/RFS/etc/fstab.

# cfdisk /dev/sd<X>

Format the root partition as ext2 file system.

# mkfs.ext2 /dev/sd<X>1

Indicate that the swap partition is a swap partition.

# mkswap /dev/sd<X>2

Mount the USB key and untar the compressed RFS in the new partition. Then unmount the USB key et remove it from the computer.

# pmount /dev/sd<X>1
# cd /media/sd<X>1
# tar xzf /root/final/fpgarm4u_rfs.tar.gz
# cd /root/
# pumount /media/sd<X>1

Note :

In case of you would like to format a fat32 partition, you can use mkfs.vfat of the dosfstools package.

# apt-get install dosfstools
# mkfs.vfat -F 32 /dev/sdXY

NFS system : finalise the installation of the NFS server

Copy the new Root File System into the repertory of the server NFS.

# cp -r /root/RFS/* /srv/rfs/

Edit the /etc/fstab file of the new root file system (this one we just copied). Below is what the file has to look like. Replace <ip_server> by the IP address of the server.

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
<ip_server>:/srv/rfs      /        ext3    defaults,continue    0    0

All the files inside the directory /srv/rfs/ are available for the connection by the client machine (FPGARM4U).

Personal tools