[U-Boot] auto-update and DHCP

Wolfgang Denk wd at denx.de
Fri Feb 5 21:47:44 CET 2010


Dear Tom,

In message <561E05732443A84A9BB3A75519C098F60B5A9D22 at 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

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who knows history, particularly the history of Europe, will, I
think, recognize that the domination of education or of government by
any one particular religious faith is never a happy  arrangement  for
the people.                                       - Eleanor Roosevelt


More information about the U-Boot mailing list