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

Submitted by Mark Hatle on Nov. 21, 2013, 7:13 a.m.


Message ID 1385018038-23380-13-git-send-email-mark.hatle@windriver.com
State Accepted
Commit 6338fe9ba338615317a4e7ccc99287b236ac77ae
Headers show

Commit Message

Mark Hatle Nov. 21, 2013, 7:13 a.m.
From: Robert Yang <liezhi.yang@windriver.com>

We used populate-extfs.sh 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 populate-extfs.sh /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 <liezhi.yang@windriver.com>
 meta/classes/image_types.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

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
-	populate-extfs.sh ${IMAGE_ROOTFS} ${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}"