diff options
author | Alex Franco <alejandro.franco@linux.intel.com> | 2015-08-26 16:57:35 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-29 13:38:06 +0100 |
commit | 0cd5d6dcbb34a7c00e298502a0df5e9af7bc9345 (patch) | |
tree | ecfbc1bda494028568cf4da9ea1744e405ad98ec /meta | |
parent | 9b6bf6a41f630967c92dbc6644542943ff5f2305 (diff) | |
download | poky-0cd5d6dcbb34a7c00e298502a0df5e9af7bc9345.tar.gz |
Empty image: filesystem allocation
Increase sparse image block size when ROOTFS_SIZE is smaller than
the minimum needed for ext4 to fit into it.
[YOCTO #7664]
(From OE-Core rev: 6938791ff97a23430afb4aa16d71aa8729a12ead)
Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/image_types.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 8547574a1d..2fd4c3794a 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
@@ -49,8 +49,16 @@ oe_mkext234fs () { | |||
49 | extra_imagecmd=$@ | 49 | extra_imagecmd=$@ |
50 | fi | 50 | fi |
51 | 51 | ||
52 | # If generating an empty image the size of the sparse block should be large | ||
53 | # enough to allocate an ext4 filesystem using 4096 bytes per inode, this is | ||
54 | # about 60K, so dd needs a minimum count of 60, with bs=1024 (bytes per IO) | ||
55 | eval local COUNT=\"0\" | ||
56 | eval local MIN_COUNT=\"60\" | ||
57 | if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then | ||
58 | eval COUNT=\"$MIN_COUNT\" | ||
59 | fi | ||
52 | # Create a sparse image block | 60 | # Create a sparse image block |
53 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=0 bs=1k | 61 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024 |
54 | mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS} | 62 | mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS} |
55 | } | 63 | } |
56 | 64 | ||