[U-Boot] auto-update and DHCP

Hi,
I would like to use the auto-update feature that is enabled with CONFIG_UPDATE_TFTP, which requires that the env variable serverip be set for the tftp access. Our system uses DHCP to get the serverip env variable, but this happens after the auto-update attempt has run. I have not been able to find any documentation on using CONFIG_UPDATE_TFTP with DHCP, any ideas on how to setup this configuration.
Thanks, Tom

Dear Tom,
In message 561E05732443A84A9BB3A75519C098F60B5A9D22@USA0300MS03.na.xerox.net you wrote:
I would like to use the auto-update feature that is enabled with CONFIG_UPDATE_TFTP, which requires that the env variable serverip be set for the tftp access. Our system uses DHCP to get the serverip env variable, but this happens after the auto-update attempt has run. I have not been able to find any documentation on using CONFIG_UPDATE_TFTP with DHCP, any ideas on how to setup this configuration.
I guess this will not work with the code as is. But you can try to apply this patch, and then run the "dhcp" command from your "preboot" settings:
diff --git a/common/main.c b/common/main.c index 10d8904..c860b0b 100644 --- a/common/main.c +++ b/common/main.c @@ -305,10 +305,6 @@ void main_loop (void) trab_vfd (bmp); #endif /* CONFIG_VFD && VFD_TEST_LOGO */
-#if defined(CONFIG_UPDATE_TFTP) - update_tftp (); -#endif /* CONFIG_UPDATE_TFTP */ - #ifdef CONFIG_BOOTCOUNT_LIMIT bootcount = bootcount_load(); bootcount++; @@ -369,6 +365,10 @@ void main_loop (void) } #endif /* CONFIG_PREBOOT */
+#if defined(CONFIG_UPDATE_TFTP) + update_tftp (); +#endif /* CONFIG_UPDATE_TFTP */ + #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) s = getenv ("bootdelay"); bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
Note this is completely untested.
Best regards,
Wolfgang Denk

Wolfgang,
This patch and running dhcp from preboot does work as expected. Is this a change that should be put back?
Another question on this topic, what is the general strategy on auto-updates. If I leave the .itb file on the tftpserver an update will occur on every reboot. Is there a way to check any version info from the .itb or uboot file to know if I am already at the uboot version in the .itb file and then not attempt the flash update?
Regards, Tom
-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Friday, February 05, 2010 3:48 PM To: Beaman, Thomas Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] auto-update and DHCP
Dear Tom,
In message 561E05732443A84A9BB3A75519C098F60B5A9D22@USA0300MS03.na.xerox.net you wrote:
I would like to use the auto-update feature that is enabled with CONFIG_UPDATE_TFTP, which requires that the env variable serverip be set for the tftp access. Our system uses DHCP to get the serverip env
variable, but this happens after the auto-update attempt has run. I have not been able to find any documentation on using CONFIG_UPDATE_TFTP with DHCP, any ideas on how to setup this
configuration.
I guess this will not work with the code as is. But you can try to apply this patch, and then run the "dhcp" command from your "preboot" settings:
diff --git a/common/main.c b/common/main.c index 10d8904..c860b0b 100644 --- a/common/main.c +++ b/common/main.c @@ -305,10 +305,6 @@ void main_loop (void) trab_vfd (bmp); #endif /* CONFIG_VFD && VFD_TEST_LOGO */
-#if defined(CONFIG_UPDATE_TFTP) - update_tftp (); -#endif /* CONFIG_UPDATE_TFTP */ - #ifdef CONFIG_BOOTCOUNT_LIMIT bootcount = bootcount_load(); bootcount++; @@ -369,6 +365,10 @@ void main_loop (void) } #endif /* CONFIG_PREBOOT */
+#if defined(CONFIG_UPDATE_TFTP) + update_tftp (); +#endif /* CONFIG_UPDATE_TFTP */ + #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) s = getenv ("bootdelay"); bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
Note this is completely untested.
Best regards,
Wolfgang Denk

Dear "Beaman, Thomas",
In message 561E05732443A84A9BB3A75519C098F60B5A9D24@USA0300MS03.na.xerox.net you wrote:
This patch and running dhcp from preboot does work as expected. Is this a change that should be put back?
Done.
Best regards,
Wolfgang Denk
participants (2)
-
Beaman, Thomas
-
Wolfgang Denk