NFS root file system problem on SAM-L9260

Hello,

I’ve recently tried to configure Linux and U-boot on SAM9-L9260 to use NFS root file system but run into several problems. First of all I used slightly modified bootargs from the User Manual like this:

bootargs=mem=64M console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.0.30:/nfsroot ip=192.168.0.26:192.168.0.30 

But after booting kernel ipconfig driver informed that he can’t open eth0 interface:

IP-Config: Failed to open eth0

I manage to “solve” this problem by adding ethaddr to u-boot environmental variables, but file system did mounted only read-only mode giving this information:

Checking root file system...fsck 1.40-WIP (14-Nov-2006)
fsck.ext3: No such device or address while trying to open /lib/init/rw/rootdev
Possibly non-existent or swap device?
fsck died with exit status 8
failed (code 8).
* An automatic file system check (fsck) of the root filesystem failed.
A manual fsck must be performed, then the system restarted.
The fsck should be performed in maintenance mode with the
root filesystem mounted in read-only mode.
* The root filesystem is currently mounted in read-only mode.
A maintenance shell will now be started.
After performing system maintenance, press CONTROL-D
to terminate the maintenance shell and restart the system.
Give root password for maintenance
(or type Control-D to continue):

I would like to admit that when I mount this partition not as root file system it is fully writeable. This is my configuration file of nfs server:

# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)
#
#/files 192.168.0.1/24(rw,no_root_squash,no_all_squash)
/nfsroot 192.168.0.0/255.255.0.0(rw,no_root_squash,sync)

Moreover when I try to go back to NAND flash root file system with ethaddr in u-boot kernel cannot bring up eth0:

SIOCSIFHWADDR: No such device
Failed to bring up eth0.

Thanks in advance for any help

Paul

Does the kernel you are using have NFS support built in?

(Also, I don’t know why your eth0 can’t be brought up. I don’t have a 9260-EK or similar).

What if you also specify “rootfstype=nfs”?

theatrus:
Does the kernel you are using have NFS support built in?

Yes it does I had to recompile the out-off-the-box kernel. This are the differences between original config file and my:
4c4
< # Fri May  8 09:18:57 2009
---
> # Fri May  8 08:04:36 2009
326,329c326
< CONFIG_IP_PNP=y
< CONFIG_IP_PNP_DHCP=y
< CONFIG_IP_PNP_BOOTP=y
< CONFIG_IP_PNP_RARP=y
---
> # CONFIG_IP_PNP is not set
1020d1016
< CONFIG_ROOT_NFS=y

JJ:
What if you also specify “rootfstype=nfs”?

Tried this with no effect.

I would also like to ask Olimex developers if they know about the ethaddr in u-boot problem which I mentioned in the first post. I thing they are, because if you look in provided SAMBA script you will see that this is only slightly changed original ATMEL script with for example ethaddr u-boot environment variable in comment.

Thanks for reply

Hi,

Please edit the following file on your SAM9-L9260 root filesystem:

/etc/network/interfaces

There you can configure your embedded ethernet and bind eth[0…9] interfaces to specific MAC addresses.

And here is my NFS server /etc/exports file:

/home/dimitar/nfs-root 192.168.0.1/255.255.255.0(rw,sync,insecure,insecure_locks,no_root_squash,no_all_squash)

Note how the above configuration grants full root access to NFS clients which is essential for NFS root filesystems.

The reason SAM9-L9260 is shipped without preset ethaddr U-Boot variable is that this variable can be saved only once. This way user is not forced reprogram the dataflash if another MAC is needed.

Regards,

Dimitar

Firstly,

dimitar:
Hi,

Please edit the following file on your SAM9-L9260 root filesystem:

/etc/network/interfaces

There you can configure your embedded ethernet and bind eth[0…9] interfaces to specific MAC addresses.

Done this, network interface started working.

Secondly, the problem with nfs lay in fstab file the original was:

/dev/sda1 / ext3 defaults,errors=remount-ro,noatime 0 1

It had to be changed in my case to:

192.168.0.30:/nfsroot / nfs defaults,noatime,rsize=8192,wsize=8192,timeo=14,intr
 0 1

Many thanks for all replies,

Paul

If you ever want to change the ethaddr variable in uboot, all you have to do is erase the environment variable storage in flash memory and reboot. Then uboot will use the default environment settings, and you can enter a new ethaddr.

If you modify the source code for uboot, you can specify a default ethaddr that will be used if the environment variables are not valid, and by defining CONFIG_OVERWRITE_ETHADDR_ONCE you can set the ethaddr to somthing other than the default. I use this so that the board can be tested with a default ethaddr before an actual ethaddr is assigned.