summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2018-01-22 11:55:54 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-23 23:43:46 +0000
commitc44980abaf4ef3756597c0c5b51678253a56a5f5 (patch)
tree66707631a80bc91d84d4b38104acc97b84953fc5 /meta/classes/image_types.bbclass
parent58dd6fe3720428a7052a482ca1fdcc7de8768fc7 (diff)
downloadpoky-c44980abaf4ef3756597c0c5b51678253a56a5f5.tar.gz
image_types: add support for modern f2fs flash filesystem
The f2fs filesystem is a newer flash filesystem that is available in meta-filesystems. This needs a minimum sized blank space to operate in correctly. The f2fs has overprovision functionality and when building smaller filesystems, you actually need more space, therefore under 500M (or so) double the amount of space needed in order to handle the overprovision functions in f2fs. (From OE-Core rev: dec029686a47b574edfce4472fe2167db54398fb) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image_types.bbclass')
-rw-r--r--meta/classes/image_types.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index c736f92e58..b17c435274 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -208,6 +208,23 @@ IMAGE_CMD_ubi () {
208 208
209IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}" 209IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
210 210
211MIN_F2FS_SIZE ?= "524288"
212IMAGE_CMD_f2fs () {
213 # We need to add additional smarts here form devices smaller than 1.5G
214 # Need to scale appropriately between 40M -> 1.5G as the "overprovision
215 # ratio" goes down as the device gets bigger (70% -> 4.5%), below about
216 # 500M the standard IMAGE_OVERHEAD_FACTOR does not work, so add additional
217 # space here when under 500M
218 size=${ROOTFS_SIZE}
219 if [ ${size} -lt ${MIN_F2FS_SIZE} ] ; then
220 size=${MIN_F2FS_SIZE}
221 bbwarn "Rootfs size is too small for F2FS. Filesystem will be extended to ${size}K"
222 fi
223 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs seek=${size} count=0 bs=1024
224 mkfs.f2fs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
225 sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
226}
227
211EXTRA_IMAGECMD = "" 228EXTRA_IMAGECMD = ""
212 229
213inherit siteinfo kernel-arch 230inherit siteinfo kernel-arch
@@ -220,6 +237,7 @@ EXTRA_IMAGECMD_ext2 ?= "-i 4096"
220EXTRA_IMAGECMD_ext3 ?= "-i 4096" 237EXTRA_IMAGECMD_ext3 ?= "-i 4096"
221EXTRA_IMAGECMD_ext4 ?= "-i 4096" 238EXTRA_IMAGECMD_ext4 ?= "-i 4096"
222EXTRA_IMAGECMD_btrfs ?= "-n 4096" 239EXTRA_IMAGECMD_btrfs ?= "-n 4096"
240EXTRA_IMAGECMD_f2fs ?= ""
223 241
224do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot" 242do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
225do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot" 243do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
@@ -234,6 +252,7 @@ do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
234do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot" 252do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
235do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot" 253do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
236do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot" 254do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
255do_image_f2fs[depends] += "f2fs-tools-native:do_populate_sysroot"
237 256
238# This variable is available to request which values are suitable for IMAGE_FSTYPES 257# This variable is available to request which values are suitable for IMAGE_FSTYPES
239IMAGE_TYPES = " \ 258IMAGE_TYPES = " \
@@ -251,6 +270,7 @@ IMAGE_TYPES = " \
251 cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \ 270 cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
252 wic wic.gz wic.bz2 wic.lzma \ 271 wic wic.gz wic.bz2 wic.lzma \
253 container \ 272 container \
273 f2fs \
254" 274"
255 275
256# Compression is a special case of conversion. The old variable 276# Compression is a special case of conversion. The old variable