boot BeagleBoard from NFS server

Hello

I try to boot my BeagleBoard xM Rev.C from an NFS server which is running on an Ubuntu 10.04 host.
The NFS server seems to work fine because i am able to mount it on an Angstrom Linux which runs on my BeagleBoard (SD-Card).
To boot the BeagleBoard from NFS i use the Angstrom-console-image-eglibc-ipk-v2012.05-beagleboard.rootfs.tar.bz2 rootfs.
My uEnv.txt file looks like:

serverip=192.168.0.2
ipaddr=192.168.0.9
netmask=255.255.255.0
gatewayip=192.168.0.1
hostname=beagleboard
nfsdevice=usb0:off
usbethaddr=6E:58:95:1B:82:65
optargs=mem=99M@0x80000000 mem=384M@0x88000000
nfsargs=setenv bootargs console=tty02,115200n8 mpurate=1000 ${optargs} ip=dhcp nfsroot=192.168.0.2:/home/kli/rootfs root=/dev/nfs rw rootwait
uenvcmd=echo Initializing net …; dcache off; usb start; echo Loading kernel …; nfs ${loadaddr} 192.168.0.2:/home/kli/rootfs/boot/uImage ; echo Booting from nfs …; run nfsargs; bootm ${loadaddr}

and when i boot the system i get the log :

U-Boot SPL 2011.12-dirty (May 26 2012 - 14:13:36)

Texas Instruments Revision detection unimplemented

OMAP SD/MMC: 0

timed out in wait_for_bb: I2C_STAT=1000

reading u-boot.img

reading u-boot.img

U-Boot 2011.12-dirty (Jun 13 2012 - 09:13:11)

OMAP3630/3730-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz

OMAP3 Beagl

e board + LPDDR/NAND

I2C: ready

DRAM: 512 MiB

NAND: 0 MiB

MMC: OMAP SD/MMC: 0

*** Warning - readenv() failed, using default environment

In: serial

Out: serial

Err: serial

Beagle xM Rev C

No EEPROM on expansion board

No EEPROM on expansion board

Die ID #578600029ff80000015f26ad0f00c028

Net: Net Initialization Skipped

No ethernet found.

Hit any key to stop autoboot: 2

\0x08\0x08\0x08 1

\0x08\0x08\0x08 0

The user button is currently NOT pressed.

SD/MMC found on device 0

reading uEnv.txt

557 bytes read

Loaded environment from uEnv.txt

Importing environment from mmc …

Running uenvcmd …

Initializing net …

Data (writethrough) Cache is OFF

(Re)start USB…

USB: Register 1313 NbrPorts 3

USB EHCI 1.00

scanning bus for devices…

3 USB Device(s) found

scanning bus for storage devices… 0 Storage Device(s) found

scanning bus for ethernet devices… 1 Ethernet Device(s) found

Loading kerne

l …

Waiting for Ethernet connection…

done.

Using sms0 device

File transfer via NFS from server 192.168.0.2; our IP address is 192.168.0.9

Fil

ename ‘/home/kli/rootfs/boot/uImage’.

Load address: 0x80200000

Loading: *\0x08#################################################################

\0x09 ###################################################

I found out that the kernel command line is not using the correct root variable from the uEnv.txt file.

I found out that the kernel command line is not using the correct root
variable from the uEnv.txt file.

[ 0.000000] Kernel command line: console=ttyO2,115200n8 mem=99M@0x80000000
mem=384M@0x88000000

mpurate=auto buddy=none buddy2=none camera=none vram=12M
omapfb.mode=dvi:640x480MR-16@60 omapdss.def_disp=dviroot=ubi0:rootfs
ubi.mtd=4 rootfstype=ubifs

I tried to change the uboot variables with

$ setenv root /dev/nfs rw

$ printenv root

       root=/dev/nfs rw

$ saveenv

       Saving Environment to NAND...

       Erasing Nand...

       Attempt to erase non page aligned data

but without success. After i reboot the BeagleBoard xM the variable is
again set to root=ubi0:rootfs.

BeagleBoard-xM does not have any NAND on it. You need to edit the
uEnv.txt file on the FAT partition.

Thanks for the answer

I found out that i had a problem with the uboot which had overwritten the kernel command line which i passed with the uEnv.txt file.
(actually i use the uboot, MLO and Angstrom-systemd-image-eglibc-ipk-v2012.05-beagleboard.rootfs.tar.bz2 from http://downloads.angstrom-distribution.org/demo/beagleboard/)

Now i get the correct kernel command line in my boot-log:

[ 0.000000] Kernel command line: console=ttyO2,115200n8 mpurate=1000 mem=99M@0x80000000 mem=384M@0x88000000 ip=192.168.0.9:192.168.0.2:192.168.0.1:255.255.255.0:beagleboard:usb0:off nfsroot=192.168.0.2:/home/kli/rootfs,vers=3 root=/dev/nfs rw rootdelay=15

but the NFS boot is still failing with the error:

[ 16.343048] Waiting 15sec before mounting root device…

[ 126.390014] VFS: Unable to mount root fs via NFS, trying floppy.

[ 126.396820] VFS: Cannot open r**oot device “nfs” or unknown-block(2,0)

[ 126.403533] Please append a correct “root=” boot option; here are the available partitions:

[ 126.412353] b300 1931264 mmcblk0 driver: mmcblk

[ 126.417999] b301 72261 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1

[ 126.426452] b302 1855507 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2

[ 126.434997] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

[ 126.443695] [] (unwind_backtrace+0x0/0xe0) from [] (panic+0x50/0x180)

[ 126.452331] [] (panic+0x50/0x180) from [] (mount_block_root+0x1bc/0x1fc)

[ 126.461181] [] (mount_block_root+0x1bc/0x1fc) from [] (mount_root+0xd0/0xec)

[ 126.470428] [] (mount_root+0xd0/0xec) from [] (prepare_namespace+0x15c/0x1bc)

[ 126.479766] [] (prepare_namespace+0x15c/0x1bc) from [] (kernel_init+0xfc/0x134)

[ 126.489288] [] (kernel_init+0xfc/0x134) from [] (kernel_thread_exit+0x0/0x8)

I am able to mount the NFS server on my beagleboard with → busybox mount -t nfs 192.168.0.2:/home/kli/rootfs /export
So i think the NFS server should work just fine.
I was searching for a solution all over the net but without success and it would be really nice to get some help.

The complete logfile is added as logfile.txt

Thanks
Wendelin

logfile.txt (16.4 KB)

I followed the instructions from → http://veter-project.blogspot.co.at/2012/03/comfortable-kernel-workflow-on.html, but i did not use the same kernel (Xenomai) so i had to recompile my kernel with the LAN driver statically

(make menuconfig → Device driversNetwork device supportUSB Network AdaptersSMSC LAN95XX USB Ethernet devices and Device drivers → USB support → EHCI HCD (USB 2.0) )

moreover i had to change the uEnv.txt file

serverip=192.168.0.2
ipaddr=192.168.0.9
netmask=255.255.255.0
gatewayip=192.168.0.1
hostname=beagleboard
console=ttyO2,115200n8
optargs=mem=80M@0x80000000 mem=384M@0x88000000 xeno_hal.cpufreq=800000000 
mpurate=800 
root=/dev/nfs rw 
rootpath=/home/maker/rootfs 
nfsdevice=usb0:off 
nfsrootargs=vers=3 
usbethaddr=6E:58:95:1B:82:65 
nfsargs=setenv bootargs console=${console} mpurate=${mpurate} ${optargs} ip=dhcp nfsroot=${serverip}:${rootpath},${nfsrootargs} root=${root} 
uenvcmd=echo Initializing net ...; dcache off; usb start; echo Loading kernel ...; nfs ${loadaddr} ${serverip}:${rootpath}/boot/uImage ; echo Booting from nfs ...; run nfsargs; bootm ${loadaddr}

(-> ip=dhcp)

to get the BeagleBoard to boot from the NFS server.

Thanks for the help

Hi kli, did you remove the drivers that you mention or did you enable them:
SMSC LAN95XX USB Ethernet devices

EHCI HCD (USB 2.0)

I am having problems, my network is dhcp, and when trying to load the kernel it hangs at:

U-Boot SPL 2011.12-dirty (Mar 04 2013 - 09:50:47)
Texas Instruments Revision detection unimplemented
OMAP SD/MMC: 0
timed out in wait_for_bb: I2C_STAT=1000
reading u-boot.img
reading u-boot.img

U-Boot 2011.12-00010-ga3eb89c (Jan 29 2012 - 14:53:43)

OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment

In: serial
Out: serial
Err: serial
Beagle xM Rev C
No EEPROM on expansion board
No EEPROM on expansion board
Die ID #467800029ff80000016849a90601f007
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
The user button is currently NOT pressed.
SD/MMC found on device 0
reading uEnv.txt

726 bytes read
Loaded environment from uEnv.txt
Importing environment from mmc …
Running uenvcmd …
Initializing net …
Data (writethrough) Cache is OFF
(Re)start USB…
USB: Register 1313 NbrPorts 3
USB EHCI 1.00
scanning bus for devices… 5 USB Device(s) found
scanning bus for storage devices… 0 Storage Device(s) found
scanning bus for ethernet devices… 1 Ethernet Device(s) found
Loading kernel …
Waiting for Ethernet connection… done.
Using sms0 device
File transfer via NFS from server 152.78.67.171; our IP address is 152.78.70.95
Filename ‘/home/maker/rootfs/boot/uImage’.
Load address: 0x80200000
Loading: T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T
Retry count exceeded; starting again

Even when using dhcp, is it a problem if the BBxM and host are in different subnets?

Thanks for any help,

Luis

Hy