diff options
author | Saul Wold <sgw@linux.intel.com> | 2015-02-10 13:05:53 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-14 08:41:00 +0000 |
commit | 842a33219ecb1a0c84b70e04a0b3f59dfe09d47e (patch) | |
tree | 2c3a15df215aa079d398cf59b0d850e7c7cd85fb /meta/classes | |
parent | e34a65f6d54214c8a891c37f57271cee86685e35 (diff) | |
download | poky-842a33219ecb1a0c84b70e04a0b3f59dfe09d47e.tar.gz |
image_types: Error out if BTRFS image is too small
[YOCTO #6804]
(From OE-Core rev: 14a1c035ba654aff1ec09d884f0b0acf7b83ab79)
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image_types.bbclass | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index d6cc87f79d..4983e9834d 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
@@ -58,9 +58,14 @@ IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}" | |||
58 | IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}" | 58 | IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}" |
59 | IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}" | 59 | IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}" |
60 | 60 | ||
61 | MIN_BTRFS_SIZE ?= "16777216" | ||
61 | IMAGE_CMD_btrfs () { | 62 | IMAGE_CMD_btrfs () { |
62 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs count=${ROOTFS_SIZE} bs=1024 | 63 | if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then |
63 | mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs | 64 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs count=${ROOTFS_SIZE} bs=1024 |
65 | mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs | ||
66 | else | ||
67 | bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})" | ||
68 | fi | ||
64 | } | 69 | } |
65 | 70 | ||
66 | IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${EXTRA_IMAGECMD} -noappend" | 71 | IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${EXTRA_IMAGECMD} -noappend" |