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

Mark Hatle mark.hatle at windriver.com
Thu Nov 21 07:13:58 UTC 2013


From: Robert Yang <liezhi.yang at 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 at windriver.com>
---
 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
-	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}"
-- 
1.8.1.2.545.g2f19ada




More information about the Openembedded-core mailing list