[libubootenv] fw_printenv: set 'u-boot-initial-env' file as default
diff mbox series

Message ID 1556823867-11911-1-git-send-email-pjtexier@koncepto.io
State Changes Requested
Headers show
Series
  • [libubootenv] fw_printenv: set 'u-boot-initial-env' file as default
Related show

Commit Message

'Chmielewski Andreas' via swupdate May 2, 2019, 7:04 p.m. UTC
Since commit [1] in U-Boot, this is the file with the initial environment
delivered with the bootloader.
So, let's set this name as default.

Tested with Buildroot as follows:

Cannot read environment, using default
baudrate=115200
...

Cannot read environment, using default

foo=bar

[1] https://github.com/u-boot/u-boot/commit/bdaa73a5b3923257add182b4ab8058dbfa33421b#diff-b67911656ef5d18c4ae36cb6741b7965

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
---
 src/fw_printenv.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/src/fw_printenv.c b/src/fw_printenv.c
index 361d150..5f75db7 100644
--- a/src/fw_printenv.c
+++ b/src/fw_printenv.c
@@ -121,6 +121,9 @@  int main (int argc, char **argv) {
 		exit (ret);
 	}
 
+	if (!defenvfile)
+		defenvfile = "/etc/u-boot-initial-env";
+
 	if ((ret = libuboot_open(ctx)) < 0) {
 		fprintf(stderr, "Cannot read environment, using default\n");
 		if ((ret = libuboot_load_file(ctx, defenvfile)) < 0) {