From: Sébastien Szymanski Date: Tue, 4 Jul 2017 14:47:26 +0000 (+0200) Subject: fs/ext2: use mkfs to generate rootfs image X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67aaa90d3bbe6ad5b5ffa9e66cdb0a1928448eb9;p=buildroot.git fs/ext2: use mkfs to generate rootfs image mkfs is now capable of generating rootfs images. Use mkfs instead of genext2fs. If not set, we now let mkfs calculate the block size and the number of inodes needed. This change also adjusts the options to meet those of mkfs. Notes: * Passing a null inode number to mkfs triggers its automatic calculation. * Passing a fs-size with no unit suffix to mkfs is interpreted as using 1K block size. Signed-off-by: Sébastien Szymanski Signed-off-by: Samuel Martin Cc: "Yann E. MORIN" Reviewed-by: Arnout Vandecappelle (Essensium/Mind) [Thomas: don't pass PATH when calling mkfs.ext, just call it directly from $(HOST_DIR)/usr/sbin, as suggested by Arnout.] Signed-off-by: Thomas Petazzoni --- diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in index ec1b5f2c55..9c58ac62ed 100644 --- a/fs/ext2/Config.in +++ b/fs/ext2/Config.in @@ -1,6 +1,6 @@ config BR2_TARGET_ROOTFS_EXT2 bool "ext2/3/4 root filesystem" - select BR2_PACKAGE_HOST_MKE2IMG + select BR2_PACKAGE_HOST_E2FSPROGS help Build an ext2/3/4 root filesystem diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk index 8a648dd66c..ff04b78efb 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -10,18 +10,18 @@ EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL)) #" Syntax highlighting... :-/ ) EXT2_OPTS = \ - -G $(BR2_TARGET_ROOTFS_EXT2_GEN) \ - -R $(BR2_TARGET_ROOTFS_EXT2_REV) \ - -B 1024 \ - -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) \ - -i $(BR2_TARGET_ROOTFS_EXT2_INODES) \ - -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \ - -l "$(EXT2_LABEL)" + -d $(TARGET_DIR) \ + -r $(BR2_TARGET_ROOTFS_EXT2_REV) \ + -N $(BR2_TARGET_ROOTFS_EXT2_INODES) \ + -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \ + -L "$(EXT2_LABEL)" -ROOTFS_EXT2_DEPENDENCIES = host-mke2img +ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs define ROOTFS_EXT2_CMD - PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@ + rm -f $@ + $(HOST_DIR)/usr/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \ + $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) endef rootfs-ext2-symlink: