Is it possible to read u-boot environment variables from MLO? I want to set a flag and have the MLO see it on the next power up and then take a specific action. I tried this:
u-boot-[version]/common/spl/spl_nand.c
char *ep = NULL; // //...function stuff... // /* Load u-boot */ ep = getenv("upgrade"); if(ep != NULL) puts(ep); else puts("upgrade not defined"); nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
That built fine, and on the first time it ran I got back "upgrade not defined" in the boot log:
USB Host mode controller at 47401800 using PIO, IRQ 0 upgrade not defined U-Boot 2013.01.01 (Apr 22 2014 - 08:59:59)
which I expected, then I saved a value for "upgrade":
U-Boot# setenv upgrade BOOYA U-Boot# saveenv
On the next power up I again saw "upgrade not defined" in the boot log just as before, but when u-boot fully came up and I ran a printenv, I saw "upgrade" present and set as I expected:
U-Boot# printenv ... stdout=serial upgrade=BOOYA usbnet_devaddr=00:18:31:8f:1b:7b ...
So I'm wondering why MLO failed to recognize the variable as set? Is it possible to read environment variables at all from MLO? If not, is there any way I can "set a flag" and have MLO trigger on it?