Booting root fs on nfs using Beagleboard xM and Angstrom

I'm trying to boot my root filesystem from a nfs export on my host
machine. I found a few guides for doing this using the regular
Beagleboard but none for the Beagleboard xM.

Here's what I'm doing:

1. Boot to SD card, press space to cancel autoboot.
2. mmcinfo
3. fatload mmc 0:1 0x80200000 /uImage
4. setenv bootargs console=ttyS2,115200n8 root=/dev/nfs
nfsroot=192.168.2.1:/home/myname/bbrootfs
ip=192.168.2.2::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2
5. bootm 0x80200000

The linux kernel starts but kernel panics. Here is the output:

OMAP3 beagleboard.org # bootm
0x80200000
## Booting kernel from Legacy Image at
80200000 ...
   Image Name: Angstrom/2.6.32/
beagleboard
   Image Type: ARM Linux Kernel Image
(uncompressed)
   Data Size: 3203024 Bytes = 3.1
MiB
   Load Address:
80008000
   Entry Point:
80008000
   Verifying Checksum ...
OK
   Loading Kernel Image ...
OK
OK

Starting
kernel ...

Uncompressing
Linux.................................................................................................................................
[ 0.000000] Linux version 2.6.32 (koen@dominion) (gcc version 4.3.3
(GCC) ) #3 PREEMPT Tue Jul 26 10:56:56 CEST
2011
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7),
cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing
instruction
cache
[ 0.000000] Machine: OMAP3 Beagle
Board
[ 0.000000] Memory policy: ECC disabled, Data cache
writeback
[ 0.000000] OMAP3630/DM3730 ES1.0 (l2cache iva sgx neon isp
192mhz_clk )
[ 0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size:
0x100000
[ 0.000000] Reserving 14680064 bytes SDRAM for
VRAM
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages:
130048
[ 0.000000] Kernel command line: console=ttyS2,115200n8 root=/dev/
nfs nfsroot=192.168.2.1:/home/myname/bbrootfs
ip=192.168.2.2::255.255.255.0 no2
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192
bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6,
262144
bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072
bytes)
[ 0.000000] Memory: 256MB 256MB = 512MB
total
[ 0.000000] Memory: 498304KB available (5900K code, 673K data, 204K
init, 0K
highmem)
[ 0.000000] Hierarchical RCU
implementation.
[ 0.000000] NR_IRQS:
402
[ 0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/600
MHz
[ 0.000000] Reprogramming SDRC clock to 332000000
Hz
[ 0.000000] GPMC revision
5.0
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96
interrupts
[ 0.000000] Total of 96 interrupts on 1 active
controller
[ 0.000000] OMAP GPIO hardware version
2.5
[ 0.000000] OMAP clockevent source: GPTIMER12 at 32768
Hz
[ 0.000000] Console: colour dummy device
80x30
[ 0.000000] Calibrating delay loop... 525.17 BogoMIPS
(lpj=2052096)
[ 0.000000] Mount-cache hash table entries:
512
[ 0.000000] CPU: Testing write buffer coherency:
ok
[ 0.000000] tmpfs: No value for mount option
'mode'
[ 0.000000] devtmpfs:
initialized
[ 0.000000] regulator: core version
0.5
[ 0.000000] NET: Registered protocol family
16
[ 0.000000] OMAP3 Beagle Rev: xM
C
[ 0.000000] Found NAND on
CS0
[ 0.000000] Registering NAND on
CS0
[ 0.000000] Unable to get DVI reset
GPIO
[ 0.000000] omap_init_mbox: platform not
supported
[ 85.827911] OMAP DMA hardware revision
5.0
[ 85.834197] bio: create slab <bio-0> at
0
[ 85.835418] SCSI subsystem
initialized
[ 85.836730] usbcore: registered new interface driver
usbfs
[ 85.836853] usbcore: registered new interface driver
hub
[ 85.837036] usbcore: registered new device driver
usb
[ 85.837371] i2c_omap i2c_omap.1: bus 1 rev4.0 at 2600
kHz
[ 85.840057] twl4030: PIH (irq 7) chaining IRQs
368..375
[ 85.840087] twl4030: power (irq 373) chaining IRQs
376..383
[ 85.840362] twl4030: gpio (irq 368) chaining IRQs
384..401
[ 85.842071] regulator: VUSB1V5: 1500 mV normal
standby
[ 85.842285] regulator: VUSB1V8: 1800 mV normal
standby
[ 85.842498] regulator: VUSB3V1: 3100 mV normal
standby
[ 85.843750] twl4030_usb twl4030_usb: Initialized TWL4030 USB
module
[ 85.844116] regulator: VMMC1: 1850 <--> 3150 mV normal
standby
[ 85.844360] regulator: VDAC: 1800 mV normal
standby
[ 85.844604] regulator: VPLL2: 1800 mV normal
standby
[ 85.844879] regulator: VSIM: 1800 <--> 3000 mV normal
standby
[ 85.845214] regulator: VAUX3: 1800 mV normal
standby
[ 85.845581] regulator: VAUX4: 1800 mV normal
standby
[ 85.845733] i2c_omap i2c_omap.2: bus 2 rev4.0 at 400
kHz
[ 85.845916] i2c_omap i2c_omap.3: bus 3 rev4.0 at 100
kHz
[ 85.847198] Switching to clocksource
32k_counter
[ 85.856384] musb_hdrc: version 6.0, musb-dma, otg (peripheral
+host),
debug=0
[ 85.860473] musb_hdrc: USB OTG mode controller at fa0ab000 using
DMA, IRQ
92
[ 85.860504] musb_hdrc musb_hdrc: MUSB HDRC host
driver
[ 85.860626] musb_hdrc musb_hdrc: new USB bus registered, assigned
bus number
1
[ 85.860748] usb usb1: New USB device found, idVendor=1d6b,
idProduct=0002
[ 85.860778] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 85.860778] usb usb1: Product: MUSB HDRC host
driver
[ 85.860809] usb usb1: Manufacturer: Linux 2.6.32 musb-
hcd
[ 85.860809] usb usb1: SerialNumber:
musb_hdrc
[ 85.861419] hub 1-0:1.0: USB hub
found
[ 85.861480] hub 1-0:1.0: 1 port
detected
[ 85.862487] NET: Registered protocol family
2
[ 85.862731] IP route cache hash table entries: 4096 (order: 2,
16384
bytes)
[ 85.863342] TCP established hash table entries: 16384 (order: 5,
131072
bytes)
[ 85.863739] TCP bind hash table entries: 16384 (order: 4, 65536
bytes)
[ 85.863922] TCP: Hash tables configured (established 16384 bind
16384)
[ 85.863952] TCP reno
registered
[ 85.863983] UDP hash table entries: 256 (order: 0, 4096
bytes)
[ 85.864013] UDP-Lite hash table entries: 256 (order: 0, 4096
bytes)
[ 85.864227] NET: Registered protocol family
1
[ 85.864654] RPC: Registered udp transport
module.
[ 85.864685] RPC: Registered tcp transport
module.
[ 85.864685] RPC: Registered tcp NFSv4.1 backchannel transport
module.
[ 85.865539] omap-iommu omap-iommu.0: isp
registered
[ 85.867248] VFS: Disk quotas
dquot_6.5.2
[ 85.867340] Dquot-cache hash table entries: 1024 (order 0, 4096
bytes)
[ 85.868377] squashfs: version 4.0 (2009/01/31) Phillip
Lougher
[ 85.869171] JFFS2 version 2.2. (NAND) (SUMMARY) �© 2001-2006 Red
Hat,
Inc.
[ 85.869995] msgmni has been set to
973
[ 85.873748] alg: No test for stdrng
(krng)
[ 85.874023] Block layer SCSI generic (bsg) driver version 0.4
loaded (major
254)
[ 85.874053] io scheduler noop
registered
[ 85.874053] io scheduler deadline
registered
[ 85.874206] io scheduler cfq registered
(default)
[ 85.933410] OMAP DSS rev
2.0
[ 85.933471] OMAP DISPC rev
3.0
[ 85.933532] OMAP VENC rev
2
[ 85.933746] OMAP DSI rev
1.0
[ 86.270263] Serial: 8250/16550 driver, 4 ports, IRQ sharing
enabled
[ 86.288970] serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a
ST16654
[ 86.307067] serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a
ST16654
[ 86.325134] serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a
ST16654
[ 86.875793] console [ttyS2]
enabled
[ 86.885925] brd: module
loaded
[ 86.892211] loop: module
loaded
[ 86.896759] omap2-nand driver
initializing
[ 86.901123] No NAND device
found!!!
[ 86.904846] No NAND device
found!!!
[ 86.909362] usbcore: registered new interface driver
catc
[ 86.914855] catc: v2.8:CATC EL1210A NetMate USB Ethernet
driver
[ 86.920928] usbcore: registered new interface driver
kaweth
[ 86.926544] pegasus: v0.6.14 (2006/09/27), Pegasus/Pegasus II USB
Ethernet
driver
[ 86.934173] usbcore: registered new interface driver
pegasus
[ 86.939880] rtl8150: v0.6.2 (2004/08/27):rtl8150 based usb-ethernet
driver
[ 86.946899] usbcore: registered new interface driver
rtl8150
[ 86.952667] usbcore: registered new interface driver
asix
[ 86.958190] usbcore: registered new interface driver
cdc_ether
[ 86.964141] usbcore: registered new interface driver
dm9601
[ 86.969879] usbcore: registered new interface driver
smsc95xx
[ 86.975738] usbcore: registered new interface driver
gl620a
[ 86.981445] usbcore: registered new interface driver
net1080
[ 86.987213] usbcore: registered new interface driver
plusb
[ 86.992828] usbcore: registered new interface driver
rndis_host
[ 86.998870] usbcore: registered new interface driver
cdc_subset
[ 87.004943] usbcore: registered new interface driver
zaurus
[ 87.010620] usbcore: registered new interface driver MOSCHIP usb-
ethernet
driver
[ 87.018676] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI)
Driver
[ 87.025512] ehci-omap ehci-omap.0: OMAP-EHCI Host
Controller
[ 87.031524] ehci-omap ehci-omap.0: new USB bus registered, assigned
bus number
2
[ 87.039123] ehci-omap ehci-omap.0: irq 77, io mem
0x48064800
[ 87.058319] ehci-omap ehci-omap.0: USB 2.0 started, EHCI
1.00
[ 87.064208] usb usb2: New USB device found, idVendor=1d6b,
idProduct=0002
[ 87.071075] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 87.078338] usb usb2: Product: OMAP-EHCI Host
Controller
[ 87.083709] usb usb2: Manufacturer: Linux 2.6.32
ehci_hcd
[ 87.089141] usb usb2: SerialNumber: ehci-omap.
0
[ 87.094390] hub 2-0:1.0: USB hub
found
[ 87.098236] hub 2-0:1.0: 3 ports
detected
[ 87.128692] Initializing USB Mass Storage
driver...
[ 87.133789] usbcore: registered new interface driver usb-
storage
[ 87.139862] USB Mass Storage support
registered.
[ 87.144897] mice: PS/2 mouse device common for all
mice
[ 87.150512] input: gpio-keys as /devices/platform/gpio-keys/input/
input0
[ 87.158325] input: twl4030_pwrbutton as /devices/platform/i2c_omap.
1/i2c-1/1-0049/twl4030_pwrbutton/input/
input1
[ 87.169036] i2c /dev entries
driver
[ 87.173126] Linux video capture interface:
v2.00
[ 87.178070] omap-iommu omap-iommu.0: isp: version
1.1
[ 87.184722]
vpfe_init
[ 87.187591] OMAP Watchdog Timer Rev 0x31: initial timeout 60
sec
[ 87.194335] cpuidle: using governor
ladder
[ 87.198486] cpuidle: using governor
menu
[ 87.308441] mmci-omap-hs mmci-omap-hs.1: err -16 configuring card
detect
[ 87.315460] Registered led device:
beagleboard::usr0
[ 87.320648] Registered led device:
beagleboard::usr1
[ 87.327148] Registered led device:
beagleboard::pmu_stat
[ 87.334228] usbcore: registered new interface driver
usbhid
[ 87.339904] usbhid: USB HID core
driver
[ 87.343933] Advanced Linux Sound Architecture Driver Version
1.0.21.
[ 87.350830] usbcore: registered new interface driver snd-usb-
audio
[ 87.426055] usb 2-2: new high speed USB device using ehci-omap and
address
2
[ 87.437805] No device for DAI omap-mcbsp-
dai-0
[ 87.442291] No device for DAI omap-mcbsp-
dai-1
[ 87.446777] No device for DAI omap-mcbsp-
dai-2
[ 87.451263] No device for DAI omap-mcbsp-
dai-3
[ 87.455749] No device for DAI omap-mcbsp-
dai-4
[ 87.460235] OMAP3 Beagle SoC
init
[ 87.464416] asoc: twl4030 <-> omap-mcbsp-dai-0 mapping
ok
[ 87.475921] ALSA device
list:
[ 87.478912] #0: omap3beagle
(twl4030)
[ 87.482910] oprofile: using arm/
armv7
[ 87.486816] TCP cubic
registered
[ 87.490112] NET: Registered protocol family
17
[ 87.494598] NET: Registered protocol family
15
[ 87.499206] lib80211: common routines for IEEE802.11
drivers
[ 87.504943] ThumbEE CPU extension
supported.
[ 87.509246] Power Management for TI
OMAP3.
[ 87.514617] SmartReflex driver
initialized
[ 87.518890] omap3beaglelmb: Driver registration
complete
[ 87.532623] VFP support v0.3: implementor 41 architecture 3 part 30
variant c rev
3
[ 87.540863] registered taskstats version
1
[ 87.558441] Console: switching to colour frame buffer device
80x30
[ 87.576965] regulator_init_complete: incomplete constraints,
leaving VAUX3
on
[ 87.584472] regulator_init_complete: incomplete constraints,
leaving VDAC
on
[ 87.592407] omap_vout omap_vout: probed for an unknown
device
[ 87.605957] usb 2-2: New USB device found, idVendor=0424,
idProduct=9514
[ 87.612701] usb 2-2: New USB device strings: Mfr=0, Product=0,
SerialNumber=0
[ 87.620574] hub 2-2:1.0: USB hub
found
[ 87.624572] hub 2-2:1.0: 5 ports
detected
[ 87.722351] mmc0: host does not support reading read-only switch.
assuming write-
enable.
[ 87.730560] mmc0: new high speed SDHC card at address
1234
[ 87.736511] mmcblk0: mmc0:1234 SA04G 3.63
GiB
[ 87.741333] mmcblk0: p1
p2
[ 87.925689] usb 2-2.1: new high speed USB device using ehci-omap
and address
3
[ 88.051330] usb 2-2.1: New USB device found, idVendor=0424,
idProduct=ec00
[ 88.058258] usb 2-2.1: New USB device strings: Mfr=0, Product=0,
SerialNumber=0
[ 88.068359] smsc95xx
v1.0.4
[ 88.105407] IP-Config: No network devices
available.
[ 88.110443] Waiting 2sec before mounting root
device...
[ 88.128814] usb0: register 'smsc95xx' at usb-ehci-omap.0-2.1,
smsc95xx USB 2.0 Ethernet, 6e:0f:b4:4c:3a:
4a
[ 90.121032] Looking up port of RPC 100003/2 on
192.168.2.1
[ 120.120819] rpcbind: server 192.168.2.1 not responding, timed
out
[ 120.127014] Root-NFS: Unable to get nfsd port number from server,
using
default
[ 120.134368] Looking up port of RPC 100005/1 on
192.168.2.1
[ 150.136444] rpcbind: server 192.168.2.1 not responding, timed
out
[ 150.142608] Root-NFS: Unable to get mountd port number from server,
using
default
[ 150.150268] Root-NFS: Server returned error -101 while mounting /
home/myname/
bbrootfs
[ 150.158416] VFS: Unable to mount root fs via NFS, trying
floppy.
[ 150.164947] VFS: Cannot open root device "nfs" or unknown-
block(2,0)
[ 150.171356] Please append a correct "root=" boot option; here are
the available
partitions:
[ 150.179809] b300 3813376 mmcblk0 driver:
mmcblk
[ 150.185089] b301 120456
mmcblk0p1
[ 150.189392] b302 3445942
mmcblk0p2
[ 150.193695] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(2,0)

