Rootfs on NFS
With the OpenEzx kernel, here is how to mount an NFS root, over the USBNet interface on a linux host box.
Assuming you have the nfs support and usbnet compiled and working on your kernel.
With some kernels, you may need to unplug/plug the USB cable for the phone to be recognized, and the network to be reachable (this will force the USB's re-enumeration).
1. Configure the PC's USB Network.
So, at first you need to load/install the modules "usbnet", perhaps also "cdc_subset".
Assign the IP address to suit your kernel's config/CMDLINE
Example /etc/network/interfaces (for debian based distros)
#Addition for the EZX network interface
auto usb0
iface usb0 inet static
address 192.168.0.200
netmask 255.255.255.0
broadcast 192.168.0.255
It's often recommended to use these lines too:
mapping hotplug script grep map usb0
Note that I still need to do an "ifup usb0", when I plug my phone on the ubuntu machine...
There is a bug on ubuntu, causing this solution to only work once at each boot. See [1]
I found a workaround on this page: [2]
(You simply need to move DRIVERS=="*?" in the file /etc/udev/rules.d/85-ifupdown.rules from GOTO to the big ACTION=="add" line.)
2. Install NFS.
On ubuntu :
sudo apt-get install nfsboot (depends on bind9, atftpd, openbsd-inetd) sudo apt-get install nfs-common nfs-kernel-server
Edit /etc/export to suit the path the kernel will be waiting for.
Example /etc/export (You can add some mounting options here too):
/PATH/TO/YOUR/NFSROOT/EXPORT 192.168.0.202(rw,no_root_squash,async)
3. Example kernel command line for nfs root.
Please adjust for your personal needs.
CMDLINE_ROOT = "root=/dev/nfs nfsroot=192.168.0.200:/PATH/TO/YOUR/NFSROOT/EXPORT/ rootdelay=5"
For deeper explanation, you can refer to Documentation/filesystems/nfsroot.txt and the nfs manual page.