Skip to contentSkip to conversation

Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

PATCH New Lukasz Majewski 2 participants 10 messages Sep 10, 2017 – Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

---
 cmd/Kconfig | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
cmd/Kconfig +15 -0
index d6d130e..e5c12a9 100644
@@ -30,6 +30,21 @@ config SYS_PROMPT
 	  This string is displayed in the command line to the left of the
 	  cursor.
 
+config BOOTCMD_OVERRIDE
+	bool "Override default CONFIG_BOOTCOMMAND define"
+	help
+	  This option allows overriding the CONFIG_BOOTCOMMAND define
+	  from the Kconfig as many boards define their default set of
+	  commands with CONFIG_BOOTCOMMAND.
+
+config BOOTCOMMAND
+	string "Default boot commands"
+	depends on BOOTCMD_OVERRIDE
+	default ""
+	help
+	  This string contains the set of u-boot commands to be executed
+	  by default.
+
 menu "Autoboot options"
 
 config AUTOBOOT
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 8 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

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

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 6 lines · Tom Rini
Quoted 4 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 8 lines
Quoted 4 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

What do you mean by "some other logic"?

Signature · 9 lines
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
#3 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 19 lines · Łukasz Majewski
Quoted 6 lines · Tom Rini
Quoted 4 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 8 lines
Quoted 4 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 15 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

Quoted 5 lines

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170914/f9dd24b5/attachment.sig>
#4 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 48 lines · Tom Rini
Quoted 19 lines · Łukasz Majewski
Quoted 6 lines · Tom Rini
Quoted 4 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 8 lines
Quoted 4 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 19 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

Quoted 6 lines
Quoted 1 line

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

How would you see the rework done?

Signature · 9 lines
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
#5 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 51 lines · Łukasz Majewski
Quoted 50 lines · Tom Rini
Quoted 19 lines · Łukasz Majewski
Quoted 6 lines · Tom Rini
Quoted 4 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 8 lines
Quoted 4 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 20 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

What do you mean by "some other logic"?

Quoted 8 lines
Quoted 3 lines

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

How would you see the rework done?

I'd like to see something that tries to move CONFIG_BOOTCOMMAND around. Move the distro boot things into include/environment/ and use the post-processed command as value in configs/*_defconfig as fits, or put things into something else in include/environment/ for other repeated but not distro boot commands.

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

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 59 lines · Tom Rini
Quoted 58 lines · Łukasz Majewski
Quoted 48 lines · Tom Rini
Quoted 19 lines · Łukasz Majewski
Quoted 6 lines · Tom Rini
Quoted 4 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 8 lines
Quoted 4 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 19 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

Quoted 5 lines
Quoted 1 line

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

Quoted 8 lines
Quoted 1 line

How would you see the rework done?

I'd like to see something that tries to move CONFIG_BOOTCOMMAND around. Move the distro boot things into include/environment/ and use the post-processed command as value in configs/*_defconfig as fits, or put things into something else in include/environment/ for other repeated but not distro boot commands.

The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND settings.
This functionality allows the same code base for two distinct u-boot builds - namely factory (for flashing) and production one.

Such approach is very convenient with OE builds.

Signature · 9 lines
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
#7 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

In reply to Tom Rini

Hi Tom,

Quoted 61 lines · Łukasz Majewski
Quoted 60 lines · Tom Rini
Quoted 50 lines · Łukasz Majewski
Quoted 20 lines · Tom Rini
Quoted 6 lines · Lukasz Majewski
Quoted 5 lines

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 9 lines
Quoted 5 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 20 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

Quoted 5 lines
Quoted 1 line

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

Quoted 8 lines
Quoted 1 line

How would you see the rework done?

I'd like to see something that tries to move CONFIG_BOOTCOMMAND around. Move the distro boot things into include/environment/ and use the post-processed command as value in configs/*_defconfig as fits, or put things into something else in include/environment/ for other repeated but not distro boot commands.

I've not received any reply from you regarding following argument for this patch:

The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND settings.
This functionality allows the same code base for two distinct u-boot builds - namely factory (for flashing) and production one.

Such approach is very convenient with OE builds.

The whole discussion can be find at:
https://patchwork.ozlabs.org/patch/812174/

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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 -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171027/7332d9ad/attachment.sig>

#8 lore raw

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Quoted 75 lines · Lukasz Majewski

Hi Tom,

Quoted 61 lines · Łukasz Majewski
Quoted 60 lines · Tom Rini
Quoted 50 lines · Łukasz Majewski
Quoted 20 lines · Tom Rini
Quoted 6 lines · Lukasz Majewski
Quoted 5 lines

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Quoted 9 lines
Quoted 5 lines

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 20 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

Quoted 5 lines
Quoted 1 line

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

Quoted 8 lines
Quoted 1 line

How would you see the rework done?

I'd like to see something that tries to move CONFIG_BOOTCOMMAND around. Move the distro boot things into include/environment/ and use the post-processed command as value in configs/*_defconfig as fits, or put things into something else in include/environment/ for other repeated but not distro boot commands.

I've not received any reply from you regarding following argument for this patch:

Quoted 8 lines

The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND settings.
This functionality allows the same code base for two distinct u-boot builds - namely factory (for flashing) and production one.

Such approach is very convenient with OE builds.

The problem I see is that we should instead move CONFIG_BOOTCOMMAND to Kconfig and OE/similar can override bootcmd via .cfg or similar. To that end, I've started the migration at least for distro_bootcmd and some of the cases where it's not just 'run distro_bootcmd' being used. I hope to post it shortly, once I've migrated a few more options.

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

PATCH 1/1 Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

Hi Tom,

Quoted 86 lines · Lukasz Majewski
Quoted 85 lines

Hi Tom,

Quoted 64 lines · Łukasz Majewski
Quoted 63 lines · Tom Rini
Quoted 53 lines
Quoted 22 lines · Łukasz Majewski
Quoted 11 lines · Tom Rini
Quoted 8 lines · Lukasz Majewski

This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND (at <board_config.h> files) with set of commands defined in board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for production and one (far more larger) for factory setup.

Quoted 6 lines
Quoted 1 line

I don't get it, sorry. We need to move CONFIG_BOOTCOMMAND into Kconfig with some other logic so that distro_bootcmd stuff works.

The state of the art:
---------------------

Quoted 6 lines

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Right.

Quoted 20 lines

Rationale:
----------

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. <my_board>_factory_defconfig, which enables some extra stuff (like USB, gadget, gpt write, etc) and is used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I can use the same code base and just adjust Kconfig for board.

Quoted 5 lines
Quoted 1 line

What do you mean by "some other logic"?

Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself. Figuring out some of the "how" will take a little work. And a little re-organization. But that needs doing.

Cannot we start with the approach proposed by this commit?

Quoted 8 lines
Quoted 1 line

How would you see the rework done?

I'd like to see something that tries to move CONFIG_BOOTCOMMAND around. Move the distro boot things into include/environment/ and use the post-processed command as value in configs/*_defconfig as fits, or put things into something else in include/environment/ for other repeated but not distro boot commands.

I've not received any reply from you regarding following argument for this patch:

The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND settings.
This functionality allows the same code base for two distinct u-boot builds - namely factory (for flashing) and production one.

Quoted 7 lines
Quoted 1 line

Such approach is very convenient with OE builds.

The problem I see is that we should instead move CONFIG_BOOTCOMMAND to Kconfig and OE/similar can override bootcmd via .cfg or similar. To that end, I've started the migration at least for distro_bootcmd and some of the cases where it's not just 'run distro_bootcmd' being used. I hope to post it shortly, once I've migrated a few more options.

I see. Thanks for update on this topic.

Quoted 1 line

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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 -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171106/0a3177c6/attachment.sig>