summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorThomas Perrot <thomas.perrot@bootlin.com>2021-10-19 01:21:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-23 17:41:46 +0100
commit6f0c6a0cc9b4685716f0991ce350d046810eb8ec (patch)
treef0d4babd44939a5fa70255ae0ee60c5e28975cce /meta
parent840c5b442d4b27a3791ced63565bf757de1d95ca (diff)
downloadopenembedded-core-6f0c6a0cc9b4685716f0991ce350d046810eb8ec.tar.gz
image_types: allow the creation of block devices on top of UBI volumes
Currently, the function multiubi_mkfs doesn't allow using anything else than UBIFS over UBI. Here, we propose to introduce two variables that allow to customize the ubinize configuration and the image dependency, in order to be able to build UBI images using the ubiblock abstraction layer and block filesystems. For example, with this change it is possible to build a UBI volume using a compressed squashfs, with the following configuration: UBI_VOLTYPE ?= "static" UBI_IMGTYPE ?= "squasfs-lz4" Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types.bbclass14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 32d4cd4c76..f643ed3ce7 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -139,16 +139,18 @@ IMAGE_CMD:cpio () {
}
UBI_VOLNAME ?= "${MACHINE}-rootfs"
+UBI_VOLTYPE ?= "dynamic"
+UBI_IMGTYPE ?= "ubifs"
multiubi_mkfs() {
local mkubifs_args="$1"
local ubinize_args="$2"
-
+
# Added prompt error message for ubi and ubifs image creation.
if [ -z "$mkubifs_args" ] || [ -z "$ubinize_args" ]; then
bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
fi
-
+
if [ -z "$3" ]; then
local vname=""
else
@@ -157,9 +159,9 @@ multiubi_mkfs() {
echo \[ubifs\] > ubinize${vname}-${IMAGE_NAME}.cfg
echo mode=ubi >> ubinize${vname}-${IMAGE_NAME}.cfg
- echo image=${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo image=${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.${UBI_IMGTYPE} >> ubinize${vname}-${IMAGE_NAME}.cfg
echo vol_id=0 >> ubinize${vname}-${IMAGE_NAME}.cfg
- echo vol_type=dynamic >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo vol_type=${UBI_VOLTYPE} >> ubinize${vname}-${IMAGE_NAME}.cfg
echo vol_name=${UBI_VOLNAME} >> ubinize${vname}-${IMAGE_NAME}.cfg
echo vol_flags=autoresize >> ubinize${vname}-${IMAGE_NAME}.cfg
if [ -n "$vname" ]; then
@@ -198,7 +200,7 @@ IMAGE_CMD:multiubi () {
IMAGE_CMD:ubi () {
multiubi_mkfs "${MKUBIFS_ARGS}" "${UBINIZE_ARGS}"
}
-IMAGE_TYPEDEP:ubi = "ubifs"
+IMAGE_TYPEDEP:ubi = "${UBI_IMGTYPE}"
IMAGE_CMD:ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
@@ -329,7 +331,7 @@ CONVERSION_DEPENDS_gzsync = "zsync-curl-native"
RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
RUNNABLE_MACHINE_PATTERNS ?= "qemu"
-DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
+DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
# images that will not be built at do_rootfs time: vmdk, vhd, vhdx, vdi, qcow2, hddimg, iso, etc.