[beagleboard] Booting beagle via NFS from usb

I have been trying to get the BB boot from a root filesystem on my
system's (Fedora 12) NFS directory. However, despite reading this and
other forums/wikis and the Building Embedded Linux systems ebook, I am
no closer to my goal. I think I am missing something very obvious. Any
pointers, suggestions or ways to troubleshoot would be much
appreciated.

Here are the steps I followed:
1. Compiled linux-omap-2.6 kernel with USB support.

2. Edited the /etc/exports file:
/home/akshay/nfsdir
192.168.1.102(rw,async,no_subtree_check,no_root_squash)

3. Added file ifcfg-usb0 to /etc/sysconfig/network-scripts/
DEVICE=usb0
IPADDR=192.168.1.8
NETMASK=255.255.255.0
ONBOOT=no
TYPE=USB
BOOTPROTO=none
USERCTL=no
NM_CONTROLLED=no
IPV6INIT=no
PEERDNS=yes

4. Edited the /etc/hosts.allow:
rpcbind:ALL
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

In the /etc/sysconfig/nfs, enabled the following:
RQUOTAD
RQUOTAD_PORT=875
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
STATD_PORT=662
STATD_OUTGOING_PORT=2020

5. SELinux was already disabled. Firewall was disabled through the
Firewall Manager for this exercise. So were the iptables using: sudo
service iptables stop

6. Typed the following commands at the prompt:
service rpcbind restart
service nfs restart
(Both restarted successfully)

7. At the BB console, typed the following:
#setenv bootargs 'console=ttyS2,115200n8 root=/dev/nfs
nfsroot=192.168.1.8:/home/akshay/nfsdir ip=192.168.1.102:255.255.255.0
nolock, rootdelay=2'
#boot

8. BB proceeded to boot the kernel successfully until it stalls here:
mmc0: new high speed SD card at address 1234
mmcblk0: mmc0:1234 SA02G 1.83 GiB
mmcblk0: p1
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
     device=usb0, addr=192.168.1.102, mask=255.255.255.0,
gw=255.255.255.255,
     host=192.168.1.102, domain=, nis-domain=(none),
     bootserver=255.255.255.0, rootserver=192.168.1.8, rootpath=
Waiting 2sec before mounting root device...
Looking up port of RPC 100003/2 on 192.168.1.8
rpcbind: server 192.168.1.8 not responding, timed out
Root-NFS: Unable to get nfsd port number from server, using default
Looking up port of RPC 100005/1 on 192.168.1.8
rpcbind: server 192.168.1.8 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
Root-NFS: Server returned error -110 while mounting /home/akshay/
nfsdir
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "(null)" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available
partitions:
b300 1921024 mmcblk0 driver: mmcblk
  b301 72261 mmcblk0p1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-
block(2,0)

When I run ifconfig on my laptop, it shows usb0 device as being
present. Could it be that the ip address is still being dynamically
assigned?

Thanks,

Have you tried to ping the BeagleBoard (192.168.1.102) from your
host (192.168.1.8), after it's booted, while it's trying to look
up the RPC services? This will tell you if the network is working.

Thanks for the suggestion, Gary.

After the BB began booting, I pinged it from my host:
$ ping 192.168.1.102
PING 192.168.1.102 (192.168.1.102) 56(84) bytes of data.
From 192.168.1.104 icmp_seq=2 Destination Host Unreachable
From 192.168.1.104 icmp_seq=3 Destination Host Unreachable
...
--- 192.168.1.102 ping statistics ---
17 packets transmitted, 0 received, +12 errors, 100% packet loss, time
16442ms
pipe 3

So the network is not working.
rpcinfo gives me:

$rpcinfo -p
   program vers proto port service
    100000 4 tcp 111 portmapper
    100000 3 tcp 111 portmapper
    100000 2 tcp 111 portmapper
    100000 4 udp 111 portmapper
    100000 3 udp 111 portmapper
    100000 2 udp 111 portmapper
    100011 1 udp 875 rquotad
    100011 2 udp 875 rquotad
    100011 1 tcp 875 rquotad
    100011 2 tcp 875 rquotad
    100021 1 udp 32769 nlockmgr
    100021 3 udp 32769 nlockmgr
    100021 4 udp 32769 nlockmgr
    100021 1 tcp 32803 nlockmgr
    100021 3 tcp 32803 nlockmgr
    100021 4 tcp 32803 nlockmgr
    100003 2 tcp 2049 nfs
    100003 3 tcp 2049 nfs
    100003 4 tcp 2049 nfs
    100003 2 udp 2049 nfs
    100003 3 udp 2049 nfs
    100003 4 udp 2049 nfs
    100005 1 udp 892 mountd
    100005 1 tcp 892 mountd
    100005 2 udp 892 mountd
    100005 2 tcp 892 mountd
    100005 3 udp 892 mountd
    100005 3 tcp 892 mountd

And ifconfig shows me (x= masked):
usb0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:756 (756.0 b) TX bytes:2862 (2.7 KiB)

Also, on gtkterm I noticed this in the boot log (x=masked):
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
g_ether gadget: using random self ethernet address
g_ether gadget: using random host ethernet address
usb0: MAC xx:xx:xx:xx:xx:xx
usb0: HOST MAC xx:xx:xx:xx:xx:xx
g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
g_ether gadget: g_ether ready

It seems to me that usb0 is being assigned a random ip address.
However, in ifconfig-usb0, I have set the following:
IPADDR=192.168.1.8
...
NM_CONTROLLED=no
IPV6INIT=no

Any suggestions on what I ought to do next? Is usb0 indeed being
assigned a random IP?

Thanks much,

You can reference here:
http://elinux.org/Mount_BeagleBoard_Root_Filesystem_over_NFS_via_USB

Thanks, Hieu but I had already consulted that wiki page and found it
very useful. However, I think the article concentrates on bridging
eth0 to usb0 and it is not what I want to do.

After having another look at the ifconfig: usb0 status, I think that
my Fedora OS might still be enabling IPv6 even though ifcfg-usb0 has
IPv6INIT=no. Any thoughts?

I suspect that usb0 isn’t being brought up automatically on the host… don’t worry about the IPv6 address as this is automatic. Try doing an “sudo ifup usb0” (on the host) to see if that configures the IP address properly. My usb0 is rarely configured properly, even though its set to “auto” in /etc/network/interfaces. You could use the documentation’s example of hooking into udev scripts to be a little more aggressive about bringing the interface up and configuring the IP address :slight_smile:

I suspect that usb0 isn’t being brought up automatically on the host… don’t worry about the IPv6 address as this is automatic. Try doing an “sudo ifup usb0” (on the host) to see if that configures the IP address properly. My usb0 is rarely configured properly, even though its set to “auto” in /etc/network/interfaces. You could use the documentation’s example of hooking into udev scripts to be a little more aggressive about bringing the interface up and configuring the IP address :slight_smile:

Also try to snoop packets over usb0 via ethreal or wireshark, just to confirm whether anything is getting received on usb0 or not.

~cnanda