Patchwork [RFC,12/12] image_types.bbclass: use mke2fs -d to create the ext2/3/4 image

mail settings
Submitter Mark Hatle
Date Nov. 21, 2013, 7:13 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/62105/
State Accepted
Commit 6338fe9ba338615317a4e7ccc99287b236ac77ae
Headers show


Mark Hatle - Nov. 21, 2013, 7:13 a.m.
From: Robert Yang <>

We used which invoked the debugfs to create the image,
now the mke2fs' option "-d root-directory" can do the same thing, and
which is a little faster, for example, the glibc_std:

$ time mkfs
$ time /path/to/rootfs/ wrlinux-image-glibc-std-qemux86.ext4
real    1m3.724s
user    0m54.955s
sys     0m8.021s

$ time mkfs.ext4 -F -d /path/to/rootfs/ wrlinux-image-glibc-std-qemux86.ext4
real    0m46.256s
user    0m40.323s
sys     0m1.628s

17s are saved.

Signed-off-by: Robert Yang <>
 meta/classes/image_types.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 8c49169..d6c80a2 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -152,8 +152,7 @@  oe_mkext234fs () {
 	# Create a sparse image block
 	dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=0 bs=1k
-	mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype
+	mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS}
 IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"