No subject


Fri Jan 23 11:48:37 CET 2009


  autoload	- if set to "no" (any string beginning with 'n'),
		  "bootp" will just load perform a lookup of the
		  configuration from the BOOTP server, but not try to
		  load any image using TFTP


which suggests that this is the correct behavior (i.e. it defaults to
autoload=3Dyes)

>
> There are two options how to fix it:
> 1. Move TftpStart() which is in this patch
> 2. Change functionality if autoload is not setup, set NetSate and ends.
>
> @@ -165,7 +165,8 @@ static void auto_load(void)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0#endif
> =A0 =A0 =A0 =A0TftpStart();
> - =A0 =A0 =A0 }
> + =A0 =A0 =A0 } else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 NetState =3D NETLOOP_SUCCESS;
> =A0}
>
> CC: Eric B=E9nard <eric at eukrea.com>
> CC: Simon Glass <sjg at chromium.org>
> Signed-off-by: Michal Simek <monstr at monstr.eu>
> ---
> =A0net/bootp.c | =A0 =A02 +-
> =A01 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bootp.c b/net/bootp.c
> index 3db08ea..a003c42 100644
> --- a/net/bootp.c
> +++ b/net/bootp.c
> @@ -164,8 +164,8 @@ static void auto_load(void)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0#endif
> - =A0 =A0 =A0 TftpStart();
> =A0 =A0 =A0 =A0}
> + =A0 =A0 =A0 TftpStart();
> =A0}


Isn't this the opposite of the patch you want? I think you want to
move TftpStart() inside the loop, like this:

static void auto_load(void)
{
	const char *s =3D getenv("autoload");

	if (s !=3D NULL) {
		if (*s =3D=3D 'n') {
			/*
			 * Just use BOOTP to configure system;
			 * Do not use TFTP to load the bootfile.
			 */
			NetState =3D NETLOOP_SUCCESS;
			return;
		}
#if defined(CONFIG_CMD_NFS)
		if (strcmp(s, "NFS") =3D=3D 0) {
			/*
			 * Use NFS to load the bootfile.
			 */
			NfsStart();
			return;
		TftpStart();
		}
#endif
	}
}


but we should first agree that this is the expected behavior, and
change the README.

Regards,
Simon

>
> =A0#if !defined(CONFIG_CMD_DHCP)
> --
> 1.5.5.6
>
>


More information about the U-Boot mailing list