summaryrefslogtreecommitdiffstats
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-22 11:35:19 +0000
commite7ce3c7f62bf4c043e48118eea10b42fe52f7a85 (patch)
tree899258a2ddb56a624af5188acab985d76649d7a4
parent9fc3fec4499e6110031245d7b56e580c903e77e5 (diff)
downloadpoky-e7ce3c7f62bf4c043e48118eea10b42fe52f7a85.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] (From OE-Core rev: 17c2b1ca8a4e2023583645840db61bbde22bf65e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 d2eb99dbb7..99adeb3122 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}"
82 82
83MIN_BTRFS_SIZE ?= "16384" 83MIN_BTRFS_SIZE ?= "16384"
84IMAGE_CMD_btrfs () { 84IMAGE_CMD_btrfs () {
85 if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then 85 size=${ROOTFS_SIZE}
86 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${ROOTFS_SIZE} bs=1024 86 if [ ${size} -lt ${MIN_BTRFS_SIZE} ] ; then
87 mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs 87 size=${MIN_BTRFS_SIZE}
88 else 88 bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K"
89 bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
90 fi 89 fi
90 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${size} bs=1024
91 mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
91} 92}
92 93
93IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend" 94IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend"