mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: add option for shipping KCONFIG_CONFIG as /env/data/config
@ 2021-04-10 10:45 Ahmad Fatoum
  2021-04-11 20:39 ` [PATCH] fixup! " Ahmad Fatoum
  2021-04-13  6:09 ` [PATCH] " Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2021-04-10 10:45 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Add a new option that enables access to the barebox configuration
file through /env/data/config. This can be useful in environments
where a fatter barebox can be tolerated (like on an EFI system
partition). It could also be used to conditionally skip tests
on disabled functionality in the future.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 Makefile                | 2 ++
 common/Kconfig          | 7 +++++++
 defaultenv/Makefile     | 7 +++++++
 defaultenv/defaultenv.c | 2 ++
 scripts/Makefile.lib    | 3 +++
 5 files changed, 21 insertions(+)

diff --git a/Makefile b/Makefile
index a36608819da5..c13f3274c18c 100644
--- a/Makefile
+++ b/Makefile
@@ -358,6 +358,8 @@ endif
 
 KCONFIG_CONFIG	?= .config
 
+export KCONFIG_CONFIG
+
 # Default file for 'make defconfig'. This may be overridden by arch-Makefile.
 export KBUILD_DEFCONFIG := defconfig
 
diff --git a/common/Kconfig b/common/Kconfig
index 342817bbcbb4..2872c80dbf13 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -941,6 +941,13 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
 	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
 	depends on REBOOT_MODE
 
+config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
+	bool "Ship .config as /env/data/config"
+	help
+	  This option embeds the used barebox Kconfig .config file into the
+	  environment as /env/data/config. This will increases barebox image
+	  size. If unsure, say n here.
+
 config DEFAULT_ENVIRONMENT_PATH
 	string
 	depends on DEFAULT_ENVIRONMENT
diff --git a/defaultenv/Makefile b/defaultenv/Makefile
index 91293567c0d3..68790321187d 100644
--- a/defaultenv/Makefile
+++ b/defaultenv/Makefile
@@ -32,3 +32,10 @@ cmd_env_zero = ($(objtree)/scripts/bareboxenv -z $(CONFIG_DEFAULT_ENVIRONMENT_PA
 
 $(obj)/barebox_zero_env: FORCE
 	$(call if_changed,env_zero)
+
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG) += defaultenv-2-ikconfig
+
+defaultenv/defaultenv-2-ikconfig.bbenv$(DEFAULT_COMPRESSION_SUFFIX): $(KCONFIG_CONFIG)
+	@mkdir -p defaultenv/defaultenv-2-ikconfig/data
+	@cp $(KCONFIG_CONFIG) defaultenv/defaultenv-2-ikconfig/data/config
+	$(call cmd,envgen,defaultenv/defaultenv-2-ikconfig)
diff --git a/defaultenv/defaultenv.c b/defaultenv/defaultenv.c
index d69446c8937a..055475eb4756 100644
--- a/defaultenv/defaultenv.c
+++ b/defaultenv/defaultenv.c
@@ -47,6 +47,8 @@ static void defaultenv_add_base(void)
 		defaultenv_append_directory(defaultenv_2_dfu);
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE))
 		defaultenv_append_directory(defaultenv_2_reboot_mode);
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG))
+		defaultenv_append_directory(defaultenv_2_ikconfig);
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
 		defaultenv_append_directory(defaultenv_1);
 }
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 319ac19975ed..80d76b177c0a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -365,6 +365,9 @@ cmd_env_S =							\
 $(obj)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).S: $(src)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX) FORCE
 	$(call if_changed,env_S)
 
+quiet_cmd_envgen = ENVGEN  $@
+cmd_envgen=$(srctree)/scripts/genenv $(objtree) $(objtree) $@ $2
+
 quiet_cmd_env = ENV     $@
 cmd_env=$(srctree)/scripts/genenv $(srctree) $(objtree) $@ $<
 
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] fixup! common: add option for shipping KCONFIG_CONFIG as /env/data/config
  2021-04-10 10:45 [PATCH] common: add option for shipping KCONFIG_CONFIG as /env/data/config Ahmad Fatoum
