Welcome! Log In Create A New Profile

Advanced

Boot your Dockstar by TFTP/NFS

Posted by tsunulukai 
Re: Boot your Dockstar by TFTP/NFS
July 27, 2018 07:29PM
Try:

setenv console ‘ttyS0,115200’
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
July 27, 2018 08:34PM
bodhi Wrote:
-------------------------------------------------------
> Try:
>
>
> setenv console ‘ttyS0,115200’
> boot
>


INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Setting hostname to 'debian'...done.
[....] Starting the hotplug events dispatcher: systemd-udevdstarting version 232
. ok 
[ ok ] Synthesizing the initial hotplug events...done.
[....] Waiting for /dev to be fully populated...[   20.533151] marvell-cesa f1030000.crypto: CESA device successfully registered
[   20.576417] orion_wdt: Initial timeout 21 sec
done.
[ ok ] Activating swap:.
mount.nfs: remote share not in 'host:dir' format
[ ok ] Will now activate lvm and md swap:done.
[info] Will now check all file systems.
fsck from util-linux 2.29.2
/dev/nfs: nonexistent device ("nofail" fstab option may be used to skip this device)
Checking all file systems.
[ ok ] Done checking file systems. A log is being saved in /var/log/fsck/checkfs if that location is writable..
rm: cannot remove '/tmp/.clean': Operation not permitted
[ ok ] Cleaning up temporary files....
[   25.013839] random: crng init done
[ ok ] Will now mount local filesystems:.
[ ok ] Will now activate swapfile swap:done.
[ ok ] Checking minimum space in /tmp...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables...done.
[....] Initializing random number generator...cat: /var/lib/urandom/random-seed: Permission denied
failed.
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

can't create /var/lib/dhcp/dhclient.eth0.leases: Permission denied
Listening on LPF/eth0/00:25:31:02:e6:9e
Sending on   LPF/eth0/00:25:31:02:e6:9e
Sending on   Socket/fallback
DHCPREQUEST of 192.168.0.14 on eth0 to 255.255.255.255 port 67
DHCPNAK from 192.168.1.1
[   34.325144] nfs: server 192.168.1.204 not responding, still trying

stop here
Re: Boot your Dockstar by TFTP/NFS
July 29, 2018 04:08AM
Look at this post:
https://forum.doozan.com/read.php?2,28351

See my uboot env to boot NFS rootfs at the end of the post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
July 29, 2018 04:41AM
Wrote:
-------------------------------------------------------
> Look at this post:
> https://forum.doozan.com/read.php?2,28351
>
> See my uboot env to boot NFS rootfs at the end of
> the post.

can't login now


[....] Initializing random number generator...cat: /var/lib/urandom/random-seed: Permission denied
failed.
[ ok ] Configuring network interfaces...done.
[   28.891467] NET: Registered protocol family 10
[   28.899354] Segment Routing with IPv6
[ ok ] Starting RPC port mapper daemon: rpcbind.
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
/etc/init.d/bootlogs: 23: /etc/init.d/bootlogs: cannot create /var/log/dmesg: Permission denied
chgrp: cannot access '/var/log/dmesg': No such file or directory
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1196 (syslogd)
. ok 
[ ok ] Starting NFS common utilities: statd idmapd.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).
[ ok ] Starting system message bus: dbus.
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1195 (klogd)
. ok 
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[ ok ] Starting NTP server: ntpd.
[....] Starting OpenBSD Secure Shell server: sshdCould not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
. ok 
[ ok ] Running local boot scripts (/etc/rc.local).

Debian GNU/Linux 9 debian ttyS0

debian login: root

Add no_root_squash to /etc/exports
Now it boot up
Thanks
bodhi



Edited 3 time(s). Last edit at 07/29/2018 06:14PM by Jxjhheric.
Re: Boot your Dockstar by TFTP/NFS
July 30, 2018 05:53AM
Jxjhheric Wrote:
-------------------------------------------------------
> Wrote:
> -------------------------------------------------------
> > Look at this post:
> > https://forum.doozan.com/read.php?2,28351
> >
> > See my uboot env to boot NFS rootfs at the end
> of
> > the post.
>
> can't login now
>
>
>
[....] Initializing random number
> generator...cat: /var/lib/urandom/random-seed:
> Permission denied
> failed.
> [ ok ] Configuring network interfaces...done.
> [   28.891467] NET: Registered protocol family 10
> [   28.899354] Segment Routing with IPv6
> [ ok ] Starting RPC port mapper daemon: rpcbind.
> [ ok ] Starting NFS common utilities: statd
> idmapd.
> [ ok ] Cleaning up temporary files....
> INIT: Entering runlevel: 2
> [info] Using makefile-style concurrent boot in
> runlevel 2.
> /etc/init.d/bootlogs: 23: /etc/init.d/bootlogs:
> cannot create /var/log/dmesg: Permission denied
> chgrp: cannot access '/var/log/dmesg': No such
> file or directory
> [....] Starting busybox' syslogd implementation :
> syslogdStarting /sbin/syslogd...
> 1196 (syslogd)
> . ok 
> [ ok ] Starting NFS common utilities: statd
> idmapd.
> [warn] Not starting NFS kernel daemon: no exports.
> ... (warning).
> [ ok ] Starting system message bus: dbus.
> [....] Starting busybox' klogd implementation :
> klogdStarting /sbin/klogd...
> 1195 (klogd)
> . ok 
> [ ok ] Starting Avahi mDNS/DNS-SD Daemon:
> avahi-daemon.
> [ ok ] Starting NTP server: ntpd.
> [....] Starting OpenBSD Secure Shell server:
> sshdCould not load host key:
> /etc/ssh/ssh_host_rsa_key
> Could not load host key:
> /etc/ssh/ssh_host_ecdsa_key
> Could not load host key:
> /etc/ssh/ssh_host_ed25519_key
> . ok 
> [ ok ] Running local boot scripts
> (/etc/rc.local).
> 
> Debian GNU/Linux 9 debian ttyS0
> 
> debian login: root
>
>
> Add no_root_squash to /etc/exports
> Now it boot up
> Thanks
> bodhi

Cool! Everything is ok now?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
July 30, 2018 06:20AM
bodhi Wrote:
-------------------------------------------------------
> Jxjhheric Wrote:
> -------------------------------------------------------
> > Wrote:
> >
> -------------------------------------------------------
> > > Look at this post:
> > > https://forum.doozan.com/read.php?2,28351
> > >
> > > See my uboot env to boot NFS rootfs at the
> end
> > of
> > > the post.
> >
> > can't login now
> >
> >
> >
[....] Initializing random number
> > generator...cat: /var/lib/urandom/random-seed:
> > Permission denied
> > failed.
> > [ ok ] Configuring network interfaces...done.
> > [   28.891467] NET: Registered protocol family
> 10
> > [   28.899354] Segment Routing with IPv6
> > [ ok ] Starting RPC port mapper daemon:
> rpcbind.
> > [ ok ] Starting NFS common utilities: statd
> > idmapd.
> > [ ok ] Cleaning up temporary files....
> > INIT: Entering runlevel: 2
> > [info] Using makefile-style concurrent boot in
> > runlevel 2.
> > /etc/init.d/bootlogs: 23: /etc/init.d/bootlogs:
> > cannot create /var/log/dmesg: Permission denied
> > chgrp: cannot access '/var/log/dmesg': No such
> > file or directory
> > [....] Starting busybox' syslogd implementation
> :
> > syslogdStarting /sbin/syslogd...
> > 1196 (syslogd)
> > . ok 
> > [ ok ] Starting NFS common utilities: statd
> > idmapd.
> > [warn] Not starting NFS kernel daemon: no
> exports.
> > ... (warning).
> > [ ok ] Starting system message bus: dbus.
> > [....] Starting busybox' klogd implementation :
> > klogdStarting /sbin/klogd...
> > 1195 (klogd)
> > . ok 
> > [ ok ] Starting Avahi mDNS/DNS-SD Daemon:
> > avahi-daemon.
> > [ ok ] Starting NTP server: ntpd.
> > [....] Starting OpenBSD Secure Shell server:
> > sshdCould not load host key:
> > /etc/ssh/ssh_host_rsa_key
> > Could not load host key:
> > /etc/ssh/ssh_host_ecdsa_key
> > Could not load host key:
> > /etc/ssh/ssh_host_ed25519_key
> > . ok 
> > [ ok ] Running local boot scripts
> > (/etc/rc.local).
> > 
> > Debian GNU/Linux 9 debian ttyS0
> > 
> > debian login: root
> >
> >
> > Add no_root_squash to /etc/exports
> > Now it boot up
> > Thanks
> > bodhi
>
> Cool! Everything is ok now?
Yes
Everything is ok now

