Aug 1, 2009

Boot the Beagleboard with NFS through USB

You need a USB cable and serial cable to connect from Beagleboard to your Linux host
Install
- NFS
- bridge-utils

1) Add file ifcfg-usb0 into /etc/sysconfig/network-scripts/
DEVICE=usb0
IPADDR=192.168.99.100            # Replace with your Linux host's IP address
NETMASK=255.255.255.0
ONBOOT=no
TYPE=USB
BOOTPROTO=none
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NM_CONTROLLED=no
TYPE=Ethernet

2) Add the ifcfg-br0 into /etc/sysconfig/network-script
# Ethernet Bridge
DEVICE=br0
ONBOOT=no
SEARCH="localhost"              # Replace with your search domains
BOOTPROTO=none
NETMASK=255.255.255.0           # Replace with your subnet's netmask
IPADDR=192.168.99.100           # Replace with your Linux host's IP address
USERCTL=no
PEERDNS=yes
IPV6INIT=no
GATEWAY=192.168.1.1             # Replace with your subnet's gateway
TYPE=Ethernet
DNS1=192.168.1.1                # Replace with your subnet's DNS
DOMAIN='localhost'                 # Replace with your Linux host's domain(s)
NM_CONTROLLED=no


4) Add br0 into /etc/init.d
#!/bin/bash

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# Check if all what named needs running
start()
{
   /usr/sbin/brctl addbr br0
   /usr/sbin/brctl addif br0 eth0
   /sbin/ifup eth0
   /sbin/ifup br0
   return 0;
}

stop() {
   /sbin/ifdown br0
   /sbin/ifdown eth0
   /usr/sbin/brctl delbr br0
}


restart() {
 stop
 start
} 

# See how we were called.
case "$1" in
 start)
  start
  ;;
 stop)
  stop
  ;;
 restart)
  restart
  ;;
 *)
         echo $"Usage: $0 {start|stop|restart}"
  exit 3
esac

exit $RETVAL

3) Setup NFS: add following line to /etc/exports
/data/nfs *(rw,no_root_squash,no_all_squash,async)

4) Create directory /data/nfs and tar your root filesystem to /data/nfs

5) Type following commands to restart the NFS service
#service rpcbind restart
#service nfs restart

6) On BeagleBoard console type following command.
OMAP3 beagleboard.org # setenv bootargs console=ttyS2,115200n8 root=/dev/nfs rw nfsroot=192.168.99.100:/data/nfs ip=192.168.99.101::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2

7) OMAP3 beagleboard.org # saveenv

8) OMAP3 beagleboard.org # mmcinit

9) OMAP3 beagleboard.org # fatload mmc 0 0x80300000 uImage

10) OMAP3 beagleboard.org # bootm 0x80300000

11) While the board is booting up, type ifconfig until you see the usb0 device is up. Then type `brctl addif br0 usb0`.

And enjoy the filesystem over NFS

Reference from http://elinux.org/Mount_BeagleBoard_Root_Filesystem_over_NFS_via_USB
Post a Comment