Wireshark shows no packets coming out of the Beagleboard even though
the kernel says its trying to reach my laptop at 192.168.2.1.

I've been doing this with Angstrom without a problem. Here is what I have done:

1) Built Angstrom and copy MLO and u-boot to the FAT partition on the microSD card.

2) I use the following for my uEnv.txt file, which is stored in the boot partition of the microSD card. Some of these are probably not necessary for you, but definitely look at the nfs stuff.

camera=none
console=ttyO2,115200n8
buddy=none
buddy2=none
mpurate=auto
vram=12M
ipaddr=192.168.0.10
serverip=192.168.0.111
defaultdisplay=lcd
lcdmode=lcd
usbethaddr=de:ad:be:ef
i2cinitcmd=i2c dev 1; i2c mw 0x40 0x00 0x00; i2c mw 0x40 0x0d 0x05;
loadkernel=tftp ${loadaddr} ${bootfile}
nfspath=/home/john/angstrom/bbxm/targetNFS
optargs='mem=100M'
nfsargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=$
{buddy} buddy2=${buddy2} camera=${camera} vram=${vram} omapfb.mode=${lcdmode} ${omapfbopts} omapdss.def_disp=${defaultdisplay} noinitrd ip=${ipaddr} rw root=/dev/nfs nfsroot=${serverip}:${nfspath}
bootfile=uImage
uenvcmd=run i2cinitcmd; usb start; run loadkernel; run nfsargs; bootm ${loadaddr}

3) I unpacked the root filesystem from build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard/your-root-filesystem-image.bz2 to the targetNFS directory. If you use Ubuntu, you'll need to use sudo. That Angstrom tmp directory might also be different for you depending on the image you build.

4) Make sure that you have the nfs root directory exported in /etc/exports. Here is the line from mine:
/home/john/angstrom/bbxm/targetNFS *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

5) Make sure that you can ping the host IP address from the board to test for network connectivity and configuration.

Regards,
John