[U-Boot] [PATCH 1/5] fs: Migrate ext4 to Kconfig
Tuomas Tynkkynen
tuomas at tuxera.com
Fri Jan 5 00:45:17 UTC 2018
Migrate the following symbols to Kconfig:
CONFIG_FS_EXT4
CONFIG_EXT4_WRITE
The definitions in config_fallbacks.h can now be expressed in Kconfig.
Signed-off-by: Tuomas Tynkkynen <tuomas at tuxera.com>
---
cmd/Kconfig | 3 +++
configs/ds109_defconfig | 1 +
configs/mx25pdk_defconfig | 1 +
doc/README.ext4 | 22 +++++++++++-----------
fs/ext4/Kconfig | 13 +++++++++++++
include/config_fallbacks.h | 9 ---------
include/configs/am335x_shc.h | 2 --
include/configs/brppt1.h | 8 --------
include/configs/hikey.h | 2 --
include/configs/mx25pdk.h | 5 -----
include/configs/pic32mzdask.h | 3 ---
include/configs/rcar-gen2-common.h | 2 --
include/configs/rcar-gen3-common.h | 2 --
include/configs/rk3128_common.h | 1 -
include/configs/rk3328_common.h | 1 -
include/configs/rk3399_common.h | 1 -
include/configs/s5p_goni.h | 5 -----
include/configs/sandbox.h | 2 --
include/configs/tegra-common-post.h | 5 -----
scripts/config_whitelist.txt | 2 --
20 files changed, 29 insertions(+), 61 deletions(-)
diff --git cmd/Kconfig cmd/Kconfig
index c033223526..797f4bf597 100644
--- cmd/Kconfig
+++ cmd/Kconfig
@@ -1357,17 +1357,20 @@ config CMD_CRAMFS
config CMD_EXT2
bool "ext2 command support"
+ select FS_EXT4
help
Enables EXT2 FS command
config CMD_EXT4
bool "ext4 command support"
+ select FS_EXT4
help
Enables EXT4 FS command
config CMD_EXT4_WRITE
depends on CMD_EXT4
bool "ext4 write command support"
+ select EXT4_WRITE
help
Enables EXT4 FS write command
diff --git configs/ds109_defconfig configs/ds109_defconfig
index 6d513cf584..428ac8ce64 100644
--- configs/ds109_defconfig
+++ configs/ds109_defconfig
@@ -22,3 +22,4 @@ CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_FS_EXT4=y
diff --git configs/mx25pdk_defconfig configs/mx25pdk_defconfig
index 2905614c28..563c7acd60 100644
--- configs/mx25pdk_defconfig
+++ configs/mx25pdk_defconfig
@@ -17,5 +17,6 @@ CONFIG_CMD_DATE=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_DOS_PARTITION=y
CONFIG_ENV_IS_IN_MMC=y
+CONFIG_FS_EXT4=y
CONFIG_FS_FAT=y
CONFIG_OF_LIBFDT=y
diff --git doc/README.ext4 doc/README.ext4
index 2b0eab5dde..8ecd21eee3 100644
--- doc/README.ext4
+++ doc/README.ext4
@@ -2,10 +2,10 @@ U-Boot supports access of both ext2 and ext4 filesystems, either in read-only
mode or in read-write mode.
First, to enable support for both ext4 (and, automatically, ext2 as well),
-but without selecting the corresponding commands, use one of:
+but without selecting the corresponding commands, enable one of the following:
- #define CONFIG_FS_EXT4 (for read-only)
- #define CONFIG_EXT4_WRITE (for read-write)
+ CONFIG_FS_EXT4 (for read-only)
+ CONFIG_EXT4_WRITE (for read-write)
Next, to select the ext2-related commands:
@@ -20,22 +20,22 @@ or ext4-related commands:
use one or both of:
- #define CONFIG_CMD_EXT2
- #define CONFIG_CMD_EXT4
+ CONFIG_CMD_EXT2
+ CONFIG_CMD_EXT4
-Selecting either of the above automatically defines CONFIG_FS_EXT4 if it
-wasn't defined already.
+Selecting either of the above automatically selects CONFIG_FS_EXT4 if it
+wasn't enabled already.
-In addition, to get the write access command "ext4write", use:
+In addition, to get the write access command "ext4write", enable:
- #define CONFIG_CMD_EXT4_WRITE
+ CONFIG_CMD_EXT4_WRITE
-which automatically defines CONFIG_EXT4_WRITE if it wasn't defined
+which automatically selects CONFIG_EXT4_WRITE if it wasn't defined
already.
Also relevant are the generic filesystem commands, selected by:
- #define CONFIG_CMD_FS_GENERIC
+ CONFIG_CMD_FS_GENERIC
This does not automatically enable EXT4 support for you, you still need
to do that yourself.
diff --git fs/ext4/Kconfig fs/ext4/Kconfig
index e69de29bb2..1a913d2b6d 100644
--- fs/ext4/Kconfig
+++ fs/ext4/Kconfig
@@ -0,0 +1,13 @@
+config FS_EXT4
+ bool "Enable ext4 filesystem support"
+ help
+ This provides support for reading images from the ext4 filesystem.
+ ext4 is a widely used general-purpose filesystem for Linux.
+ You can also enable CMD_EXT4 to get access to ext4 commands.
+
+config EXT4_WRITE
+ bool "Enable ext4 filesystem write support"
+ depends on FS_EXT4
+ help
+ This provides support for creating and writing new files to an
+ existing ext4 filesystem partition.
diff --git include/config_fallbacks.h include/config_fallbacks.h
index 2c4d43d672..527dfc71fa 100644
--- include/config_fallbacks.h
+++ include/config_fallbacks.h
@@ -33,15 +33,6 @@
#define CONFIG_FS_FAT
#endif
-#if (defined(CONFIG_CMD_EXT4) || defined(CONFIG_CMD_EXT2)) && \
- !defined(CONFIG_FS_EXT4)
-#define CONFIG_FS_EXT4
-#endif
-
-#if defined(CONFIG_CMD_EXT4_WRITE) && !defined(CONFIG_EXT4_WRITE)
-#define CONFIG_EXT4_WRITE
-#endif
-
/* Rather than repeat this expression each time, add a define for it */
#if defined(CONFIG_IDE) || \
defined(CONFIG_SATA) || \
diff --git include/configs/am335x_shc.h include/configs/am335x_shc.h
index 32439f5c47..e2d329acab 100644
--- include/configs/am335x_shc.h
+++ include/configs/am335x_shc.h
@@ -17,8 +17,6 @@
/* settings we don;t want on this board */
#undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
-#undef CONFIG_CMD_EXT4
-#undef CONFIG_CMD_EXT4_WRITE
#undef CONFIG_CMD_SPI
#define CONFIG_CMD_CACHE
diff --git include/configs/brppt1.h include/configs/brppt1.h
index 2dadcaecf5..ad83753647 100644
--- include/configs/brppt1.h
+++ include/configs/brppt1.h
@@ -245,13 +245,5 @@ MMCARGS
#else
#error "no storage for Environment defined!"
#endif
-/*
- * Common filesystems support. When we have removable storage we
- * enabled a number of useful commands and support.
- */
-#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
-#define CONFIG_FS_EXT4
-#define CONFIG_EXT4_WRITE
-#endif /* CONFIG_MMC, ... */
#endif /* ! __CONFIG_BRPPT1_H__ */
diff --git include/configs/hikey.h include/configs/hikey.h
index 7eaa6e4667..130c7694bf 100644
--- include/configs/hikey.h
+++ include/configs/hikey.h
@@ -66,8 +66,6 @@
/* SD/MMC configuration */
#define CONFIG_BOUNCE_BUFFER
-#define CONFIG_FS_EXT4
-
/* Command line configuration */
#define CONFIG_MTD_PARTITIONS
diff --git include/configs/mx25pdk.h include/configs/mx25pdk.h
index 8e8946a6b4..f82c4ccbde 100644
--- include/configs/mx25pdk.h
+++ include/configs/mx25pdk.h
@@ -65,11 +65,6 @@
#define CONFIG_CMDLINE_EDITING
#define CONFIG_SYS_LONGHELP
-/* U-Boot commands */
-
-/* Filesystem support */
-#define CONFIG_FS_EXT4
-
/* Ethernet */
#define CONFIG_FEC_MXC
#define CONFIG_FEC_MXC_PHYADDR 0x1f
diff --git include/configs/pic32mzdask.h include/configs/pic32mzdask.h
index 97636fee38..cf31a38c86 100644
--- include/configs/pic32mzdask.h
+++ include/configs/pic32mzdask.h
@@ -88,9 +88,6 @@
/* FAT FS */
#define CONFIG_SUPPORT_VFAT
-/* EXT4 FS */
-#define CONFIG_FS_EXT4
-
/* -------------------------------------------------
* Environment
*/
diff --git include/configs/rcar-gen2-common.h include/configs/rcar-gen2-common.h
index 2c10e6152d..19c4c4c72b 100644
--- include/configs/rcar-gen2-common.h
+++ include/configs/rcar-gen2-common.h
@@ -13,8 +13,6 @@
/* Support File sytems */
#define CONFIG_SUPPORT_VFAT
-#define CONFIG_FS_EXT4
-#define CONFIG_EXT4_WRITE
#define CONFIG_CMDLINE_TAG
#define CONFIG_SETUP_MEMORY_TAGS
diff --git include/configs/rcar-gen3-common.h include/configs/rcar-gen3-common.h
index 30a98b8ada..7e23b5e054 100644
--- include/configs/rcar-gen3-common.h
+++ include/configs/rcar-gen3-common.h
@@ -19,8 +19,6 @@
/* Support File sytems */
#define CONFIG_SUPPORT_VFAT
-#define CONFIG_FS_EXT4
-#define CONFIG_EXT4_WRITE
#define CONFIG_CMDLINE_TAG
#define CONFIG_SETUP_MEMORY_TAGS
diff --git include/configs/rk3128_common.h include/configs/rk3128_common.h
index e915a562b9..b83528edd1 100644
--- include/configs/rk3128_common.h
+++ include/configs/rk3128_common.h
@@ -31,7 +31,6 @@
#define CONFIG_BOUNCE_BUFFER
#define CONFIG_SUPPORT_VFAT
-#define CONFIG_FS_EXT4
/* RAW SD card / eMMC locations. */
#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)
diff --git include/configs/rk3328_common.h include/configs/rk3328_common.h
index af556323f8..8c1a0e9260 100644
--- include/configs/rk3328_common.h
+++ include/configs/rk3328_common.h
@@ -25,7 +25,6 @@
#define CONFIG_BOUNCE_BUFFER
#define CONFIG_SUPPORT_VFAT
-#define CONFIG_FS_EXT4
/* RAW SD card / eMMC locations. */
#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)
diff --git include/configs/rk3399_common.h include/configs/rk3399_common.h
index 561bfa73b6..21395bab8a 100644
--- include/configs/rk3399_common.h
+++ include/configs/rk3399_common.h
@@ -39,7 +39,6 @@
#define CONFIG_ROCKCHIP_SDHCI_MAX_FREQ 200000000
#define CONFIG_SUPPORT_VFAT
-#define CONFIG_FS_EXT4
/* RAW SD card / eMMC locations. */
#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)
diff --git include/configs/s5p_goni.h include/configs/s5p_goni.h
index 86835e735e..fef4d55351 100644
--- include/configs/s5p_goni.h
+++ include/configs/s5p_goni.h
@@ -188,11 +188,6 @@
#define CONFIG_SAMSUNG_ONENAND 1
#define CONFIG_SYS_ONENAND_BASE 0xB0000000
-/* write support for filesystems */
-#define CONFIG_EXT4_WRITE
-
-/* GPT */
-
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_USB_GADGET_DWC2_OTG_PHY
diff --git include/configs/sandbox.h include/configs/sandbox.h
index f0426567fd..cfb3e7affd 100644
--- include/configs/sandbox.h
+++ include/configs/sandbox.h
@@ -25,8 +25,6 @@
#define CONFIG_LMB
-#define CONFIG_FS_EXT4
-#define CONFIG_EXT4_WRITE
#define CONFIG_HOST_MAX_DEVICES 4
/*
diff --git include/configs/tegra-common-post.h include/configs/tegra-common-post.h
index 743be6bb56..aea8f1fb8e 100644
--- include/configs/tegra-common-post.h
+++ include/configs/tegra-common-post.h
@@ -113,11 +113,6 @@
#ifdef CONFIG_CMD_I2C
#endif
-/* remove partitions/filesystems */
-#ifdef CONFIG_FS_EXT4
-#undef CONFIG_FS_EXT4
-#endif
-
/* remove USB */
#ifdef CONFIG_USB_EHCI_TEGRA
#undef CONFIG_USB_EHCI_TEGRA
diff --git scripts/config_whitelist.txt scripts/config_whitelist.txt
index 43a4ff0892..0433399a88 100644
--- scripts/config_whitelist.txt
+++ scripts/config_whitelist.txt
@@ -610,7 +610,6 @@ CONFIG_ETHER_ON_FCC3
CONFIG_ETHPRIME
CONFIG_ETH_BUFSIZE
CONFIG_ETH_RXSIZE
-CONFIG_EXT4_WRITE
CONFIG_EXTRA_BOOTARGS
CONFIG_EXTRA_CLOCK
CONFIG_EXTRA_ENV
@@ -760,7 +759,6 @@ CONFIG_FSL_VIA
CONFIG_FSMC_NAND_BASE
CONFIG_FSMTDBLK
CONFIG_FSNOTIFY
-CONFIG_FS_EXT4
CONFIG_FS_POSIX_ACL
CONFIG_FTAHBC020S
CONFIG_FTAHBC020S_BASE
--
2.15.0
More information about the U-Boot
mailing list