(Initial version)
m (Setting up the Raspberry Pi to boot from Root NFS)
 
(6 intermediate revisions by one user not shown)
Line 18: Line 18:
 
</PRE>
 
</PRE>
  
You will now be presented with a menu. First select <B>p</B> to print the current partition table, ensuring you have selected the write disk.
+
You will now be presented with a menu. First select <B>p</B> to print the current partition table, ensuring you have selected the right disk.
  
 
If the disk is correct, delete any existing partitions.
 
If the disk is correct, delete any existing partitions.
  
Now select <B>n</B> to add a new partition. Select primary partition and other defaults.
+
Now select <B>n</B> to add a new partition. Select primary partition and any other defaults.
  
 
The default partition will now be set for linux. Select <B>t</B> to change a partition's system ID and enter <B>4</B> (FAT16 <32M)   
 
The default partition will now be set for linux. Select <B>t</B> to change a partition's system ID and enter <B>4</B> (FAT16 <32M)   
Line 57: Line 57:
 
wget https://github.com/raspberrypi/firmware/raw/master/boot/kernel.img
 
wget https://github.com/raspberrypi/firmware/raw/master/boot/kernel.img
 
</PRE>
 
</PRE>
 +
 +
Create a cmdline.txt file containing the following parameters:
 +
 +
<PRE>
 +
console=ttyAMA0,115200 root=/dev/nfs rw nfsroot=192.168.0.251:/home/cpeacock/export/rootfs ip=192.168.0.250:::::eth0 rootwait
 +
</PRE>
 +
 +
<I>The [http://www.raspberrypi.org/documentation/configuration/config-txt.md config.txt] file can be omitted if you are using default parameters.</I>
  
 
=== Prepared Image ===
 
=== Prepared Image ===
  
Below is a prepared FAT16 image. It can be restored using [http://sourceforge.net/projects/win32diskimager/files/latest/download Win32 Disk Imager]
+
Below is a prepared FAT16 image. It can be restored using the [http://sourceforge.net/projects/win32diskimager/files/latest/download Win32 Disk Imager]
 +
 
 +
* [http://wiki.beyondlogic.org/prebuilt/raspberrypi_nfsboot.zip Raspberry Pi NFS Boot] 4.5Mbytes <I>(Using 3.12.25+ Linux Kernel)</I>
  
* [http://wiki.beyondlogic.org/prebuilt/raspberrypi_nfsboot.zip Raspberry Pi NFS Boot] 4.5Mbytes
+
<BR>

Latest revision as of 11:36, 21 June 2014

Setting up the Raspberry Pi to boot from Root NFS

To assist with more rapid development, I prefer to mount the root filesystem from NFS.

Understanding the Raspberry Pi Boot Process details the bootloaders and files that are required to boot a Raspberry Pi.

I have a handful of 16 megabyte (yes, megabyte) MMC cards lying around that makes perfect boot media for this task.

Preparing the MMC

The Raspberry Pi will boot from either FAT32 or FAT16. The minimum volume size for FAT32 is 32 megabytes, hence if I'm to work with a 16 megabyte MMC, I must format the card with a FAT16 filesystem.

Partition the card using fdisk where /dev/sdb is your SD/MMC block device:

sudo fdisk /dev/sdb

You will now be presented with a menu. First select p to print the current partition table, ensuring you have selected the right disk.

If the disk is correct, delete any existing partitions.

Now select n to add a new partition. Select primary partition and any other defaults.

The default partition will now be set for linux. Select t to change a partition's system ID and enter 4 (FAT16 <32M)

Finally, write the partition table to disk and exit by selecting w.

Now format the card:

sudo mkdosfs /dev/sdb1

Mount the new file system, so you can add the required files:

sudo mount -t msdos /dev/sdb1 /media/card

Copy the following files over to your freshly formatted SD/MMC card:

bootcode.bin
start.elf
config.txt
cmdline.txt
kernel.img

You can obtain the files from an existing Raspberry Pi installation, or you can download them from the Raspberry Pi Git Repository:

wget https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
wget https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/kernel.img

Create a cmdline.txt file containing the following parameters:

console=ttyAMA0,115200 root=/dev/nfs rw nfsroot=192.168.0.251:/home/cpeacock/export/rootfs ip=192.168.0.250:::::eth0 rootwait

The config.txt file can be omitted if you are using default parameters.

Prepared Image

Below is a prepared FAT16 image. It can be restored using the Win32 Disk Imager