[U-Boot] auto-update and DHCP

Beaman, Thomas Thomas.Beaman at xerox.com
Fri Feb 5 22:11:44 CET 2010


 
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 at denx.de] 
Sent: Friday, February 05, 2010 3:48 PM
To: Beaman, Thomas
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] auto-update and DHCP

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