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
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
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
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
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
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
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



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



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
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
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
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: