I couldn’t get fw_setenv to work using stdin
echo test1=test1 > /var/run/test
root@octave-imx8mnevk:~# fw_setenv -s - < /var/run/test
root@octave-imx8mnevk:~# fw_printenv | grep test1
root@octave-imx8mnevk:~#
root@octave-imx8mnevk:~# fw_setenv -s /var/run/test
root@octave-imx8mnevk:~# fw_printenv | grep test1
test1=test1
I looked through the libubootenv code and can’t see how it processes - for stdin, in the u-boot version you can see
if (strcmp(fname, "-") == 0)
fp = stdin;
But I don’t see anything for libubootenv, if you run
fw_setenv -s -
it just returns, in fact if you specify a non existent file it returns
root@octave-imx8mnevk:~# fw_setenv -s /doesnt/exist
root@octave-imx8mnevk:~# echo $?
0
I’m using v0.2 of libubootenv, do I need a different version?