Welcome! Log In Create A New Profile

Advanced

saveenv

Posted by balanga 
saveenv
February 18, 2019 06:36PM
When the saveenv command is issued, is there any indication that it has completed successfully?

I changed a couple of environment variables and waited and waited to see some acknowledgement, but saw nothing so rebooted, but the variables were unchanged.

How long should such a process take?
Re: saveenv
February 18, 2019 11:28PM
balanga Wrote:
-------------------------------------------------------
> When the saveenv command is issued, is there any
> indication that it has completed successfully?
>
> I changed a couple of environment variables and
> waited and waited to see some acknowledgement, but
> saw nothing so rebooted, but the variables were
> unchanged.
>
> How long should such a process take?

That should be immediate.

Start netconsole, power up the GFHome, interrupt netconsole and,

setenv test_123 yes
printenv test_123
setenv test_123 no
printenv test_123

And please post the log here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: saveenv
February 19, 2019 03:55AM
Script started on Tue Feb 19 09:20:34 2019
You have mail.
root@FreeBSD:~/testing # nc -up 6666 192.168.1.22 6666


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot: 10 ... 9
... 0
GoFlexHome> setenv test_123 yes
setenv test_123 yes
GoFlexHome> printenv test_123
printenv test_123
test_123=yes
GoFlexHome> setenv test_123 no
setenv test_123 no
GoFlexHome> printenv test_123
printenv test_123
test_123=no
GoFlexHome> saveenv
saveenv
Saving Environment to NAND...
Erasing NAND...

Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
GoFlexHome> reset
reset
resetting ...
88E1116 Initialized on egiga0
host 192.168.1.43 is alive
host 192.168.1.43 is alive
host 192.168.1.43 is alive
host 192.168.1.43 is alive
host 192.168.1.43 is alive

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot: 10 ... 9
... 0
GoFlexHome> printenv
printenv
arcNumber=3338
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
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
dtb_file=/boot/dts/kirkwood-goflexhome.dtb
ethact=egiga0
ethaddr=00:10:75:2e:ae:0f
if_netconsole=ping $serverip
ipaddr=192.168.1.22
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
nc_ready=1
ncip=192.168.1.43
partition=nand0,2
preboot=run preboot_nc
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_net
console; fi
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 t
est $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 $disk
num: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; do
ne
serverip=192.168.1.43
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=nc
stdin=nc
stdout=nc
test_123=no
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=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
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
usb_ready_retry=15

Environment size: 3040/131068 bytes
GoFlexHome> setenv serverip 192.168.1.2
setenv serverip 192.168.1.2
GoFlexHome> printenv serverip
printenv serverip
serverip=192.168.1.2
GoFlexHome> setenv ncip 192.168.1.2
setenv ncip 192.168.1.2
GoFlexHome> printenv ncip
^C

root@FreeBSD:~/testing # exit

exit

After entering printenv ncip the system just hung. As you can see test_123 was saved OK using saveenv. I'm trying to change serverip and ncip although I'm not sure how they inter relate. Is ncip used as the target for nc output? And can serverip be used for using tftp?

Ideally, I'd like to boot using tftp only if an image is available.
Re: saveenv
February 19, 2019 01:13PM
balanga,

> After entering printenv ncip the system
> just hung. As you can see test_123 was
> saved OK using saveenv.

So that proved there is no problem saving env.

> I'm trying to change
> serverip and ncip although I'm not sure how they
> inter relate. Is ncip used as the target for nc
> output? And can serverip be used for using tftp?
>
> Ideally, I'd like to boot using tftp only if an
> image is available.

The only IP addresses that you should change are ipaddr and serverip. ncip is generated and used by netconsole, that's why it hang when you change it (connection was lost). serverip is used for all network servers upon boot that this box talks to: netconsole and tftp.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: saveenv
February 24, 2019 11:53PM
On another system I successfully changed ipaddr and serverip but ncip did not change. It remained as 10.10.10.5. I also noticed on this system there was also an ncipk which was set to 10.10.10.4.

I'm booting using kwboot, but wanted to see the output on a remote system so wanted to use netconsole but it isn't working.
Re: saveenv
February 25, 2019 12:04AM
balanga,

> I'm booting using kwboot, but wanted to see the
> output on a remote system so wanted to use
> netconsole but it isn't working.

No, it will not work. When you boot with kwboot, the internal envs are used (the envs area has not been flashed), therefore netconsole won't work.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: