Readynas 102 USB boot2014-01-28
An alternative to NFS-booting the NAS during development is to use an USB-stick that holds the kernel and root-filesystem.This is a quick guide to howto setup this. I tested this with the Linux 3.13 kernel. The 3.13 kernel worked out of the box. So no need to patch it. The patched 3.12 kernel used for NFS-booting has a problem with the initialization of the NIC. This could be worked around by letting U-boot set up the network, but why run an old kernel.
Prepare the USB-stick. Create two partitions, the first one should be in fat32 format and should have enough space to hold the kernel uImage (or a couple of them probably). The second partitions that will become the root partition can be in any supported filesystem. I chosed ext4. Copy the files from the nfsroot directory as root with cp -a to keep ownership and file permissions.
Edit the etc/fstab of the filesystem so that the root file system can be remounted writable by the init system.
Open the serial terminal and power on the NAS and get the U-boot prompt.
Initialize USB and load the kernel
Load the kernel from the first partition of the USB-stick at the adress 1200000
fatload usb 0:1 1200000 uImage Boot command
The rootwait option is needed to make sure the USB disk is initialized before the kernel tries to start init. The root device can be different depending on how many disks that are attached to the NAS. (It would be a bit safer to set a label on the partition and using that.)
setenv bootargs root=/dev/sdb2 rootwait console=ttyS0,115200 earlyprintk