]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fs: separate CONFIG_FS_{FAT, EXT4} from CONFIG_CMD_{FAT, EXT*}
authorStephen Warren <swarren@nvidia.com>
Mon, 22 Oct 2012 06:43:50 +0000 (06:43 +0000)
committerTom Rini <trini@ti.com>
Mon, 29 Oct 2012 21:21:19 +0000 (14:21 -0700)
This makes the FAT and ext4 filesystem implementations build if
CONFIG_FS_{FAT,EXT4} are defined, rather than basing the build on
whether CONFIG_CMD_{FAT,EXT*} are defined. This will allow the
filesystems to be built separately from the filesystem-specific commands
that use them. This paves the way for the creation of filesystem-generic
commands that used the filesystems, without requiring the filesystem-
specific commands.

Minor documentation changes are made for this change.

The new config options are automatically selected by the old config
options to retain backwards-compatibility.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
README
doc/README.ext4
fs/ext4/Makefile
fs/ext4/ext4_common.c
fs/ext4/ext4_common.h
fs/ext4/ext4fs.c
fs/fat/Makefile
include/config_fallbacks.h
include/ext4fs.h

diff --git a/README b/README
index 4f16240ebddca9c08284442fa024ef2adea719e8..22fd6b761ef82090df1fc55f5eefb653c5620489 100644 (file)
--- a/README
+++ b/README
@@ -807,9 +807,11 @@ The following options need to be configured:
                CONFIG_CMD_EEPROM       * EEPROM read/write support
                CONFIG_CMD_ELF          * bootelf, bootvx
                CONFIG_CMD_EXPORTENV    * export the environment
+               CONFIG_CMD_EXT2         * ext2 command support
+               CONFIG_CMD_EXT4         * ext4 command support
                CONFIG_CMD_SAVEENV        saveenv
                CONFIG_CMD_FDC          * Floppy Disk Support
-               CONFIG_CMD_FAT          * FAT partition support
+               CONFIG_CMD_FAT          * FAT command support
                CONFIG_CMD_FDOS         * Dos diskette Support
                CONFIG_CMD_FLASH          flinfo, erase, protect
                CONFIG_CMD_FPGA           FPGA device initialization support
index b3ea8b776d4a5ddd19e7fd4d3b11a14e69d86150..b7d0ad3930d042c89b23e49ba1a933824f2632ce 100644 (file)
@@ -1,15 +1,28 @@
 This patch series adds support for ext4 ls,load and write features in uboot
 Journaling is supported for write feature.
 
+To enable support for the ext4 (and ext2) filesystem implementation,
+#define CONFIG_FS_EXT4
+
+If you want write support,
+#define CONFIG_EXT4_WRITE
+
 To Enable ext2 ls and load commands, modify the board specific config file with
 #define CONFIG_CMD_EXT2
+This automatically defines CONFIG_FS_EXT4 for you.
 
 To Enable ext4 ls and load commands, modify the board specific config file with
 #define CONFIG_CMD_EXT4
+This automatically defines CONFIG_FS_EXT4 for you.
 
 To enable ext4 write command, modify the board specific config file with
 #define CONFIG_CMD_EXT4
 #define CONFIG_CMD_EXT4_WRITE
+These automatically define CONFIG_FS_EXT4 and CONFIG_EXT4_WRITE for you.
+
+Also relevant are the generic filesystem commands,
+#define CONFIG_CMD_FS_GENERIC
+This does not automatically enable EXT4 support for you.
 
 Steps to test:
 
index 82cd9ae16a58daef3cff28413a3014e88f755558..bb801f905473d431d432225fa645ebf884209cd3 100644 (file)
@@ -30,11 +30,8 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)libext4fs.o
 
 AOBJS  =
-COBJS-$(CONFIG_CMD_EXT4) := ext4fs.o ext4_common.o dev.o
-ifndef CONFIG_CMD_EXT4
-COBJS-$(CONFIG_CMD_EXT2) := ext4fs.o ext4_common.o dev.o
-endif
-COBJS-$(CONFIG_CMD_EXT4_WRITE) += ext4_journal.o crc16.o
+COBJS-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
+COBJS-$(CONFIG_EXT4_WRITE) += ext4_journal.o crc16.o
 
 SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
index d6d55b9fff3707f1d9d8e47a4a4d12e89375f5f5..323875fa9452e9863b8fa21376b519c28f1729da 100644 (file)
@@ -56,7 +56,7 @@ int ext4fs_indir3_blkno = -1;
 struct ext2_inode *g_parent_inode;
 static int symlinknest;
 
-#if defined(CONFIG_CMD_EXT4_WRITE)
+#if defined(CONFIG_EXT4_WRITE)
 uint32_t ext4fs_div_roundup(uint32_t size, uint32_t n)
 {
        uint32_t res = size / n;
index f7281341869724e18e27c8e9804ae7e3b9387a24..87cab168ee72a4742779cbb696b8eb7f37c27de1 100644 (file)
@@ -37,7 +37,7 @@
 #include <ext4fs.h>
 #include <malloc.h>
 #include <asm/errno.h>
-#if defined(CONFIG_CMD_EXT4_WRITE)
+#if defined(CONFIG_EXT4_WRITE)
 #include "ext4_journal.h"
 #include "crc16.h"
 #endif
@@ -71,7 +71,7 @@ int ext4fs_find_file(const char *path, struct ext2fs_node *rootnode,
 int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
                        struct ext2fs_node **fnode, int *ftype);
 
-#if defined(CONFIG_CMD_EXT4_WRITE)
+#if defined(CONFIG_EXT4_WRITE)
 uint32_t ext4fs_div_roundup(uint32_t size, uint32_t n);
 int ext4fs_checksum_update(unsigned int i);
 int ext4fs_get_parent_inode_num(const char *dirname, char *dname, int flags);
index 3a5ef20a4b1a080a0ccaf9e16d620790a31c459c..06536baf625b375e5843e8af08fb4e6d354857aa 100644 (file)
@@ -196,7 +196,7 @@ int ext4fs_read(char *buf, unsigned len)
        return ext4fs_read_file(ext4fs_file, 0, len, buf);
 }
 
-#if defined(CONFIG_CMD_EXT4_WRITE)
+#if defined(CONFIG_EXT4_WRITE)
 static void ext4fs_update(void)
 {
        short i;
index 02e6881670fc0dc8adef38f2cacd7047c8dc56bb..969715bf9ca6e387e4e5164f8c04e1338d7fa288 100644 (file)
@@ -24,11 +24,11 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)libfat.o
 
 AOBJS  =
-COBJS-$(CONFIG_CMD_FAT)        := fat.o
+COBJS-$(CONFIG_FS_FAT) := fat.o
 COBJS-$(CONFIG_FAT_WRITE):= fat_write.o
 
 ifndef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_CMD_FAT)        += file.o
+COBJS-$(CONFIG_FS_FAT) += file.o
 endif
 
 SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
index 430890c3fba24d5df52be98ea5402a5e61fabe15..bfb9680d6837aca98a88f6ad57060c5e8dcff6b7 100644 (file)
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
 #endif
 
+#if defined(CONFIG_CMD_FAT) && !defined(CONFIG_FS_FAT)
+#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
+
 #endif /* __CONFIG_FALLBACKS_H */
index 23298fcd7d3611f91dc68b28523da26edb820614..3b59d15aab43633238f7e34f26041b14713f9ece 100644 (file)
@@ -116,7 +116,7 @@ struct ext_filesystem {
 extern struct ext2_data *ext4fs_root;
 extern struct ext2fs_node *ext4fs_file;
 
-#if defined(CONFIG_CMD_EXT4_WRITE)
+#if defined(CONFIG_EXT4_WRITE)
 extern struct ext2_inode *g_parent_inode;
 extern int gd_index;
 extern int gindex;