summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2015-02-10 13:05:53 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-14 08:41:00 +0000
commit842a33219ecb1a0c84b70e04a0b3f59dfe09d47e (patch)
tree2c3a15df215aa079d398cf59b0d850e7c7cd85fb /meta
parente34a65f6d54214c8a891c37f57271cee86685e35 (diff)
downloadast2050-yocto-poky-842a33219ecb1a0c84b70e04a0b3f59dfe09d47e.zip
ast2050-yocto-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')
-rw-r--r--meta/classes/image_types.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index d6cc87f..4983e98 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}"
IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+MIN_BTRFS_SIZE ?= "16777216"
IMAGE_CMD_btrfs () {
- dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs count=${ROOTFS_SIZE} bs=1024
- mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs
+ if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then
+ dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs count=${ROOTFS_SIZE} bs=1024
+ mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs
+ else
+ bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
+ fi
}
IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${EXTRA_IMAGECMD} -noappend"
OpenPOWER on IntegriCloud