* [PATCH 0/2 v2] Add f2fs support
@ 2018-01-22 19:55 Saul Wold
2018-01-22 19:55 ` [PATCH 1/2 v2] imagefeatures: disable f2fs from test_image_features by default Saul Wold
2018-01-22 19:55 ` [PATCH 2/2 v2] image_types: add support for modern f2fs flash filesystem Saul Wold
0 siblings, 2 replies; 3+ messages in thread
From: Saul Wold @ 2018-01-22 19:55 UTC (permalink / raw)
To: openembedded-core, richard.purdie
This second series adds a patch to disable the testing f2fs as
part of the image features testing. The ordering is important
since we want to disable the test and then enable the functionality.
Sau!
Saul Wold (2):
imagefeatures: disable f2fs from test_image_features by default
image_types: add support for modern f2fs flash filesystem
meta/classes/image_types.bbclass | 20 ++++++++++++++++++++
meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
--
2.14.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2 v2] imagefeatures: disable f2fs from test_image_features by default
2018-01-22 19:55 [PATCH 0/2 v2] Add f2fs support Saul Wold
@ 2018-01-22 19:55 ` Saul Wold
2018-01-22 19:55 ` [PATCH 2/2 v2] image_types: add support for modern f2fs flash filesystem Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2018-01-22 19:55 UTC (permalink / raw)
To: openembedded-core, richard.purdie
Since the primary f2fs utilities are provided by the meta-openembedded
meta-filesystems layer, we disable the testing of that functionality
here.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 0ffb686921c..09e0b20625b 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -211,7 +211,7 @@ class ImageFeatures(OESelftestTestCase):
image_name = 'core-image-minimal'
img_types = [itype for itype in get_bb_var("IMAGE_TYPES", image_name).split() \
- if itype not in ('container', 'elf', 'multiubi')]
+ if itype not in ('container', 'elf', 'f2fs', 'multiubi')]
config = 'IMAGE_FSTYPES += "%s"\n'\
'MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"\n'\
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2 v2] image_types: add support for modern f2fs flash filesystem
2018-01-22 19:55 [PATCH 0/2 v2] Add f2fs support Saul Wold
2018-01-22 19:55 ` [PATCH 1/2 v2] imagefeatures: disable f2fs from test_image_features by default Saul Wold
@ 2018-01-22 19:55 ` Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2018-01-22 19:55 UTC (permalink / raw)
To: openembedded-core, richard.purdie
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.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
meta/classes/image_types.bbclass | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index c736f92e58c..b17c435274e 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -208,6 +208,23 @@ IMAGE_CMD_ubi () {
IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
+MIN_F2FS_SIZE ?= "524288"
+IMAGE_CMD_f2fs () {
+ # We need to add additional smarts here form devices smaller than 1.5G
+ # Need to scale appropriately between 40M -> 1.5G as the "overprovision
+ # ratio" goes down as the device gets bigger (70% -> 4.5%), below about
+ # 500M the standard IMAGE_OVERHEAD_FACTOR does not work, so add additional
+ # space here when under 500M
+ size=${ROOTFS_SIZE}
+ if [ ${size} -lt ${MIN_F2FS_SIZE} ] ; then
+ size=${MIN_F2FS_SIZE}
+ bbwarn "Rootfs size is too small for F2FS. Filesystem will be extended to ${size}K"
+ fi
+ dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs seek=${size} count=0 bs=1024
+ mkfs.f2fs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
+ sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
+}
+
EXTRA_IMAGECMD = ""
inherit siteinfo kernel-arch
@@ -220,6 +237,7 @@ EXTRA_IMAGECMD_ext2 ?= "-i 4096"
EXTRA_IMAGECMD_ext3 ?= "-i 4096"
EXTRA_IMAGECMD_ext4 ?= "-i 4096"
EXTRA_IMAGECMD_btrfs ?= "-n 4096"
+EXTRA_IMAGECMD_f2fs ?= ""
do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
@@ -234,6 +252,7 @@ do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
+do_image_f2fs[depends] += "f2fs-tools-native:do_populate_sysroot"
# This variable is available to request which values are suitable for IMAGE_FSTYPES
IMAGE_TYPES = " \
@@ -251,6 +270,7 @@ IMAGE_TYPES = " \
cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
wic wic.gz wic.bz2 wic.lzma \
container \
+ f2fs \
"
# Compression is a special case of conversion. The old variable
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-22 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 19:55 [PATCH 0/2 v2] Add f2fs support Saul Wold
2018-01-22 19:55 ` [PATCH 1/2 v2] imagefeatures: disable f2fs from test_image_features by default Saul Wold
2018-01-22 19:55 ` [PATCH 2/2 v2] image_types: add support for modern f2fs flash filesystem Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox