Step-by-step NFS-mounted Root File System

From odroid US
Revision as of 21:21, 17 January 2013 by Osterluk (Talk | contribs)

Jump to: navigation, search

THIS TOPIC ACTIVELY BEING EDITED. IT IS NOT COMPLETE

This tutorial is for Developers

Introduction

A common technique for embedded development is to NFS-mount your root file system. This means that all files are actually on a host. The host is configured to export the filesystem. The target (odroid) mounts the filesystem at boot time and uses it as its own. All files are visible on the host.

As targets have increased in storage capacity and speed, the need for NFS-mounting root file systems will decrease. The technique is still useful when bringing up a new port or you have a lot of files that need to change together.

It is common to check in a whole root file system into a source control system for quality control.


Prerequisites

  • You need to be able to edit files on the odroid, or how to move them to a host and back for editing
  • You need to know how to build a kernel. There are many ways to do it. This tutorial walks through a native kernel build: Kernel Compiling
  • You need to know how to abort booting at the u-boot console. [http://odroid.us/mediawiki/index.php?title=U-boot_Topics&action=view&section=5 Abort boot at u-boot console]
  • You will need some patience... NFS exporting and mounting can be frustrating

    Overview

    We are going to:

  • Add some u-boot environment variables to steer the boot process
  • Mount the boot partition read/write
  • Compile a custom u-boot script to add parameters to the kernel command line
  • Replace the standard boot.scr with our custom one
  • Setup the root file system directory
  • Configure NFS-exports
  • Test the NFS server
  • reboot and see that we actually are running from files living on the host