diff mbox series

[3/3] Kconfig: use DISKFORMAT as flag

Message ID 20210810133534.497031-3-sbabic@denx.de
State Changes Requested
Headers show
Series [1/3] util: add strtobool() function | expand

Commit Message

Stefano Babic Aug. 10, 2021, 1:35 p.m. UTC
The following warnings are generated if DISKFORMAT_HANDLER is set
without setting DISKPART:

scripts/kconfig/conf  --silentoldconfig Kconfig
warning: (DISKFORMAT_HANDLER) selects DISKFORMAT which has unmet direct dependencies (DISKPART)
warning: (DISKFORMAT_HANDLER) selects DISKFORMAT which has unmet direct dependencies (DISKPART)

This is due to a dependency between the handlers, that is not necessary
because it is possible to link just one of them. Replace
CONFIG_DISKFORMAT with CONFIG_DISKPART_FORMAT in diskpüart handler, and
use CONFIG_DISKFORMAT as a flag to enable/disable the activation of the
filesystems creators.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 Kconfig                     | 4 ++++
 fs/Config.in                | 5 ++---
 handlers/Config.in          | 8 +++-----
 handlers/diskpart_handler.c | 2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index 93aee4e..dc86957 100644
--- a/Kconfig
+++ b/Kconfig
@@ -129,6 +129,10 @@  config CURL_SSL
 	bool
 	default n
 
+config DISKFORMAT
+	bool
+	default n
+
 config SYSTEMD
 	bool "enable systemd support"
 	depends on HAVE_LINUX
diff --git a/fs/Config.in b/fs/Config.in
index 682d952..dae855a 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -2,21 +2,20 @@ 
 #
 # SPDX-License-Identifier: GPL-2.0-only
 
+if DISKFORMAT
 config FAT_FILESYSTEM
 	bool "FAT file system creation support"
-	depends on DISKFORMAT
 	default n
 	help
 	  Enable support for creating FAT file systems.
 
 config EXT_FILESYSTEM
 	bool "EXT2 / EXT3 / EXT4 file system creation support"
-	depends on DISKFORMAT
 	depends on HAVE_LIBEXT2FS
 	default n
 	help
 	  Enable support for creating EXT file systems.
 
 comment "EXT2 / EXT3 / EXT4 file system creation support needs libext2fs"
-	depends on DISKFORMAT
 	depends on !HAVE_LIBEXT2FS
+endif
diff --git a/handlers/Config.in b/handlers/Config.in
index 36f3ca4..14f8af9 100644
--- a/handlers/Config.in
+++ b/handlers/Config.in
@@ -106,9 +106,11 @@  config DISKPART
 comment "diskpart support needs libfdisk"
 	depends on !HAVE_LIBFDISK
 
-config DISKFORMAT
+config DISKPART_FORMAT
 	bool "diskpart extension for creating file systems"
 	depends on DISKPART
+	select DISKFORMAT
+	default n
 	help
 	  This extension allows formatting newly created partitions.
 
@@ -120,12 +122,8 @@  config DISKFORMAT_HANDLER
 	  The diskformat handler allows creating filesystems on empty
 	  partitions.
 
-if DISKFORMAT
-
 source fs/Config.in
 
-endif
-
 config UNIQUEUUID
 	bool "uniqueuuid"
 	depends on HAVE_LIBBLKID
diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
index 99f19a5..a0034b0 100644
--- a/handlers/diskpart_handler.c
+++ b/handlers/diskpart_handler.c
@@ -925,7 +925,7 @@  handler_release:
 
 	sleep(2);
 
-#ifdef CONFIG_DISKFORMAT
+#ifdef CONFIG_DISKPART_FORMAT
 	/* Create filesystems */
 	if (!ret && createtable->parent) {
 		LIST_FOREACH(part, &priv.listparts, next) {