Skip to contentSkip to conversation

cmd: remove NET and CMD_NET dependency for CMD_PXE

PATCH New Patrice Chotard 2 participants 3 messages Oct 28, 2019 – Oct 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: remove NET and CMD_NET dependency for CMD_PXE

It allows to use sysboot command on board which have no NET support.

Currently, sysboot command can't be used if CMD_NET and NET flags are not set, while sysboot allows to load extlinux.conf file from local filesystem, so it doesn't need to depend of CMD_NET and NET flags.

One solution would be to put sysboot command's code outside pxe.c and create a new sysboot.c file. But sysboot command code is imbricated with pxe command code and as all CMD_NET relative code is already under CMD_NET flag, the easiest way to break sysboot dependency with CMD_NET and NET flags is to move CMD_PXE outside CMD_NET and NET section in Kconfig.

---

 Kconfig     |  2 +-
 cmd/Kconfig | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
Kconfig +1 -1
index 66b059f749..ce2ad16ea5 100644
@@ -87,7 +87,7 @@ config DISTRO_DEFAULTS
 	select CMD_FS_GENERIC
 	select CMD_PART if PARTITIONS
 	select CMD_PING if CMD_NET
-	select CMD_PXE if NET
+	select CMD_PXE
 	select ENV_VARS_UBOOT_CONFIG
 	select HUSH_PARSER
 	select SUPPORT_RAW_INITRD
cmd/Kconfig +6 -6
index 07060c63a7..2cb0935632 100644
@@ -1499,12 +1499,6 @@ config CMD_ETHSW
 	  operations such as enabling / disabling a port and
 	  viewing/maintaining the filtering database (FDB)
 
-config CMD_PXE
-	bool "pxe"
-	select MENU
-	help
-	  Boot image via network using PXE protocol
-
 config CMD_WOL
 	bool "wol"
 	help
@@ -1636,6 +1630,12 @@ config CMD_MISC
 	help
 	  Delay execution for some time
 
+config CMD_PXE
+	bool "pxe"
+	select MENU
+	help
+	  Boot image via network using PXE protocol or via local extlinux.conf file
+
 config MP
 	bool "support for multiprocessor"
 	help
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 cmd: remove NET and CMD_NET dependency for CMD_PXE

Quoted 6 lines · Patrice Chotard

It allows to use sysboot command on board which have no NET support.

Currently, sysboot command can't be used if CMD_NET and NET flags are not set, while sysboot allows to load extlinux.conf file from local filesystem, so it doesn't need to depend of CMD_NET and NET flags.

Quoted 8 lines

One solution would be to put sysboot command's code outside pxe.c and create a new sysboot.c file. But sysboot command code is imbricated with pxe command code and as all CMD_NET relative code is already under CMD_NET flag, the easiest way to break sysboot dependency with CMD_NET and NET flags is to move CMD_PXE outside CMD_NET and NET section in Kconfig.

How far did you go down the path of making cmd/sysboot.c or similar? Since it's not obvious unless you're already in here that the extlinux.conf stuff is inside pxe, it really would be good to split things out. If you even have a rough draft patch to look at that would be great. Also:

Quoted 37 lines

---

 Kconfig     |  2 +-
 cmd/Kconfig | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
Kconfig +1 -1
index 66b059f749..ce2ad16ea5 100644
@@ -87,7 +87,7 @@ config DISTRO_DEFAULTS
 	select CMD_FS_GENERIC
 	select CMD_PART if PARTITIONS
 	select CMD_PING if CMD_NET
-	select CMD_PXE if NET
+	select CMD_PXE
 	select ENV_VARS_UBOOT_CONFIG
 	select HUSH_PARSER
 	select SUPPORT_RAW_INITRD
cmd/Kconfig +0 -6
index 07060c63a7..2cb0935632 100644
@@ -1499,12 +1499,6 @@ config CMD_ETHSW
 	  operations such as enabling / disabling a port and
 	  viewing/maintaining the filtering database (FDB)
 
-config CMD_PXE
-	bool "pxe"
-	select MENU
-	help
-	  Boot image via network using PXE protocol
-
 config CMD_WOL
 	bool "wol"
 	help

cmd/Kconfig config CMD_MISC · line 1638

Quoted 9 lines
cmd/Kconfig +6 -0
@@ -1636,6 +1630,12 @@ config CMD_MISC
 	help
 	  Delay execution for some time
 
+config CMD_PXE
+	bool "pxe"
+	select MENU
+	help
+	  Boot image via network using PXE protocol or via local extlinux.conf file
+

We should expand the prompt as well to note that sysboot is in here as well, if we cannot split. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191028/e388f5e1/attachment.sig>
#2 lore raw

PATCH 1/1 cmd: remove NET and CMD_NET dependency for CMD_PXE

Hi Tom

Quoted 15 lines · Tom Rini
Quoted 13 lines · Patrice Chotard

It allows to use sysboot command on board which have no NET support.

Currently, sysboot command can't be used if CMD_NET and NET flags are not set, while sysboot allows to load extlinux.conf file from local filesystem, so it doesn't need to depend of CMD_NET and NET flags.

One solution would be to put sysboot command's code outside pxe.c and create a new sysboot.c file. But sysboot command code is imbricated with pxe command code and as all CMD_NET relative code is already under CMD_NET flag, the easiest way to break sysboot dependency with CMD_NET and NET flags is to move CMD_PXE outside CMD_NET and NET section in Kconfig.

Quoted 5 lines
Quoted 1 line

How far did you go down the path of making cmd/sysboot.c or similar? Since it's not obvious unless you're already in here that the extlinux.conf stuff is inside pxe, it really would be good to split things out. If you even have a rough draft patch to look at that would

As explained, this implementation was the easiest way ... but ok i will split out

sysboot code from pxe one, and put common code into a new file.

Thanks

Patrice

Quoted 51 lines

be great. Also:

Quoted 37 lines

---

 Kconfig     |  2 +-
 cmd/Kconfig | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
Kconfig +1 -1
index 66b059f749..ce2ad16ea5 100644
@@ -87,7 +87,7 @@ config DISTRO_DEFAULTS
 	select CMD_FS_GENERIC
 	select CMD_PART if PARTITIONS
 	select CMD_PING if CMD_NET
-	select CMD_PXE if NET
+	select CMD_PXE
 	select ENV_VARS_UBOOT_CONFIG
 	select HUSH_PARSER
 	select SUPPORT_RAW_INITRD
cmd/Kconfig +0 -6
index 07060c63a7..2cb0935632 100644
@@ -1499,12 +1499,6 @@ config CMD_ETHSW
 	  operations such as enabling / disabling a port and
 	  viewing/maintaining the filtering database (FDB)
 
-config CMD_PXE
-	bool "pxe"
-	select MENU
-	help
-	  Boot image via network using PXE protocol
-
 config CMD_WOL
 	bool "wol"
 	help

cmd/Kconfig config CMD_MISC · line 1638

Quoted 9 lines
cmd/Kconfig +6 -0
@@ -1636,6 +1630,12 @@ config CMD_MISC
 	help
 	  Delay execution for some time
 
+config CMD_PXE
+	bool "pxe"
+	select MENU
+	help
+	  Boot image via network using PXE protocol or via local extlinux.conf file
+

We should expand the prompt as well to note that sysboot is in here as well, if we cannot split. Thanks!