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 06:29PM
Try:

setenv console ‘ttyS0,115200’
boot

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Boot your Dockstar by TFTP/NFS
July 27, 2018 07: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 03: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 03: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 05:14PM by Jxjhheric.
Re: Boot your Dockstar by TFTP/NFS
July 30, 2018 04: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 05: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 06: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 07: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 07: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 12: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 03: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
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: