浏览代码

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 <sebastien.szymanski@armadeus.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[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 <thomas.petazzoni@free-electrons.com>
Sébastien Szymanski 8 年之前
父节点
当前提交
67aaa90d3b
共有 2 个文件被更改,包括 10 次插入10 次删除
  1. 1 1
      fs/ext2/Config.in
  2. 9 9
      fs/ext2/ext2.mk

+ 1 - 1
fs/ext2/Config.in

@@ -1,6 +1,6 @@
 config BR2_TARGET_ROOTFS_EXT2
 config BR2_TARGET_ROOTFS_EXT2
 	bool "ext2/3/4 root filesystem"
 	bool "ext2/3/4 root filesystem"
-	select BR2_PACKAGE_HOST_MKE2IMG
+	select BR2_PACKAGE_HOST_E2FSPROGS
 	help
 	help
 	  Build an ext2/3/4 root filesystem
 	  Build an ext2/3/4 root filesystem
 
 

+ 9 - 9
fs/ext2/ext2.mk

@@ -10,18 +10,18 @@ EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
 #" Syntax highlighting... :-/ )
 #" Syntax highlighting... :-/ )
 
 
 EXT2_OPTS = \
 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
 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
 endef
 
 
 rootfs-ext2-symlink:
 rootfs-ext2-symlink: