diff mbox

[U-Boot] distro_bootcmd: do not try to fetch unused bootfile for PXE

Message ID 1449098137-7529-1-git-send-email-stefan.bruens@rwth-aachen.de
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Stefan Brüns Dec. 2, 2015, 11:15 p.m. UTC
pxe get derives the pxelinux config file name from the bootfile name,
but the bootfile itself is never used and might not even exist.
Disable bootfile autoload to avoid the delay.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 include/config_distro_bootcmd.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stephen Warren Dec. 3, 2015, 5:09 p.m. UTC | #1
On 12/02/2015 04:15 PM, Stefan Brüns wrote:
> pxe get derives the pxelinux config file name from the bootfile name,
> but the bootfile itself is never used and might not even exist.
> Disable bootfile autoload to avoid the delay.

I wasn't CC'd on this and only accidentally noticed it, since it just 
happened to be the first email in this list folder this morning. It's 
good to CC people based on ./scripts/get_maintainer.pl's output.

> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h

>   #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
>   	"bootcmd_pxe=" \
>   		BOOTENV_RUN_USB_INIT \
> -		"dhcp; " \
> +		"env exists autoload && setenv autoload_save ${autoload}; " \
> +			"setenv autoload no; dhcp; " \
> +		"env exists autoload_save && setenv autoload ${autoload_save}; " \

I think that last line should be unconditional; the previous statement 
unconditionally sets autoload to no, so we want to unconditionally 
restore the previous value of autoload, irrespective of whether it was 
set or not.

I'd expect:

setenv autoload_save $autoload
setenv autoload no
dhcp
setenv autoload $autoload_save
setenv autoload_save

(or a cmdline option to "dhcp" to force it to only acquire an IP address 
would be nice too).
diff mbox

Patch

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 66264ce..c9d4b25 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -176,7 +176,9 @@ 
 #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
 	"bootcmd_pxe=" \
 		BOOTENV_RUN_USB_INIT \
-		"dhcp; " \
+		"env exists autoload && setenv autoload_save ${autoload}; " \
+			"setenv autoload no; dhcp; " \
+		"env exists autoload_save && setenv autoload ${autoload_save}; " \
 		"if pxe get; then " \
 			"pxe boot; " \
 		"fi\0"