diff mbox

[U-Boot,V2,1/4] pxe: allow compilation when !defined(CONFIG_CMD_NET)

Message ID 1391658563-10962-1-git-send-email-swarren@wwwdotorg.org
State Accepted
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Stephen Warren Feb. 6, 2014, 3:49 a.m. UTC
pxe.c provides both the "pxe" command which relies on a network, and the
"sysboot" command which doesn't. Fix the file to compile when network
support isn't enabled. This is useful e.g. on the Raspberry Pi which has
no network support yet, but will soon support the sysboot command.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
v2: No change.

This patch doesn't appear to depend on anything much, but is needed by
the rest of this series. Given the dependencies in the rest of this
series, either (a) this one patch can be applied to u-boot/master, and
then u-boot/arm can merge that in before the rest of the series, or (b)
u-boot/master can be merged into u-boot-arm/master, then this whole
series applied there.
---
 common/cmd_pxe.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Albert ARIBAUD Feb. 10, 2014, 8:52 a.m. UTC | #1
Hi Stephen,

On Wed,  5 Feb 2014 20:49:20 -0700, Stephen Warren
<swarren@wwwdotorg.org> wrote:

> pxe.c provides both the "pxe" command which relies on a network, and the
> "sysboot" command which doesn't. Fix the file to compile when network
> support isn't enabled. This is useful e.g. on the Raspberry Pi which has
> no network support yet, but will soon support the sysboot command.
> 
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
> v2: No change.
> 
> This patch doesn't appear to depend on anything much, but is needed by
> the rest of this series. Given the dependencies in the rest of this
> series, either (a) this one patch can be applied to u-boot/master, and
> then u-boot/arm can merge that in before the rest of the series, or (b)
> u-boot/master can be merged into u-boot-arm/master, then this whole
> series applied there.

I'm ok with applying the series to u-boot-arm since it is 75%
arm-specific and I prefer whole series to be applied in the same repo.

Amicalement,
Stephen Warren Feb. 21, 2014, 4:14 a.m. UTC | #2
On 02/05/2014 08:49 PM, Stephen Warren wrote:
> pxe.c provides both the "pxe" command which relies on a network, and the
> "sysboot" command which doesn't. Fix the file to compile when network
> support isn't enabled. This is useful e.g. on the Raspberry Pi which has
> no network support yet, but will soon support the sysboot command.

Albert, does this series look good? Everything it relies on should be in
u-boot/master for a while now. Thanks.
Albert ARIBAUD Feb. 21, 2014, 2:31 p.m. UTC | #3
Hi Stephen,

On Thu, 20 Feb 2014 21:14:52 -0700, Stephen Warren
<swarren@wwwdotorg.org> wrote:

> On 02/05/2014 08:49 PM, Stephen Warren wrote:
> > pxe.c provides both the "pxe" command which relies on a network, and the
> > "sysboot" command which doesn't. Fix the file to compile when network
> > support isn't enabled. This is useful e.g. on the Raspberry Pi which has
> > no network support yet, but will soon support the sysboot command.
> 
> Albert, does this series look good? Everything it relies on should be in
> u-boot/master for a while now. Thanks.

Series looks good, just waiting to be applied and tested.

Amicalement,
Tom Rini Feb. 21, 2014, 2:41 p.m. UTC | #4
On Fri, Feb 21, 2014 at 03:31:07PM +0100, Albert ARIBAUD wrote:
> Hi Stephen,
> 
> On Thu, 20 Feb 2014 21:14:52 -0700, Stephen Warren
> <swarren@wwwdotorg.org> wrote:
> 
> > On 02/05/2014 08:49 PM, Stephen Warren wrote:
> > > pxe.c provides both the "pxe" command which relies on a network, and the
> > > "sysboot" command which doesn't. Fix the file to compile when network
> > > support isn't enabled. This is useful e.g. on the Raspberry Pi which has
> > > no network support yet, but will soon support the sysboot command.
> > 
> > Albert, does this series look good? Everything it relies on should be in
> > u-boot/master for a while now. Thanks.
> 
> Series looks good, just waiting to be applied and tested.

Soon then please?  Thanks! :)
Albert ARIBAUD Feb. 22, 2014, 1:04 p.m. UTC | #5
Hi Stephen,

On Wed,  5 Feb 2014 20:49:20 -0700, Stephen Warren
<swarren@wwwdotorg.org> wrote:

> pxe.c provides both the "pxe" command which relies on a network, and the
> "sysboot" command which doesn't. Fix the file to compile when network
> support isn't enabled. This is useful e.g. on the Raspberry Pi which has
> no network support yet, but will soon support the sysboot command.
> 
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
> v2: No change.
> 
> This patch doesn't appear to depend on anything much, but is needed by
> the rest of this series. Given the dependencies in the rest of this
> series, either (a) this one patch can be applied to u-boot/master, and
> then u-boot/arm can merge that in before the rest of the series, or (b)
> u-boot/master can be merged into u-boot-arm/master, then this whole
> series applied there.
> ---
>  common/cmd_pxe.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
> index 29e48db..3d13268 100644
> --- a/common/cmd_pxe.c
> +++ b/common/cmd_pxe.c
> @@ -45,6 +45,7 @@ static char *from_env(const char *envvar)
>  	return ret;
>  }
>  
> +#ifdef CONFIG_CMD_NET
>  /*
>   * Convert an ethaddr from the environment to the format used by pxelinux
>   * filenames based on mac addresses. Convert's ':' to '-', and adds "01-" to
> @@ -75,6 +76,7 @@ static int format_mac_pxe(char *outbuf, size_t outbuf_len)
>  
>  	return 1;
>  }
> +#endif
>  
>  /*
>   * Returns the directory the file specified in the bootfile env variable is
> @@ -120,6 +122,7 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path,
>  
>  static int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr);
>  
> +#ifdef CONFIG_CMD_NET
>  static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
>  {
>  	char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
> @@ -132,6 +135,7 @@ static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
>  
>  	return 1;
>  }
> +#endif
>  
>  static char *fs_argv[5];
>  
> @@ -249,6 +253,8 @@ static int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path, void *file_addr
>  	return 1;
>  }
>  
> +#ifdef CONFIG_CMD_NET
> +
>  #define PXELINUX_DIR "pxelinux.cfg/"
>  
>  /*
> @@ -397,6 +403,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  
>  	return 1;
>  }
> +#endif
>  
>  /*
>   * Wrapper to make it easier to store the file at file_path in the location
> @@ -647,6 +654,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
>  		len += strlen(ip_str);
>  	}
>  
> +#ifdef CONFIG_CMD_NET
>  	if (label->ipappend & 0x2) {
>  		int err;
>  		strcpy(mac_str, " BOOTIF=");
> @@ -655,6 +663,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
>  			mac_str[0] = '\0';
>  		len += strlen(mac_str);
>  	}
> +#endif
>  
>  	if (label->append)
>  		len += strlen(label->append);
> @@ -1500,6 +1509,7 @@ static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
>  	boot_unattempted_labels(cmdtp, cfg);
>  }
>  
> +#ifdef CONFIG_CMD_NET
>  /*
>   * Boots a system using a pxe file
>   *
> @@ -1576,6 +1586,7 @@ U_BOOT_CMD(
>  	"get - try to retrieve a pxe file using tftp\npxe "
>  	"boot [pxefile_addr_r] - boot from the pxe file at pxefile_addr_r\n"
>  );
> +#endif
>  
>  /*
>   * Boots a system using a local disk syslinux/extlinux file

Applied the whole series to u-boot-arm/master, thanks!

Amicalement,
diff mbox

Patch

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 29e48db..3d13268 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -45,6 +45,7 @@  static char *from_env(const char *envvar)
 	return ret;
 }
 
+#ifdef CONFIG_CMD_NET
 /*
  * Convert an ethaddr from the environment to the format used by pxelinux
  * filenames based on mac addresses. Convert's ':' to '-', and adds "01-" to
@@ -75,6 +76,7 @@  static int format_mac_pxe(char *outbuf, size_t outbuf_len)
 
 	return 1;
 }
+#endif
 
 /*
  * Returns the directory the file specified in the bootfile env variable is
@@ -120,6 +122,7 @@  static int get_bootfile_path(const char *file_path, char *bootfile_path,
 
 static int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr);
 
+#ifdef CONFIG_CMD_NET
 static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
 {
 	char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
@@ -132,6 +135,7 @@  static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
 
 	return 1;
 }
+#endif
 
 static char *fs_argv[5];
 
@@ -249,6 +253,8 @@  static int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path, void *file_addr
 	return 1;
 }
 
+#ifdef CONFIG_CMD_NET
+
 #define PXELINUX_DIR "pxelinux.cfg/"
 
 /*
@@ -397,6 +403,7 @@  do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	return 1;
 }
+#endif
 
 /*
  * Wrapper to make it easier to store the file at file_path in the location
@@ -647,6 +654,7 @@  static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 		len += strlen(ip_str);
 	}
 
+#ifdef CONFIG_CMD_NET
 	if (label->ipappend & 0x2) {
 		int err;
 		strcpy(mac_str, " BOOTIF=");
@@ -655,6 +663,7 @@  static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 			mac_str[0] = '\0';
 		len += strlen(mac_str);
 	}
+#endif
 
 	if (label->append)
 		len += strlen(label->append);
@@ -1500,6 +1509,7 @@  static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
 	boot_unattempted_labels(cmdtp, cfg);
 }
 
+#ifdef CONFIG_CMD_NET
 /*
  * Boots a system using a pxe file
  *
@@ -1576,6 +1586,7 @@  U_BOOT_CMD(
 	"get - try to retrieve a pxe file using tftp\npxe "
 	"boot [pxefile_addr_r] - boot from the pxe file at pxefile_addr_r\n"
 );
+#endif
 
 /*
  * Boots a system using a local disk syslinux/extlinux file