@ 2021-04-11 20:39 ` Ahmad Fatoum
  2021-04-12  7:45   ` Roland Hieber
  2021-04-13  6:09 ` [PATCH] " Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2021-04-11 20:39 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Doesn't make sense to have this without DEFAULT_ENVIRONMENT_GENERIC_NEW
support. Similar options depend on this as well.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 common/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/Kconfig b/common/Kconfig
index 2872c80dbf13..bddf802d3bb4 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -943,6 +943,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
 
 config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
 	bool "Ship .config as /env/data/config"
+	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
 	help
 	  This option embeds the used barebox Kconfig .config file into the
 	  environment as /env/data/config. This will increases barebox image
-- 
2.31.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fixup! common: add option for shipping KCONFIG_CONFIG as /env/data/config
  2021-04-11 20:39 ` [PATCH] fixup! " Ahmad Fatoum
@ 2021-04-12  7:45   ` Roland Hieber
  2021-04-12  7:54     ` Ahmad Fatoum
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Hieber @ 2021-04-12  7:45 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Sun, Apr 11, 2021 at 10:39:47PM +0200, Ahmad Fatoum wrote:
> Doesn't make sense to have this without DEFAULT_ENVIRONMENT_GENERIC_NEW
> support. Similar options depend on this as well.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>

Thanks, this is useful!

For both:
Tested-by: Roland Hieber <rhi@pengutronix.de>

> ---
>  common/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 2872c80dbf13..bddf802d3bb4 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -943,6 +943,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
>  
>  config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
>  	bool "Ship .config as /env/data/config"
> +	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
>  	help
>  	  This option embeds the used barebox Kconfig .config file into the
>  	  environment as /env/data/config. This will increases barebox image
> -- 
> 2.31.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fixup! common: add option for shipping KCONFIG_CONFIG as /env/data/config
  2021-04-12  7:45   ` Roland Hieber
@ 2021-04-12  7:54     ` Ahmad Fatoum
  0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2021-04-12  7:54 UTC (permalink / raw)
  To: Roland Hieber, Ahmad Fatoum; +Cc: barebox

Hi,

On 12.04.21 09:45, Roland Hieber wrote:
> On Sun, Apr 11, 2021 at 10:39:47PM +0200, Ahmad Fatoum wrote:
>> Doesn't make sense to have this without DEFAULT_ENVIRONMENT_GENERIC_NEW
>> support. Similar options depend on this as well.
>>
>> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> 
> Thanks, this is useful!
> 
> For both:
> Tested-by: Roland Hieber <rhi@pengutronix.de>

Thanks for testing. If you like it, you can check
https://lore.pengutronix.de/barebox/20210412071651.8769-13-a.fatoum@pengutronix.de/T/#u
to see it in action.

It's used to conditionally skip tests if a config option isn't available
(with a fallback to the build-time .config).

Cheers,
Ahmad

