aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-03-17 13:32:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-21 22:42:59 +0000
commit17c2b1ca8a4e2023583645840db61bbde22bf65e (patch)
tree84deb71e91af8fe072a3fa5c7612effa1dde0a51 /meta/classes
parent3dc1376deb5b3f429baeb4ccb47972a34860d127 (diff)
downloadopenembedded-core-contrib-17c2b1ca8a4e2023583645840db61bbde22bf65e.tar.gz
image_types: increase filesystem size for BTRFS
16777216 bytes is a minimal possible filesystem size for BTRFS. mkfs.btrfs fails to create a filesystem if rootfs size is too small. Increased filesystem size to make it possible for mkfs.btrfs to create an image for small rootfs directories, e.g. for core-image-minimal. [YOCTO #11163] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/image_types.bbclass11
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index d2eb99dbb72..99adeb31222 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -82,12 +82,13 @@ IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
MIN_BTRFS_SIZE ?= "16384"
IMAGE_CMD_btrfs () {
- if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then
- dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${ROOTFS_SIZE} bs=1024
- mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
- else
- bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
+ size=${ROOTFS_SIZE}
+ if [ ${size} -lt ${MIN_BTRFS_SIZE} ] ; then
+ size=${MIN_BTRFS_SIZE}
+ bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K"
fi
+ dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${size} bs=1024
+ mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
}
IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend"