[OE-core] [meta-oe][PATCH] image_types.bbclass: add optional size to ubi vols

Tobias Olausson TOl at hms.se
Mon Jun 18 12:25:26 UTC 2018


Just noticed there is a serious typo that will make this fail in multiubi settings. It worked for my non-multi setup which was just lucky variable naming. Will send an updated patch.


Tobias Olausson
Development Engineer

HMS Industrial Networks AB

Norra Ågatan 26C
431 35 Mölndal, Sweden

Email: tol at hms.se



________________________________
From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> on behalf of Tobias Olausson <TOl at hms.se>
Sent: Monday, June 18, 2018 1:29 PM
To: openembedded-core at lists.openembedded.org
Cc: Magnus Olsson
Subject: [OE-core] [meta-oe][PATCH] image_types.bbclass: add optional size to ubi vols

>From d7b8be3f844c10ace0d4c04e35986145fc20d0d8 Mon Sep 17 00:00:00 2001
From: Tobias Olausson <tol at hms.se>
Date: Mon, 18 Jun 2018 13:22:04 +0200
Subject: [meta-oe][PATCH] image_types.bbclass: add optional size to ubi vols

Instead of hard coding the ubi volume to be just large enough to fit the
root file system, one can use a variable to set a preferred size.

Signed-off-by: Tobias Olausson <tol at hms.se>
---
 meta/classes/image_types.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 00a00d318f..ae23aeaa8a 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -164,10 +164,18 @@ multiubi_mkfs() {
                 local vname="_$3"
         fi

+       # Set UBI_VOL_SIZE (for regular ubi) or UBI_VOL_SIZE_name for multiubi
+       eval local UBI_VOL_SIZE=\"\$UBI_VOL_SIZE_${name}\"
+
         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 vol_id=0 >> ubinize${vname}-${IMAGE_NAME}.cfg
+
+       if [ -n "${UBI_VOL_SIZE}" ]; then
+               echo "vol_size=${UBI_VOL_SIZE}" >> ubinize${vname}-${IMAGE_NAME}.cfg
+       fi
+
         echo vol_type=dynamic >> ubinize${vname}-${IMAGE_NAME}.cfg
         echo vol_name=${UBI_VOLNAME} >> ubinize${vname}-${IMAGE_NAME}.cfg
         echo vol_flags=autoresize >> ubinize${vname}-${IMAGE_NAME}.cfg
--
2.17.1



--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180618/514c52fc/attachment-0002.html>


More information about the Openembedded-core mailing list