> 
>> ---
>>  common/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/common/Kconfig b/common/Kconfig
>> index 2872c80dbf13..bddf802d3bb4 100644
>> --- a/common/Kconfig
>> +++ b/common/Kconfig
>> @@ -943,6 +943,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
>>  
>>  config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
>>  	bool "Ship .config as /env/data/config"
>> +	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
>>  	help
>>  	  This option embeds the used barebox Kconfig .config file into the
>>  	  environment as /env/data/config. This will increases barebox image
>> -- 
>> 2.31.0
>>
>>
>> _______________________________________________
>> barebox mailing list
>> barebox@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] common: add option for shipping KCONFIG_CONFIG as /env/data/config
  2021-04-10 10:45 [PATCH] common: add option for shipping KCONFIG_CONFIG as /env/data/config Ahmad Fatoum
  2021-04-11 20:39 ` [PATCH] fixup! " Ahmad Fatoum
@ 2021-04-13  6:09 ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2021-04-13  6:09 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Sat, Apr 10, 2021 at 12:45:05PM +0200, Ahmad Fatoum wrote:
> Add a new option that enables access to the barebox configuration
> file through /env/data/config. This can be useful in environments
> where a fatter barebox can be tolerated (like on an EFI system
> partition). It could also be used to conditionally skip tests
> on disabled functionality in the future.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
>  Makefile                | 2 ++
>  common/Kconfig          | 7 +++++++
>  defaultenv/Makefile     | 7 +++++++
>  defaultenv/defaultenv.c | 2 ++
>  scripts/Makefile.lib    | 3 +++
>  5 files changed, 21 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/Makefile b/Makefile
> index a36608819da5..c13f3274c18c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -358,6 +358,8 @@ endif
>  
>  KCONFIG_CONFIG	?= .config
>  
> +export KCONFIG_CONFIG
> +
>  # Default file for 'make defconfig'. This may be overridden by arch-Makefile.
>  export KBUILD_DEFCONFIG := defconfig
>  
> diff --git a/common/Kconfig b/common/Kconfig
> index 342817bbcbb4..2872c80dbf13 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -941,6 +941,13 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
>  	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
>  	depends on REBOOT_MODE
>  
> +config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
> +	bool "Ship .config as /env/data/config"
> +	help
> +	  This option embeds the used barebox Kconfig .config file into the
> +	  environment as /env/data/config. This will increases barebox image
> +	  size. If unsure, say n here.
> +
>  config DEFAULT_ENVIRONMENT_PATH
>  	string
>  	depends on DEFAULT_ENVIRONMENT
> diff --git a/defaultenv/Makefile b/defaultenv/Makefile
> index 91293567c0d3..68790321187d 100644
> --- a/defaultenv/Makefile
> +++ b/defaultenv/Makefile
> @@ -32,3 +32,10 @@ cmd_env_zero = ($(objtree)/scripts/bareboxenv -z $(CONFIG_DEFAULT_ENVIRONMENT_PA
>  
>  $(obj)/barebox_zero_env: FORCE
>  	$(call if_changed,env_zero)
> +
> +bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG) += defaultenv-2-ikconfig
> +
> +defaultenv/defaultenv-2-ikconfig.bbenv$(DEFAULT_COMPRESSION_SUFFIX): $(KCONFIG_CONFIG)
> +	@mkdir -p defaultenv/defaultenv-2-ikconfig/data
> +	@cp $(KCONFIG_CONFIG) defaultenv/defaultenv-2-ikconfig/data/config
> +	$(call cmd,envgen,defaultenv/defaultenv-2-ikconfig)
> diff --git a/defaultenv/defaultenv.c b/defaultenv/defaultenv.c
> index d69446c8937a..055475eb4756 100644
> --- a/defaultenv/defaultenv.c
> +++ b/defaultenv/defaultenv.c
> @@ -47,6 +47,8 @@ static void defaultenv_add_base(void)
>  		defaultenv_append_directory(defaultenv_2_dfu);
>  	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE))
>  		defaultenv_append_directory(defaultenv_2_reboot_mode);
> +	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG))
> +		defaultenv_append_directory(defaultenv_2_ikconfig);
>  	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
>  		defaultenv_append_directory(defaultenv_1);
>  }
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 319ac19975ed..80d76b177c0a 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -365,6 +365,9 @@ cmd_env_S =							\
>  $(obj)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).S: $(src)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX) FORCE
>  	$(call if_changed,env_S)
>  
> +quiet_cmd_envgen = ENVGEN  $@
> +cmd_envgen=$(srctree)/scripts/genenv $(objtree) $(objtree) $@ $2
> +
>  quiet_cmd_env = ENV     $@
>  cmd_env=$(srctree)/scripts/genenv $(srctree) $(objtree) $@ $<
>  
> -- 
> 2.30.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-13  6:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10 10:45 [PATCH] common: add option for shipping KCONFIG_CONFIG as /env/data/config Ahmad Fatoum
2021-04-11 20:39 ` [PATCH] fixup! " Ahmad Fatoum
2021-04-12  7:45   ` Roland Hieber
2021-04-12  7:54     ` Ahmad Fatoum
2021-04-13  6:09 ` [PATCH] " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox