fs/ext2: add ability to build ext3/4 too

Use the host-e2fsprogs to tune2fs the generated rootfs.ext2 image,
and upgrade it to either one of ext2, ext3 or ext4.

Since calling tune2fs may require running e2fsck (tune2fs will warn
to do so when certain FS options are changed), we systematically call
e2fsck. This makes the code path simpler, and as a side-effect checks
that genext2fs did not generate garbage.

In turn, e2fsck will unconditionally add a UUID to the filesystem,
which is bad for reproducibility, so we call tune2fs again to remove
the UUID. This does not require checking the filesystem.

To ensure compatibility of Buildroot's .config, leave ext2 as the
default. Boards' .config can override this at will.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Yann E. MORIN
2013-04-11 12:17:51 +00:00
committed by Peter Korsgaard
parent 5fbef61480
commit 69036c20f1
4 changed files with 106 additions and 11 deletions

View File

@@ -18,10 +18,12 @@ ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
endif
ROOTFS_EXT2_DEPENDENCIES = host-genext2fs
ROOTFS_EXT2_DEPENDENCIES = host-genext2fs host-e2fsprogs
EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
define ROOTFS_EXT2_CMD
PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
endef
$(eval $(call ROOTFS_TARGET,ext2))