[PATCH] common: improve CONFIG_DEFAULT_COMPRESSION_* documentation

Sascha Hauer sha at pengutronix.de
Tue Mar 28 01:00:56 PDT 2023


On Mon, Mar 27, 2023 at 08:06:52AM +0200, Ahmad Fatoum wrote:
> This option is only relevant to non-PBL configurations and the
> description is a bit confusing, because the default environment
> is the only in-barebox binary this option compressed.
> 
> Use "built-in environment" instead of "in-barebox binaries" or "default
> environment" to make this clearer.
> 

I wonder if we should make the whole thing invisible when there
is only one choice left, like below.

I don't know if there are some places which still need a
CONFIG_DEFAULT_COMPRESSION_NONE then. From a quick compilation of
imx_v7_defconfig it doesn't seem so, but I don't really know.

----------------------------------8<------------------------------

>From 2a463e109d06f62cd6c46339a19c45d5ec7bed96 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer at pengutronix.de>
Date: Tue, 28 Mar 2023 09:56:32 +0200
Subject: [PATCH] common: Make CONFIG_DEFAULT_COMPRESSION_* invisible when not
 needed

With PBL images DEFAULT_COMPRESSION_NONE is the only option left. Make
the whole choice invisible in that case.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/Kconfig | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index 57fe5f7886..644829c595 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -862,9 +862,10 @@ config DEFAULT_ENVIRONMENT
 	  the environment found in the environment sector is invalid or when
 	  CONFIG_ENV_HANDLING is not enabled.
 
+if !PBL_IMAGE
+
 choice
 	prompt "default compression for in-barebox binaries"
-	default DEFAULT_COMPRESSION_NONE if PBL_IMAGE
 	default DEFAULT_COMPRESSION_LZO if LZO_DECOMPRESS
 	default DEFAULT_COMPRESSION_XZ if XZ_DECOMPRESS
 	default DEFAULT_COMPRESSION_GZIP if ZLIB
@@ -878,29 +879,31 @@ choice
 
 config DEFAULT_COMPRESSION_GZIP
 	bool "gzip"
-	depends on !PBL_IMAGE && ZLIB
+	depends on ZLIB
 
 config DEFAULT_COMPRESSION_BZIP2
 	bool "bzip2"
-	depends on !PBL_IMAGE && BZLIB
+	depends on BZLIB
 
 config DEFAULT_COMPRESSION_LZO
 	bool "lzo"
-	depends on !PBL_IMAGE && LZO_DECOMPRESS
+	depends on LZO_DECOMPRESS
 
 config DEFAULT_COMPRESSION_LZ4
 	bool "lz4"
-	depends on !PBL_IMAGE && LZ4_DECOMPRESS
+	depends on LZ4_DECOMPRESS
 
 config DEFAULT_COMPRESSION_XZ
 	bool "xz"
-	depends on !PBL_IMAGE && XZ_DECOMPRESS
+	depends on XZ_DECOMPRESS
 
 config DEFAULT_COMPRESSION_NONE
 	bool "no compression"
 
 endchoice
 
+endif
+
 config DEFAULT_ENVIRONMENT_GENERIC_NEW
 	bool "Generic environment template"
 	depends on DEFAULT_ENVIRONMENT
-- 
2.39.2

-- 
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 |



More information about the barebox mailing list