Welcome! Log In Create A New Profile

Advanced

Boot your Dockstar by TFTP/NFS

Posted by tsunulukai 
Boot your Dockstar by TFTP/NFS
April 17, 2013 04:45AM
Hi there!

A few month ago, I was trying to boot my dockstar by TFTP & NFS... but did not succeed.
I've left my dockstar on the side for a time, and I recently tried again successfully !

My deep gratitude to this fellow community who made it all possible by their numerous contributions !

Here's my modest contribution...

I tried this with a newly-installed debian wheezy distribution on my dockstar, the latest uboot, and a unmodified debian kernel.

This guide assumes that you already have a functionnal NFS, TFTP and DHCP server on your network.
In my example, I'm running the TFTP and NFS server on a NAS running Debian, and the DHCP server on a router running OpenWRT.

Here's how I proceeded

1. Install latest uboot on the Dockstar:
cd /tmp
wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh

2. Install a fresh debian on the Dockstar using the well known Jeff's script, or try to use your existing dockstar installation.

3. Copy the dockstar rootfs on the NFS Server:
mkdir -p /mnt/usbdockstar
mkdir -p /srv/nfs/hosts/dockstar
mount /dev/<whatever-device-your-dockstar-rootfs-is-on> /mnt/usbdockstar
cp -av /mnt/usbdockstar/* /srv/nfs/hosts/dockstar/
umount /mnt/usbdockstar

4. Copy the dockstar boot files on the TFTP Server:
mkdir -p /mnt/usbdockstar
mkdir -p /srv/nfs/hosts/dockstar
mount /dev/<whatever-device-your-dockstar-rootfs-is-on> /mnt/usbdockstar
cp -av /mnt/usbdockstar/boot/u* /srv/tftp/nfs/dockstar/
umount /mnt/usbdockstar

5. Add the dockstar folder as shared folder on the NFS server:
if ! cat /etc/exports | grep /srv/nfs/hosts/dockstar >/dev/null; then
cat <<EOF >>/etc/exports
/srv/nfs/hosts/dockstar                 192.168.0.0/255.255.0.0(rw,sync,no_root_squash,no_subtree_check)
EOF
fi
exportfs -av

6. Make changes onto the dockstar rootfs hosted on the NFS server to allow it to properly boot by NFS:
# Define Dockstar RootFS location on NFS Server
ROOTFS=/srv/nfs/hosts/dockstar

#Change Root entry in /etc/fstab
sed -i 's;^/dev/root.*;/dev/root       /               nfs    noatime,errors=remount-ro 0 1;' $ROOTFS/etc/fstab

#Disable eth0 auto-configuration
sed -i 's;auto eth0;#auto eth0;' $ROOTFS/etc/network/interfaces

#Disable eth0 auto-configuration (ifplugd)
sed -i 's;eth0;;' $ROOTFS/etc/default/ifplugd;
sed -i 's;^\(INTERFACES\)="auto";\1="";' $ROOTFS/etc/default/ifplugd
sed -i 's;^\(HOTPLUG_INTERFACES\)="all";\1="";' $ROOTFS/etc/default/ifplugd

7. Create NetBoot variables in uboot on the Dockstar from the running Linux:
This will not yet alter the Dockstar startup configuration. All the following commands create non-existing variables into uBoot.
#NetBoot variables
# -User-Serviceable
fw_setenv net_dhcp_c '1'
fw_setenv net_dhcp_s '0'
fw_setenv net_c_ipaddr ''
fw_setenv net_c_netmask ''
fw_setenv net_c_gatewayip ''
fw_setenv net_tftp_server '192.168.1.1'
fw_setenv net_tftp_kernel 'nfs/dockstar/uImage'
fw_setenv net_tftp_initrd 'nfs/dockstar/uInitrd'
fw_setenv net_nfs_server '192.168.1.1'
fw_setenv net_nfs_path '/srv/nfs/hosts/dockstar'

# -Fixed
fw_setenv autoload 'no'
fw_setenv net_bootcmd 'run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_boot'
fw_setenv net_boot 'tftp 0x800000 $net_tftp_kernel; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if tftp 0xe00000 $net_tftp_initrd; then bootm 0x800000 0xe00000;else bootm 0x800000;fi'
fw_setenv net_set_bootargs 'setenv serverip $net_tftp_server; setenv bootargs console=$console root=/dev/nfs rootfstype=nfs rootwait nfsroot=$net_nfs_server:$net_nfs_path ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:dockstar:eth0:off $mtdparts'
fw_setenv net_check_dhcp_c 'if test $net_dhcp_c -eq 1 ; then run net_set_c_ip_dhcp; else run net_set_c_ip_stat; fi;echo ** IP Address: $ipaddr; echo ** Subnet Mask: $netmask; echo ** Def Gateway: $gatewayip'
fw_setenv net_set_c_ip_dhcp 'dhcp; echo; echo ** net_dhcp_c = 1 --> Getting IP Settings by DHCP'
fw_setenv net_set_c_ip_stat 'setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** net_dhcp_c = 0 --> Using static IP Settings'
fw_setenv net_check_dhcp_s 'if test $net_dhcp_s -eq 1 && test $net_dhcp_c -eq 1 ; then run net_set_s_ip_dhcp; else run net_set_s_ip_stat; fi;echo ** TFTP Boot Server: $net_tftp_server; echo ** NFS Boot Server: $net_nfs_server; echo'
fw_setenv net_set_s_ip_dhcp 'setenv net_tftp_server $serverip; setenv net_nfs_server $serverip;echo; echo ** net_dhcp_s and net_dhcp_c = 1 --> Getting TFTP and NFS Boot Server by DHCP'
fw_setenv net_set_s_ip_stat 'echo; echo ** net_dhcp_s or net_dhcp_c = 0 --> Using static TFTP and NFS Boot Server'

#NetBoot variables End

8. Now you need access to uBoot to test the TFTP/NFS boot.
You can either plug a serial adapter on your Dockstar or configure uBoot to send the information by netconsole
I used the first option, but here's the procedure for the second one, assuming your NetCat client runs on 192.168.1.250.

On the dockstar, enter:
fw_setenv netcatip 192.168.1.250
fw_setenv if_netconsole 'ping $netcatip'
fw_setenv start_netconsole 'setenv ncip $netcatip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
fw_setenv preboot 'dhcp; run if_netconsole start_netconsole'

To receive the console on your computer, run:
nc -l -u -p 6666

9. Reboot the dockstar, interrupt the autoboot and execute
run net_bootcmd

It should boot your dockstar by TFTP and NFS.
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
u-boot>> run net_bootcmd
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 28
*** Unhandled DHCP Option in OFFER/ACK: 28
DHCP client bound to address 192.168.1.239

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 192.168.1.239
** Subnet Mask: 255.255.255.0
** Def Gateway: 192.168.1.254

** net_dhcp_s or net_dhcp_c = 0 --> Using static TFTP and NFS Boot Server
** TFTP Boot Server: 192.168.1.1
** NFS Boot Server: 192.168.1.1

Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.239
Filename 'nfs/dockstar/uImage'.
Load address: 0x800000
Loading: #################################################################
         #############################################
done
Bytes transferred = 1606576 (1883b0 hex)

** Kernel Boot Arguments: console=ttyS0,115200 root=/dev/nfs rootfstype=nfs rootwait nfsroot=192.168.1.1:/srv/nfs/hosts/dockstar ip=192.168.1.239:192.168.1.1:192.168.1.254:255.255.255.0:dockstar:eth0:off mtdparts=orion_nand:1M(u)

Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.239
Filename 'nfs/dockstar/uInitrd'.
Load address: 0xe00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########
done
Bytes transferred = 6817161 (680589 hex)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.2.0-4-kirkwood
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1606512 Bytes = 1.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00e00000 ...
   Image Name:   initramfs-3.2.0-4-kirkwood
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6817097 Bytes = 6.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0-4-kirkwood (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-15) ) #1 Debian 3.2.41-2

 ...

IP-Config: eth0 hardware address 00:10:75:27:3e:f3 mtu 1500
IP-Config: eth0 guessed broadcast address 192.168.1.255
IP-Config: eth0 complete:
 address: 192.168.1.239  broadcast: 192.168.1.255    netmask: 255.255.255.0
 gateway: 192.168.1.254  dns0     : 0.0.0.0          dns1   : 0.0.0.0
 host   : dockstar
 rootserver: 192.168.1.1 rootpath:
 filename  :
Begin: Running /scripts/nfs-premount ... done.

 ...

[....] Starting OpenBSD Secure Shell server: sshd. ok

Debian GNU/Linux 7.0 dockstar ttyS0

dockstar login:

10. If your boot attempt was successful, alter the dockstar boot sequence to try to boot by NFS with the following command:
fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run net_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset'

It's a copy of the original boot command, altered to try to boot by NFS after it fails to boot by USB, but before it tries to boot the rescue_system.

Next time you reboot, your dockstar will boot by NFS if it cannot find a bootable USB storage.

EnJoY !


N.B.
In the current configuration, the dockstar will get an IP address by DHCP, but will boot from the statically defined TFTP & NFS server. If you want the dockstar to get the IP address of the TFTP & NFS server by DHCP, just change this:
fw_setenv net_dhcp_s '1'
The DHCP server should then provide the server address with the dhcp option 66
(known as 'TFTP server name' or 'next-server')

Alternatively, if there's no DHCP server on your network or the DHCP server gives faulty information (I had the case with a cable modem that returned an inexisting boot file in option 67), You can statically define your client IP settings with the following changes:
fw_setenv net_dhcp_c '0'
fw_setenv net_c_ipaddr '192.168.1.5'
fw_setenv net_c_netmask '255.255.255.0'
fw_setenv net_c_gatewayip '192.168.1.254'
In this case, you also MUST statically define the IP address for
fw_setenv net_tftp_server '192.168.1.1'
fw_setenv net_nfs_server '192.168.1.1'



Edited 6 time(s). Last edit at 06/17/2013 02:51PM by tsunulukai.
Re: Boot your Dockstar by TFTP/NFS
April 20, 2013 08:22AM
Very nice!
I don't know if I'll ever use this myself, but you did a nice job of specifying details, documenting the scripts/code. Its always nice to see (yet another!) a reminder of the cool things one can do w/ code, some experimentation and some perseverance.

=====================================================


Re: Boot your Dockstar by TFTP/NFS
June 12, 2013 02:04PM
Hey! That's exactly what i was looking for!

But where is and where can i find 'boot/gpxelinux.0' file?

Thanks

Edit : i think i got it, this file is in the syslinux-common package... Nothing mentioned this in the tutorial... so going to "apt-get install syslinux-common"...
Edit2 : finally it seems that the uboot dhcp command is the problem because when i type help at the uboot prompt i have this :
dhcp - boot image via network using DHCP/TFTP protocol
and it's very strange... and when i type 'dhcp' it tries to load a image CA807.img or something like that!
So i modify the settings to have static ip - so no more dhcp, and i go one step ahead = Kernel booting, but no access to the dockstar ==> time to make a serial cable...

Edit3 : suppress the br0 bridged interface (was created to bridge an usb2ethernet network key) from /etc/network/interfaces .... It works !!!!! So the only problem was with the uBoot dhcp command, but i see in the log in the first message that there's the loading of gpxelinux.0 but i don't understand why?

Edit4 : Got it! The problem with the dhcp uBoot command trying to load an image can be changed by the uboot command 'setenv autoload no'. After that if i type 'dhcp' it gives me my ip without trying to load an image...

Edit5 : to make the 'set autoload no' permanent, i just change the line in the script :
from
fw_setenv net_set_c_ip_dhcp 'setenv autoload no; dhcp; echo; echo ** net_dhcp_c = 1 --> Getting IP Settings by DHCP'
to
fw_setenv net_set_c_ip_dhcp 'setenv autoload no; dhcp; echo; echo ** net_dhcp_c = 1 --> Getting IP Settings by DHCP'

Next Step (Done!) : modify the tftp command to nfs command ==> so i can run all the things with just a dhcp and a nfs server and no more needing a tftp server...
Next Step 2: use nfsv4 for the root filesystem... This one should be to difficult/impossible (dracut-network package????)



Edited 8 time(s). Last edit at 06/15/2013 01:29AM by qdftowner.
Re: Boot your Dockstar by TFTP/NFS
June 16, 2013 04:08AM
Hi !

The file gpxelinux.0 is NOT necessary here. It only appears in my output because I have network boot enabled on my network for x86/64 computers. As the Dockstar initiates its DHCP request during the boot sequence, it also receives from my DHCP server the boot server and file (DHCP options 66 & 67) for x86/64 machines, and tries, unsuccessfully, to boot from it.... which is useless for the dockstar. That's the reason I've foreseen to statically define the boot file name for the dockstar instead of getting it from the DHCP server.

The problem you encounter with the file 'CA807.img' come from the fact that your dockstar gets this filename as bootfile by DHCP. Many ISPs return a TFTP boot server and file names that are bogus... Hence the need to disable DHCP if it's the case. (See the last comment in my initial post).

I wasn't aware about the autoload command. It might be usefull to check if it doesn't break the rescue system loading if the dockstar is unable to foot by TFTP/NFS. From the OpenWRT wiki, it seems to only affect the behavior of the DHCP boot :
Quote
OpenWR Wiki
autoload - if set to no (or any string beginning with 'n'), the rarpb, bootp or dhcp commands will perform only a configuration lookup from the BOOTP / DHCP server, but not try to load any image using TFTP.

I've adapted my first post to deactivate the autoload. I removed the output related by gpxelinux.0: the dockstar doesn't try to load it anymore thanks to the autoload command set to no.

Could you describe the changes you made to boot by NFS without a TFTP server ?



Edited 1 time(s). Last edit at 06/16/2013 05:28AM by tsunulukai.
Re: Boot your Dockstar by TFTP/NFS
June 16, 2013 08:21AM
To made it boot from nfs without tftp, just changed :

fw_setenv net_boot 'tftp 0x800000 $net_tftp_kernel; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if tftp 0xe00000 $net_tftp_initrd; then bootm 0x800000 0xe00000;else bootm 0x800000;fi'


to
fw_setenv net_boot 'nfs 0x800000 $net_nfs_server:$net_nfs_path/boot/$net_tftp_kernel; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if nfs 0xe00000 $net_nfs_server:$net_nfs_path/boot/$net_tftp_initrd; then bootm 0x800000 0xe00000;else bootm 0x800000;fi'

I consider that uImage and uInitrd are present in the /boot directory (like a normal install).
Every thing is fine with nfs (v3)!

Booting from nfs4 is not possible uBoot seems to not be able to do that (using nfsv3 naming works).
Mounting / on a nfs4 partition is not possible (well , i'm trying to do this with dracut-network package but i does not work and i 'm sure i have a message from the kernel but i have no serial connection so i'm stuck a this step for nfs4)
Re: Boot your Dockstar by TFTP/NFS
June 22, 2013 03:19PM
Hi qdftowner,

> I consider that uImage and uInitrd are present in
> the /boot directory (like a normal install).
> Every thing is fine with nfs (v3)!
>

> Booting from nfs4 is not possible uBoot seems to
> not be able to do that (using nfsv3 naming works).
>

How did you do do select nfs v3 on uBoot side? Regarding "using nfsv3 naming", does it mean there is certain naming convention in uBoot envs that you used to make it v3 only?

Update - found the answer: nfsroot parameter can have options, so it seems to take
nfsroot=$net_nfs_server:$net_nfs_path,v3



Thanks,

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 06/22/2013 09:19PM by bodhi.
Re: Boot your Dockstar by TFTP/NFS
June 23, 2013 03:14PM
@tsunulukai,

Thanks for a very well written guide! and most of all the inspiration. I'm playing with this and I have learned some new and very useful subjects.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
June 23, 2013 10:38PM
bodhi Wrote:
-------------------------------------------------------
> nfsroot=$net_nfs_server:$net_nfs_path,v3

This did not seems to be able to force the nfs share to mount as v3.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
June 25, 2013 12:38PM
it should be :
nfsroot=$net_nfs_server:$net_nfs_path,vers=3

but when i talk about nfsv4 vs nfsv3 notation i mean :
if /export is the nfsv4 export (option fsid=0) then you can have another export into /export, say /export/dockroot and dockroot is a mount --bind of a directory elsewhere then if you write:

nfsroot=$net_nfs_server:/ <==nfsv4
nfsroot=$net_nfs_server:/export <== nfsv3 or <

and (what we want)

nfsroot=$net_nfs_server:/dockroot <==nfsv4 (but it does not work even with dracut-network, the classic nonody:nobody problem is occuring when trying to mount at boot)
nfsroot=$net_nfs_server:/export/dockroot <== nfsv3 or <

you can lso force nfs server to v3...
Re: Boot your Dockstar by TFTP/NFS
June 26, 2013 10:53AM
qdftowner,

Thanks for the info. But strange, "vers=3" did not work for me, the kernel rejected it as an option in the command line. I'm running 3.8.11. When I use v3, it was accepted.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
July 04, 2013 01:29PM
run fine also with debian jessie (stock kernel 3.9.6.1 from a fresh debootstrap)!
going to test if more success with nfsv4 ...
root@dockstar2:~# uname -a
Linux dockstar2 3.9-1-kirkwood #1 Debian 3.9.6-1 armv5tel GNU/Linux
root@dockstar2:~# free
             total       used       free     shared    buffers     cached
Mem:        124428      24068     100360          0          0      15392
-/+ buffers/cache:       8676     115752
Swap:            0          0          0
root@dockstar2:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=14614,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12444k,mode=755)
192.168.1.35:/export/dockjessie on / type nfs (rw,noatime,vers=3,rsize=262144,wsize=262144,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=7,retrans=10,sec=sys,local_lock=all,addr=192.168.1.35)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=24880k)
tmpfs on /tmp type tmpfs (rw,relatime)
root@dockstar2:~# cat /etc/debian_version
jessie/sid
Re: Boot your Dockstar by TFTP/NFS
July 27, 2013 06:07PM
Forcing NFS version 3 for nfsroot did not seem to work for me. I'm running kernel 3.9.11.

In this bootargs I tried to set to version 3:
nfs_set_bootargs=setenv bootargs console=$console root=/dev/nfs nfsroot=$nfs_server:$nfs_path,vers=3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts

UPDATE:
Perhaps the syntax has changed, I tried nfsroot=$nfs_server:$nfs_path,v3 before, and it seems to take. But I also had other problem with "protocol not supported" error so I thought that this option did not work. But now that my other problem was solved, I left the v3 option in, and everything works as intended.

So my bootargs currently is
nfs_set_bootargs=setenv bootargs console=$console root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts

Thanks tsunulukai and qdftowner for the info.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 07/28/2013 02:26PM by bodhi.
Re: Boot your Dockstar by TFTP/NFS
March 26, 2015 07:51PM
Hi, i updated the envs a bit for use with my PogoPlug Mobile. Works great. It's using NFS only, no TFTP.

I added DTB-support also.

Bootlog:
U-Boot 2014.07-tld-1 (Jul 18 2014 - 00:59:45)
Pogoplug V4
gcc (Debian 4.6.3-14) 4.6.3
GNU ld (GNU Binutils for Debian) 2.22
Hit any key to stop autoboot:  0 
** Bad device mmc 0 **
** Bad device mmc 0 **
Card did not respond to voltage select!
** Bad device mmc 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Reset IDE: ide_preinit failed
** Bad device size - ide 0 **
** Bad device size - ide 0 **
** Bad device size - ide 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
DHCP client bound to address 10.0.0.20

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 10.0.0.20
** Subnet Mask: 255.255.255.0
** Def Gateway: 10.0.0.1

** net_dhcp_s or net_dhcp_c = 0 --> Using static NFS Boot Server
** NFS Boot Server: 10.0.0.22

Using egiga0 device
File transfer via NFS from server 10.0.0.22; our IP address is 10.0.0.20
Filename '/srv/nfs/hosts/pp01/boot/dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: ##
done
Bytes transferred = 10028 (272c hex)
Using egiga0 device
File transfer via NFS from server 10.0.0.22; our IP address is 10.0.0.20
Filename '/srv/nfs/hosts/pp01/boot/uImage'.
Load address: 0x800000
Loading: #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ########################################
done
Bytes transferred = 2865664 (2bba00 hex)

** Kernel Boot Arguments: console=ttyS0,115200 root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=10.0.0.22:/srv/nfs/hosts/pp01,v3,tcp ip=10.0.0.20:10.0.0.22:10.0.0.1:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:1M(u-boot),-(empty)

Using egiga0 device
File transfer via NFS from server 10.0.0.22; our IP address is 10.0.0.20
Filename '/srv/nfs/hosts/pp01/boot/uInitrd'.
Load address: 0x1100000
Loading: #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##########################################
done
Bytes transferred = 6535284 (63b874 hex)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.18.5-kirkwood-tld-1
   Created:      2015-02-08   9:02:01 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2865600 Bytes = 2.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.18.5-kirkwood-tld-1
   Created:      2015-02-19   1:49:36 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6535220 Bytes = 6.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000


Starting kernel ...

Das code:
#NetBoot variables
# -User-Serviceable
fw_setenv net_dhcp_c '1'
fw_setenv net_dhcp_s '0'
fw_setenv net_c_ipaddr ''
fw_setenv net_c_netmask ''
fw_setenv net_c_gatewayip ''
fw_setenv net_nfs_server '10.0.0.22'
fw_setenv net_nfs_path '/srv/nfs/hosts/yourpogoplug'
fw_setenv net_nfs_dtb '/boot/dts/kirkwood-pogoplug_v4.dtb'
fw_setenv net_nfs_kernel '/boot/uImage'
fw_setenv net_nfs_initrd '/boot/uInitrd'

# -Fixed
fw_setenv autoload 'no'
fw_setenv net_bootcmd 'run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_boot'
fw_setenv net_boot 'nfs 0x1c00000 ${net_nfs_server}:${net_nfs_path}${net_nfs_dtb}; nfs 0x800000 ${net_nfs_server}:${net_nfs_path}${net_nfs_kernel}; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if nfs 0x1100000 ${net_nfs_server}:${net_nfs_path}${net_nfs_initrd}; then bootm 0x800000 0x1100000 0x1c00000;else bootm 0x800000 - 0x1c00000;fi'
fw_setenv net_set_bootargs 'setenv serverip $net_nfs_server; setenv bootargs console=$console root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=$net_nfs_server:$net_nfs_path,v3,tcp ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:pogoplugv4:eth0:off $mtdparts'
fw_setenv net_check_dhcp_c 'if test $net_dhcp_c -eq 1 ; then run net_set_c_ip_dhcp; else run net_set_c_ip_stat; fi;echo ** IP Address: $ipaddr; echo ** Subnet Mask: $netmask; echo ** Def Gateway: $gatewayip'
fw_setenv net_set_c_ip_dhcp 'dhcp; echo; echo ** net_dhcp_c = 1 --> Getting IP Settings by DHCP'
fw_setenv net_set_c_ip_stat 'setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** net_dhcp_c = 0 --> Using static IP Settings'
fw_setenv net_check_dhcp_s 'if test $net_dhcp_s -eq 1 && test $net_dhcp_c -eq 1 ; then run net_set_s_ip_dhcp; else run net_set_s_ip_stat; fi;echo ** NFS Boot Server: $net_nfs_server; echo'
fw_setenv net_set_s_ip_dhcp 'setenv net_nfs_server $serverip;echo; echo ** net_dhcp_s and net_dhcp_c = 1 --> Getting NFS Boot Server by DHCP'
fw_setenv net_set_s_ip_stat 'echo; echo ** net_dhcp_s or net_dhcp_c = 0 --> Using static NFS Boot Server'

#NetBoot variables End

Note i'm using NFS v3 + TCP.

Cheers,
John



Edited 2 time(s). Last edit at 03/26/2015 08:23PM by JohnW.
Re: Boot your Dockstar by TFTP/NFS
March 26, 2015 07:56PM
You'll have to edit your bootcmd aswall. Just add "net_bootcmd;" before reset in the end...

fw_setenv bootcmd 'run bootcmd_mmc; run bootcmd_usb; run bootcmd_sata; net_bootcmd; reset'
Re: Boot your Dockstar by TFTP/NFS
March 26, 2015 10:42PM
> Note i'm using NFS v3 + TCP.

Yes. Booting with NFS v3 has been working well for me for a couple of years. NFS v4 had some problem. I have not tried to change it, so don't know the current status for NFS v4 booting.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
March 27, 2015 09:56AM
Haven't tried v4 either. By default it will use v3, even if you don't specify it.
By default (comes with the new kernel) the rootfs will be mounted as read-only, so you'll need to add "rw" to "net_set_bootargs" as i did. Wasn't needed earlier.

Anyways i'm happy with my NFS-setup...
My PogoPlug V4 with a 2.5"-drive is exporting the rootfs for my (now medialess) PogoPlug Mobile...
Writespeed to disk (export = sync) is 13,5mb/s. The only concern is the cpu/memory usage of the server under load, but it seems to work ok.
Re: Boot your Dockstar by TFTP/NFS
March 27, 2015 12:43PM
JohnW,

> By default it will use
> v3, even if you don't specify it.

But you have to export the NFS share as V3 by using the V3 syntax.

> By default (comes with the new kernel) the rootfs
> will be mounted as read-only, so you'll need to
> add "rw" to "net_set_bootargs" as i did. Wasn't
> needed earlier.

Strange, which NFS version you're running? I don't need to do this. Perhaps it has something to do with your specific export.

> The only concern is the cpu/memory usage of the
> server under load, but it seems to work ok.

Perhaps I can help if you can describe what is abnormal, my Pogo E02 running as normal as other plugs, nothing unusual.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
March 27, 2015 03:23PM
Hi Bodhi,

I tested without the v3-syntax and it worked anyway. Theres no change in the output of "mount" if you add it, i choosed to include it anyway.

Mount gave me:
10.0.0.22:/srv/nfs/hosts/pp02 on / type nfs (rw,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=7,retrans=3,sec=sys,local_lock=all,addr=10.0.0.22)

My export is so standard as it can be. I haven't specified NFS-version anywhere.

Heres my fstab on the client.
root@pp02:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/root      /               nfs     noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0
10.0.0.22:/exports/music /media/music nfs ro,async,hard,intr 0 0
(Will change the second to sync, tcp so they all are the same).

The wierd thing is that my secondary NFS-share (for MPD) doesn't get mounted at boot. No error-messages at all.
Tried to add _netdev etc, hoping it would have an effect.
Maybe a bit offtopic...

Full mount output, minus tmpfs-mounts.
10.0.0.22:/srv/nfs/hosts/pp02 on / type nfs (rw,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=7,retrans=3,sec=sys,local_lock=all,addr=10.0.0.22)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
10.0.0.22:/exports/music on /media/music type nfs (ro,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.22,mountvers=3,mountport=56581,mountproto=udp,local_lock=none,addr=10.0.0.22)

Any ideas? I asume it has have something related to the primary NFS-rootfs existing...
"mount /media/music" mounts it w/o problems...

Regarding the performance-issues, it's not a big deal. It's just that when i run "apt-get update/upgrade" etc. on the clients the CPU hits 100% continuously. Memory goes up to 20MB free an swap is used.

No big deal, under normal operations the NFS-clients don't do any heavy disk-related stuff (if non at all!)...

/John :-)
Re: Boot your Dockstar by TFTP/NFS
March 27, 2015 04:10PM
John,

> My export is so standard as it can be. I haven't
> specified NFS-version anywhere.

It does imply different version with the syntax. So if it's vanilla then the syntax imply v3. But if you use something specific like fsid in the parameter then it's exported as v4 (if you do have nfs v4 in the kernel).

> "mount /media/music" mounts it w/o problems...

You can mount it in /etc/rc.local. I think it is too early because the rootfs itself has not been mounted completely yet.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
March 27, 2015 04:34PM
Yes you're absolutely right, i did read about it earlier - don't know why didn't think of it now, doh... Even qdftowner wrote about it above...

Yes, i'm not fully aware of how and at which time the lines in fstab are processed - but you're probably right about it.
Re: Boot your Dockstar by TFTP/NFS
March 31, 2015 05:59PM
Bodhi, with systemvinit i had to add "mount -a -t nfs4" to rc.local to have the second nfs-share mounted at boot.

With systemd i did not need to do that. My idea is that systemd is a bit more intelligent when it comes to pick the moment when to run stuff... Case closed.
Re: Boot your Dockstar by TFTP/NFS
April 11, 2015 08:59AM
Nice. When I get sometimes, I will definitely peruse this thread and use my DockStar as a test bed. Thank you all.
Re: Boot your Dockstar by TFTP/NFS
July 05, 2015 03:55AM
Thanks so much tsunulukai!
I had a usb drive enclosure die and my dockstar has become so integral to my everything here. I had a couple of spares, one doesn't work at all on the dockstar, the other works fine from cold boot but upon reboot it can't be seen (the infamous Super Top m6116 chip, try not to get one). Yes I tried usb stop-sleep-start, etc., nothing worked. But this did, and it was so easy with the code already done! Once booted into say, rescue, the disk was seen just fine, I only had to get past the kernel booting, so this was ideal, I only have to tftp the zImage/dtb. And my tomato router has dnsmasq, it has tftp built in, just use the routers usb stick for storage.
I've fooled around with tftp before, always disappointed, but this was easy. Wow, can't tell you how thrilled I am to be able to reboot, my dockstar is kept in a somewhat inaccessible place, quite the effort to get to, so getting up and doing that to pull the plug every time I needed to reboot didn't thrill me. Now I can take my time getting a good replacement enclosure.
So much good stuff at Jeff Doozan's place...



Edited 1 time(s). Last edit at 07/05/2015 04:00AM by sputnik.
Re: Boot your Dockstar by TFTP/NFS
July 05, 2015 08:30AM
JohnW Wrote:
-------------------------------------------------------
> Bodhi, with systemvinit i had to add "mount -a -t
> nfs4" to rc.local to have the second nfs-share
> mounted at boot.
>
> With systemd i did not need to do that. My idea is
> that systemd is a bit more intelligent when it
> comes to pick the moment when to run stuff... Case
> closed.

I've forgot all about this. But since this thread is active again :) FWIW.

Regarding mounting NFS shares in sysvinit. Here is a way to specify in whether NFS share should be mounted asynchroneously, or wait until the NFS rootfs was mounted.

Add this in /etc/default/rcS
ASYNCMOUNTNFS=no

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
July 06, 2017 01:02AM
Hi there !

First of all, many thanks for your positive feedback :)

Just a quick update for those of you who run debian as their NFS server to boot their dockstar. When updating to Debian 9 Stretch, the nfs-kernel-server packages disables NFSv2 by default. This broke my NFS setup with the dockstars, which, although configured to use NFSv3, seems to initialize their boot using NFSv2. (It might be due to the kernel version I'm running)

I could confirm this in wireshark:
Remote Procedure Call, Type:Reply XID:0x00000004
    XID: 0x00000004 (4)
    Message Type: Reply (1)
    [Program: NFS (100003)]
    [Program Version: 2]
    [Procedure: LOOKUP (4)]
    Reply State: accepted (0)
    [This is a reply to a request in frame 9]
    [Time from request: 0.000080000 seconds]
    Verifier
        Flavor: AUTH_NULL (0)
        Length: 0
    Accept State: remote can't support version # (2)
    Program Version (Minimum): 3
    Program Version (Maximum): 4

To re-enable NFSv2 in Debian 9 Stretch, you just need to add the following lines to /etc/default/nfs-kernel-server:

# Enable NFSv2
RPCNFSDOPTS="-V 2"

Hope this helps :)
Greetz !
Re: Boot your Dockstar by TFTP/NFS
July 06, 2017 03:24AM
tsunulukai,

> To re-enable NFSv2 in Debian 9 Stretch, you just n
> eed to add the following lines to /etc/default/nfs
> -kernel-server:
>
>
> # Enable NFSv2
> RPCNFSDOPTS="-V 2"
>
>
> Hope this helps :)
> Greetz !

If I might add further explanation. The reason was older u-boots only has NFS v2 :) So the nfs-kernel-server detects that and provide NFS v2 protocol. Even though we export the rootfs share as v3.

u-boot did not have NFS V3 until recently. So when I release the new kirkwood u-boot-2017.05. This problem will be solved by itself. In the mean time, thanks for this hints! people are likely to run in to this problem after upgrading to stretch.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 07/06/2017 03:25AM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: