[oe-commits] Robert Yang : image_types.bbclass: use mke2fs -d to create the ext2/3/ 4 image

git at git.openembedded.org git at git.openembedded.org
Fri Mar 7 07:27:00 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 6d25befe21e21ff1be424d6587356fcefb0fb18b
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=6d25befe21e21ff1be424d6587356fcefb0fb18b

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Fri Mar  7 01:59:34 2014 -0500

image_types.bbclass: use mke2fs -d to create the ext2/3/4 image

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 more faster, for example, the core-imag-sato:

* In the past:
$ time mke2fs -t ext4 rootfs.ext4
real    0m0.249s
user    0m0.036s
sys     0m0.132s
$ time populate-extfs.sh /path/to/rootfs/ rootfs.ext4
real    0m29.355s
user    0m10.637s
sys     0m5.544s

* Now:
$ time mkfs.ext4 -F -d /path/to/rootfs/ rootfs.ext4
real    0m6.338s
user    0m3.824s
sys     0m1.356s

More than 25 seconds are saved.

[YOCTO #4083]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 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 602c1f0..5864006 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -49,8 +49,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}"



More information about the Openembedded-commits mailing list