[U-Boot] so u-boot can be configured to try to update itself on every boot?

kind of a trivial question but i was just perusing the code related to FIT images and ran across this in main.c:
/* We come here after U-Boot is initialised and ready to process commands */ void main_loop(void) { const char *s;
bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
#ifdef CONFIG_VERSION_VARIABLE setenv("ver", version_string); /* set version variable */ #endif /* CONFIG_VERSION_VARIABLE */
cli_init();
run_preboot_environment_command();
#if defined(CONFIG_UPDATE_TFTP) update_tftp(0UL, NULL, NULL); <----- THERE #endif /* CONFIG_UPDATE_TFTP */ ... snip ...
i'm assuming that, given the proper configuration, u-boot will try to update its own binary on every single boot, yes? not sure why i never noticed that before.
rday

Dear Robert,
In message alpine.LFD.2.20.1703290927110.21547@uk63952.mitel.com you wrote:
kind of a trivial question but i was just perusing the code related to FIT images and ran across this in main.c:
...
#if defined(CONFIG_UPDATE_TFTP) update_tftp(0UL, NULL, NULL); <----- THERE #endif /* CONFIG_UPDATE_TFTP */ ... snip ...
i'm assuming that, given the proper configuration, u-boot will try to update its own binary on every single boot, yes? not sure why i never noticed that before.
This is documented in the "README" and especially in the "doc/README.update" files. It also describes how one would normally use the "updatefile" environment variable to enable / disable this feature. But yes, if you keep this vaiable around, this will repeat on every boot, according to good old UNIX philosophy:
"UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn
;-)
Best regards,
Wolfgang Denk

On Wed, 29 Mar 2017, Wolfgang Denk wrote:
Dear Robert,
In message alpine.LFD.2.20.1703290927110.21547@uk63952.mitel.com you wrote:
kind of a trivial question but i was just perusing the code related to FIT images and ran across this in main.c:
...
#if defined(CONFIG_UPDATE_TFTP) update_tftp(0UL, NULL, NULL); <----- THERE #endif /* CONFIG_UPDATE_TFTP */ ... snip ...
i'm assuming that, given the proper configuration, u-boot will try to update its own binary on every single boot, yes? not sure why i never noticed that before.
This is documented in the "README" and especially in the "doc/README.update" files. It also describes how one would normally use the "updatefile" environment variable to enable / disable this feature. But yes, if you keep this vaiable around, this will repeat on every boot, according to good old UNIX philosophy:
"UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn
yup, i eventually found that README.update file, this behaviour is just fine for what i'm doing, thanks.
rday
participants (2)
-
Robert P. J. Day
-
Wolfgang Denk