How can I get USB boot first, and if there is on USB, Boot NFS?
Re: Boot your Dockstar by TFTP/NFS
July 30, 2018 07:16AM
Jxjhheric,

> How can I get USB boot first, and if there is on
> USB, Boot NFS?

This is quite easy, but to make sure I give you the correct intruction, please repost your evns.

Log into Debian (you don't need to do this in serial console anymore), list the envs, and post here.

fw_printenv

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
July 30, 2018 08:04AM
I modified file but I don't know if it works
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=3542
machid=dd6
mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ethaddr=00:25:31:02:E6:9E
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
preboot=run preboot_nc
ipaddr=192.168.1.153
serverip=192.168.1.162
net_dhcp_c=1
net_nfs_server=192.168.1.204
net_nfs_path=/srv/nfs4/pogo
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
autoload=no
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
net_set_c_ip_dhcp=dhcp; echo; echo ** Getting IP Settings by DHCP (net_dhcp_c = 1):
net_set_c_ip_stat=setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** Using static IP Settings (net_dhcp_c = 0):
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
net_set_s_ip_dhcp=setenv net_nfs_server $serverip;echo; echo ** Getting NFS Boot Server by DHCP (net_dhcp_s and net_dhcp_c = 1):
net_set_s_ip_stat=echo; echo ** Using static NFS Boot Server (net_dhcp_s or net_dhcp_c = 0) :
net_load_dtb=echo NFS loading DTB     :$net_nfs_server:$net_nfs_path/$net_nfs_dtb ...   ; nfs $load_dtb_addr    $net_nfs_server:$net_nfs_path/$net_nfs_dtb; echo
net_load_initrd=echo NFS loading uInitrd :$net_nfs_server:$net_nfs_path/$net_nfs_initrd ...; nfs $load_initrd_addr $net_nfs_server:$net_nfs_path/$net_nfs_initrd; echo
net_load_uimage=echo NFS loading uImage  :$net_nfs_server:$net_nfs_path/$net_nfs_kernel ...; nfs $load_uimage_addr $net_nfs_server:$net_nfs_path/$net_nfs_kernel; echo
net_bootcmd=run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_bootcmd_exec
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/,rsize=32768,wsize=32768,hard,intr,udp,v3 ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:dockstar:eth0:off $mtdparts $custom_params; echo ** Kernel Boot Arguments:; echo ** $bootargs; echo
net_bootcmd_exec=run net_load_uimage; if run net_load_initrd; then if run net_load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; finet_dhcp_s=0
net_nfs_initrd=boot/uInitrd
net_nfs_dtb=boot/dts/kirkwood-pogo_e02.dtb
net_nfs_kernel=boot/uImage
console=ttyS0,115200
bootcmd=run bootcmd_uenv; run scan_disk; run net_bootcmd; run set_bootargs; run bootcmd_exec
Re: Boot your Dockstar by TFTP/NFS
July 31, 2018 08:54AM
Jxjhheric ,

Try this, with USB rootfs plugged in, and without USB rootfs.

setenv bootcmd_exec 'if run load_uimage; then; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi; fi'
setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run net_bootcmd'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
November 26, 2018 01:26PM
Hi there !
Just a small update in case anyone encouters the same issue as I have...

After a kernel update on my Dockstar, I couldn't boot anymore by NFS... There seemed to be an issue with my initramfs...

## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.9.0-8-marvell
   Created:      2018-11-26  18:33:47 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2056160 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.9.0-8-marvell
   Created:      2018-11-26  18:33:54 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    11627464 Bytes = 11.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC

As it turns out, the reason is that the initramfs grew a bit and I didn't have enough space provisioned for the initramfs in my uboot vars to accomodate this:

load_uimage_addr=0x800000
load_initrd_addr=0x1100000
load_dtb_addr=0x1c00000
0x1c00000 - 0x1100000 = 0xB00000 = 11534336 (avail loadspace) < 11627464 (initramfs size)

So a 11627464 initramfs doesn't fit in that space.

The solution is just to adapt the load_dtb_addr to ensure the DTB doesn't overwrite the end of the initramfs.

0x1d00000 - 0x1100000 = 0xC00000 = 12582912 > 11627464

So this made the trick and solved the issue :D
setenv load_dtb_addr 0x1d00000
saveenv
reset

## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.9.0-8-marvell
   Created:      2018-11-26  18:56:30 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2056160 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.9.0-8-marvell
   Created:      2018-11-26  18:56:30 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    11628809 Bytes = 11.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01d00000
   Booting using the fdt blob at 0x1d00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 06ff8000, end 07b0f109 ... OK
   Loading Device Tree to 06ff2000, end 06ff78b1 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Re: Boot your Dockstar by TFTP/NFS
November 26, 2018 04:55PM
tsunulukai,

That's a good way to solve this! But to prevent this happen again, you could also move uInitrd load address to further out:

load_initrd_addr=0x2100000

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
July 25, 2019 10:21AM
When upgrading to Debian Buster, the initrd is ~2Mb bigger than for Stretch:

-rw-r--r-- 1 root root 15163991 2019-07-25 14:04 initrd.img-4.19.0-5-marvell     (Buster)
-rw-r--r-- 1 root root 13500968 2019-07-25 10:28 initrd.img-4.9.0-8-marvell      (Stretch)

So you might need to update the load_dtb_addr again to avoid any issue at nfs boot time. Minimum value is 0x02000000.

setenv load_dtb_addr 0x02000000

bodhi saw it comin'... :D

Greetz



Edited 1 time(s). Last edit at 07/25/2019 11:11AM by tsunulukai.
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 10:50AM
Hi Bodhi and All,

Was wandering around the wiki and found this thread which is very interesting. Since i have a bunch of dockstar and pogoplug e02 devices laying around, I am thinking about putting them to work. Intrigued by bodhi's convincing reasons why booting from NFS I tried to set up one pogoplug (e02) to boot from a NFS server. First I run into compatibility issues with my OpenWRT router that hosts my NFS server and that was solved by having one PogoPlug running Debian to host my NFS server. With netconsole I can see that the kernel images and dtb file were sucessfully loaded from the NFS server and the kernel has started, but could not see the plug on my LAN. I have changed the fstab file (mounting /root/nfs on / as nfs type) and the network interfaces to disable auto on eth0 file on the rootfs on NSF server per the first post. I even tried to use static IP address for the plug but still cannot communicate with it. I also tested the rootfs on my NFS server by copying it to an USB drive then change the fstab file to mount the USB filesystem on / and the USB drive boots successfully!

Did I miss some settings? Any help will be greatly appreciated.

-nnSlick
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 12:33PM
It will be very easy to debug if you have serial output.
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 02:55PM
Thanks David.

I had a serial cable a while back but cannot locate it now so I rely on net console output, which unfortunately stops after the uboot message 'Starting kernel ...'

-nnSlick
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 03:50PM
After posting the message above, I just found yet another excellent 'How To' from Bodhi on how to use net console to trouble shooting kernel booting. I will use that thread to see if I can figure out what went wrong when booting from NFS.

-nnSlick
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 04:29PM
nnSlick,

> (e02) to boot from a NFS server. First I run into
> compatibility issues with my OpenWRT router that
> hosts my NFS server and that was solved by having
> one PogoPlug running Debian to host my NFS server.
> With netconsole I can see that the kernel images
> and dtb file were sucessfully loaded from the NFS
> server and the kernel has started, but could not
> see the plug on my LAN.

> I have changed the fstab
> file (mounting /root/nfs on / as nfs type) and the
> network interfaces to disable auto on eth0 file on
> the rootfs on NSF server per the first post.

Don't need root device in fstab. You should remove the root device completely from fstab.

> even tried to use static IP address for the plug
> but still cannot communicate with it.

Your /etc/network/interfaces should be
auto lo
iface lo inet loopback
iface eth0 inet dhcp

And the only command need to boot NFS rootfs (I posted in one of the Wiki threads about this subject):

bootcmd_nfs=setenv nfs_server "192.168.0.224"; setenv nfs_path "/srv/nfs/hosts/tldDebian2"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.0.229:192.168.0.224:192.168.0.1:255.255.0.0:tldDebian2::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogo_e02.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd

We can look at this command clearly with quote text:

Quote

bootcmd_nfs=setenv nfs_server "192.168.0.224"; setenv nfs_path "/srv/nfs/hosts/tldDebian2"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.0.229:192.168.0.224:192.168.0.1:255.255.0.0:tldDebian2::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogo_e02.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd

This Pogo E02 is one node in my build farm (of several Kirwood boxes boot NFS rootfs).

tldDebian2 is hostname
192.168.0.229 is this box IP
192.168.0.224 is the NFS server where the rootfs is


(When I wrote the envs they are all indented nice and clean block of code. But for convenience to copy to many other boxes, I stripped all spacing so it became a long command that is hard to read).

Test it at netconsole and if it works, change the bootcmd to add it into the chain of booting. For example:
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_nfs; run pogo_bootcmd; reset

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 05/02/2020 04:31PM by bodhi.
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 10:01PM
I want to mention that sometimes, we need to make a little change here: ....nfsroot=$nfs_server:$nfs_path,rw,v3... (Added rw)

I tried 4.12.1 root file system on NFS, without rw, file system after booting is still R/W
but with 5.2.9 root file system on NFS, without rw, file system after booting is read only, with rw, it is R/W

I guess kernel issue? default was changed?
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 10:18PM
Hi bodhi,

As always appreciate your quick response!

I made the changes to fstab and interfaces as you suggested but using the uboot commands setting from the OP I can see that the kernel etc were loaded from NFS server but still no network connection.

I broke your one command to several fw_setenv:
fw_setenv nfs_server "192.168.8.245"
fw_setenv nfs_path "/srv/nfs/rootfs/e02"
fw_setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"
fw_setenv nfs_ipconfig "192.168.8.50:192.168.8.245:192.168.8.1:255.255.255.0:tldDebian2::off"
fw_setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts"
fw_setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"
fw_setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"
fw_setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogo_e02.dtb"
fw_setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"
fw_setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"

but apparently the environment is not set properly. For example, the bootargs variable is set without $nfs_server, $nfs_path and was cut off with 'ip=' . May be differences in setenv and fw_setenv syntax?

How do you set your one command using fw_setenv?

Thanks,
-nnSlick
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 10:42PM
Just use one long long long command to cover it all.

This is mine (copy / changed from bodhi's)

fw_setenv bootcmd_nfs 'setenv nfs_server "192.168.7.87"; setenv nfs_path "/opt/kirkwood"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.7.8:192.168.7.87:192.168.7.1:255.255.255.0:kirkwood::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,rw,v3 rootfstype=nfs rootwait ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-dockstar.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root"; run nfs_bootcmd'

And that's it...
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 10:57PM
nnSlick,

> May be differences in setenv and
> fw_setenv syntax?

Right.

The whole command is supposed to be run in u-boot, not Debian. Instead of breaking it up, what you should do is copy it to a notepad, and reformat it with indentations like in normal script (so you can read). And then modify to your box specifics.

And then put it back to one long command and do one fw_setenv like David did above.

===========

It will take me some careful reworks to make it use only fw_setenv in Debian. So I'd suggest you do the above.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 05/02/2020 11:11PM by bodhi.
Re: Boot your Dockstar by TFTP/NFS
May 02, 2020 11:09PM
David,

> I want to mention that sometimes, we need to make
> a little change here:
> ....nfsroot=$nfs_server:$nfs_path,rw,v3... (Added
> rw)
>
> I tried 4.12.1 root file system on NFS, without
> rw, file system after booting is still R/W
> but with 5.2.9 root file system on NFS, without
> rw, file system after booting is read only, with
> rw, it is R/W
>
> I guess kernel issue? default was changed?

Not the kernel issue. But yes, I think sometime the default changed in newer Debian distribution NFS version and it could affect your rootfs. Or could behave slightly differently.

Mine does not need rw. But I created this rootfs a long time ago (wheezy) and kept upgrading it until Debian 10.

(I print out the /proc/cmdline and uptime in the alias "myinfo' so I can glance at it and see the system info).

root@tldDebian2:~# myinfo
tldDebian2
192.168.0.229  
CloudEngines Pogoplug E02
Linux version 5.6.5-kirkwood-tld-1 (root@tldDebian) (gcc version 8.3.0 (Debian 8.3.0-6)) #1.0 PREEMPT Fri Apr 17 19:27:48 PDT 2020
Debian 10.0
console=ttyS0,115200 root=/dev/nfs nfsroot=192.168.0.224:/srv/nfs/hosts/tldDebian2,v3 rootfstype=nfs rootwait ip=192.168.0.229:192.168.0.224:192.168.0.1:255.255.0.0:tldDebian2::off mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
uboot_version=U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700)
--- System Stats:
Sat 02 May 2020 08:58:50 PM PDT up 2 weeks, 2 hours, 21 minutes

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
May 03, 2020 07:14AM
bodhi and David,

Thanks for the suggestion. I tried to assign a single command with fw_setenv from OpenWRT on NAND but it has command line length limitations. So, I booted up debian and did what you suggest and was able to have a single command to boot up from NFS. Since I am trying with the newest rootfs I also added 'rw' to bootargs. However, still no network.

Where is what I did:

1. set up NFS server, copy rootfs by extracting bodhi's latest rootfs tarball downloaded from dropbox. (I also tried 'cp -a' from a working rootfs on a USB)

my exports: /srv/nfs/rootfs/e02 192.168.8.0/24(rw,sync,insecure,no_root_squash,no_subtree_check,nohide)

2. cd to rootfs on NFS server, remove the root filesystem in /etc/fstab, eth0 in /etc/network/interfaces.
3. power up the e02, interrupt booting with net console, run bootcmd_nfs

I can see images were loaded to memory from NFS server and the kernel has started, but the e02 plug does not show up on my LAN.

May be time to invest in a serial cable (or find my old one.)

-nnSlick



Edited 1 time(s). Last edit at 05/03/2020 07:18AM by nnSlick.
Re: Boot your Dockstar by TFTP/NFS
May 03, 2020 04:08PM
nnSlick,

Use the specific IP address for this plug. And use insecure option only if you want to see the files from a MAC OS computer.

My export::
/srv/nfs/hosts/tldDebian2   192.168.0.229(rw,sync,no_root_squash,no_subtree_check)

And look back in this thread

Quote
tsunulukai

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"

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Boot your Dockstar by TFTP/NFS
May 03, 2020 07:26PM
bodhi,

Bingo, your are the wizard!

After modifying the exports file and add V2 support to the NFS server I was able to boot into my e02 from my NFS server!!! Now I can prepare to have a several of my Pogo devices to run from an NFS server. Really do appreciate your help!

Thanks again,
-nnSlick
tsunulukai
July 31, 2021 09:33AM
Hi there !

Just updated to Debian Bullseye on my dockstar. The update process seemed to go nice and well, until the moment came to reboot: It wouln't boot anymore in NFS.

Hooking up a cable on the serial header, I could see it was stuck during the boot process trying to mount the NFS root mount without success:

Begin: Retrying nfs mount ... mount: Invalid argument
done.
Begin: Retrying nfs mount ... mount: Invalid argument
done.
...

It turns up Bullseye does not support the "udp" nfs mount option anymore.
So just make sure after you update your dockstar to bullseye to update your net_set_bootargs variable as follows:

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,rsize=32768,wsize=32768,hard,intr,v3 ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:dockstar:eth0:off $mtdparts'


N.B.:
to update your dockstar to bullseye, just do the following:

1. Update your /etc/apt/source.list as follows:
# cat etc/apt/sources.list
# Debian Repositories
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free

2. Backup whatever your deem necessary before upgrading. If your rootfs is on a nfs share, just make a complete copy of your nfs root folder before proceeding.

3. Update your distribution by consecutively running:
apt update
apt upgrade --without-new-pkgs
apt full-upgrade

4. If you boot via NFS, update the bootargs to remove the "udp" keyword in the nfsroot variable:
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,rsize=32768,wsize=32768,hard,intr,v3 ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:dockstar:eth0:off $mtdparts'
Re: tsunulukai
July 31, 2021 04:18PM
tsunulukai,

Thanks for the update!

I did not have that udp option in the nfs boot command, so did not notice this.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: tsunulukai
June 17, 2023 07:04AM
Two years later, and another Debian release.

After updating my NFS server to Debian Bookworm (Debian 12), I noticed my dockstars wouldn't boot up anymore from nfs.

A quick lookup with Wireshark gave this network trace:
No. Time      L3Proto    Source        SrcPort    Destination     DstPort   Protocol  Len   Info
 3  0.177599  UDP              0.0.0.0      68    255.255.255.255      67   DHCP      342   DHCP Discover - Transaction ID 0x751a9e2d
 5  0.190444  UDP              0.0.0.0      68    255.255.255.255      67   DHCP      342   DHCP Request  - Transaction ID 0x751a9e2d
 8  0.252969  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 12) MOUNT(100005) V:1 UDP
12  0.253377  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 8) Port:32767
13  0.253468  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 14) NFS(100003) V:2 UDP
14  0.253709  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 13) PROGRAM_NOT_AVAILABLE
15  0.253817  UDP        192.168.10.11    1000       192.168.10.1   32767   MOUNT     142   V2 MNT Call (Reply In 16) /srv/nfs/hosts/dockstar-1A8AAA/boot
16  0.258365  UDP         192.168.10.1   32767      192.168.10.11    1000   MOUNT     102   V2 MNT Reply (Call In 15)
17  0.258468  UDP        192.168.10.11    1000       192.168.10.1       0   NFS       146   V2 LOOKUP Call, DH: 0x5cfcf659/uImage
18  0.258554  ICMP,UDP    192.168.10.1    1000      192.168.10.11       0   ICMP      174   Destination unreachable (Port unreachable)
31  2.253643  UDP        192.168.10.11    1000       192.168.10.1       0   NFS       146   V2 LOOKUP Call, DH: 0x5cfcf659/uImage
32  2.253713  ICMP,UDP    192.168.10.1    1000      192.168.10.11       0   ICMP      174   Destination unreachable (Port unreachable)
51  6.255210  UDP        192.168.10.11    1000       192.168.10.1       0   NFS       146   V2 LOOKUP Call, DH: 0x5cfcf659/uImage
52  6.255295  ICMP,UDP    192.168.10.1    1000      192.168.10.11       0   ICMP      174   Destination unreachable (Port unreachable)

A deeper dive on packet 14 show this:
User Datagram Protocol, Src Port: 111, Dst Port: 1000
Remote Procedure Call, Type:Reply XID:0x00000002
    XID: 0x00000002 (2)
    Message Type: Reply (1)
    [Program: Portmap (100000)]
    [Program Version: 2]
    [Procedure: GETPORT (3)]
    Reply State: accepted (0)
    [This is a reply to a request in frame 13]
    [Time from request: 0.000241000 seconds]
    Verifier
        Flavor: AUTH_NULL (0)
        Length: 0
    Accept State: RPC executed successfully (0)
Portmap GETPORT Reply Port:0 PROGRAM_NOT_AVAILABLE
    [Program Version: 2]
    [V2 Procedure: GETPORT (3)]
    Port: 0

Here's what happens:
  • Packet 13: uBoot requests a NFSv2 connection in UDP to the server.
  • Packet 14: Debian bookworm updated NFS server has both NFSv2 and it's UDP listener disabled by default, so it replies with a "PROGRAM_NOT_AVAILABLE" error, which is done by replying the service is mapped on port 0 (which is not possible)
  • Packet 15: uBoot nfs client misinterprets the response and goes on the try and mount the target folder.
  • Packet 16: The mount command succeeds... The server returns a handle for the folder requested by the client.
  • Packet 17: uBoot tries to download the linux kernel by NFS using the handle from packet 16 and the port received in packet 14 (which it wrongly interpreted as a port number instead of an error)
  • Packet 18: Having no NFS server listening on port UDP/0, the server replies with an ICMP port unreachable message
From then on, it keeps looping, with uBoot not being aware that it cannot request the file this way, therefore retrying indefinitely, and the server invariably answering with an ICMP port unreachable packets...


Now, enabling NFSv2 is not required here, as once we configure the NFS server to accept incoming NFS connection by UDP, it will answer that NFSv2 is not supported, and this will trigger uboot to try again using NFSv3 (that is, provided your dockstar is using an updated uboot, otherwise, just uncomment the vers2 line below).

So the question is: how do you enable UDP for the nfs-kernel-server in debian bookworm ?

Not by configuring options in /etc/default/nfs, which is not how it happens anymore, but by adding this file to the system:
# cat /etc/nfs.conf.d/nfs-udp.conf
[nfsd]
udp = y
#vers2 = y

Then restart the NFS server :
systemctl restart nfs-kernel-server

Now let's restart the dockstar and fire up Wireshark again:
No. Time      L3Proto    Source        SrcPort    Destination     DstPort   Protocol  Len   Info
15  2.454368  UDP           0.0.0.0         68    255.255.255.255      67   DHCP      342   DHCP Discover - Transaction ID 0x751a9e2c
16  2.484983  UDP           0.0.0.0         68    255.255.255.255      67   DHCP      342   DHCP Request  - Transaction ID 0x751a9e2c
19  2.537546  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 20) MOUNT(100005) V:1 UDP
20  2.537908  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 19) Port:32767
21  2.537983  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 22) NFS(100003) V:2 UDP
22  2.538255  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 21) Port:2049
23  2.538355  UDP        192.168.10.11    1000       192.168.10.1   32767   MOUNT     142   V2 MNT Call (Reply In 24) /srv/nfs/hosts/dockstar-1A8AAA/boot
24  2.542859  UDP         192.168.10.1   32767      192.168.10.11    1000   MOUNT     102   V2 MNT Reply (Call In 23)
25  2.542951  UDP        192.168.10.11    1000       192.168.10.1    2049   NFS       146   V2 LOOKUP Call (Reply In 26), DH: 0x5cfcf659/uImage
26  2.545253  UDP         192.168.10.1    2049      192.168.10.11    1000   NFS       74    V2 LOOKUP Reply (Call In 25)
27  2.545351  UDP        192.168.10.11    1000       192.168.10.1   32767   MOUNT     102   V2 UMNTALL Call (Reply In 33)
28  2.545352  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 29) MOUNT(100005) V:3 UDP
29  2.545671  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 28) Port:32767
30  2.545754  UDP        192.168.10.11    1000       192.168.10.1     111   Portmap   98    V2 GETPORT Call (Reply In 31) NFS(100003) V:3 UDP
31  2.545942  UDP         192.168.10.1     111      192.168.10.11    1000   Portmap   70    V2 GETPORT Reply (Call In 30) Port:2049
32  2.546044  UDP        192.168.10.11    1000       192.168.10.1   32767   MOUNT     142   V2 MNT Call (Reply In 34) /srv/nfs/hosts/dockstar-1A8AAA/boot
33  2.556613  UDP         192.168.10.1   32767      192.168.10.11    1000   MOUNT     66    V2 UMNTALL Reply (Call In 27)
34  2.557323  UDP         192.168.10.1   32767      192.168.10.11    1000   MOUNT     102   V2 MNT Reply (Call In 32)
35  2.557412  UDP        192.168.10.11    1000       192.168.10.1    2049   NFS       150   V3 LOOKUP Call (Reply In 36), DH: 0x5cfcf659/uImage
36  2.562397  UDP         192.168.10.1    2049      192.168.10.11    1000   NFS       274   V3 LOOKUP Reply (Call In 35), FH: 0xfee760ec
37  2.562501  UDP        192.168.10.11    1000       192.168.10.1    2049   NFS       146   V3 READ Call (Reply In 38), FH: 0xfee760ec Offset: 0 Len: 1024
38  2.562680  UDP         192.168.10.1    2049      192.168.10.11    1000   NFS       1194  V3 READ Reply (Call In 37) Len: 1024
...

And now we're back with a working setup. The dockstar is able to boot normally by NFS once again.



Edited 1 time(s). Last edit at 06/17/2023 07:05AM by tsunulukai.
Re: tsunulukai
June 17, 2023 02:56PM
Hi tsunulukai,

> So the question is: how do you enable UDP for the
> nfs-kernel-server in debian bookworm ?
>
> Not by configuring options in /etc/default/nfs,
> which is not how it happens anymore, but by adding
> this file to the system:
>
> # cat /etc/nfs.conf.d/nfs-udp.conf
> [nfsd]
> udp = y
> #vers2 = y
>

>
> And now we're back with a working setup. The
> dockstar is able to boot normally by NFS once
> again.

Nice!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: tsunulukai
June 17, 2023 03:28PM
Added to the Wiki thread


Quote

NFS

....
Boot your Dockstar (and other plugs) using NFS rootfs, see also Debian 12 (bookworm) settings
....

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

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: