[OE-core] [PATCH] oeqa/selftest/imagefeatures: set a test for mutliubi in test_image_fstypes

2023-03-27 Thread Romuald Jeanne via lists.openembedded.org
From: Romuald Jeanne 

Allow 'multiubi' fstype image.
Set 'MULTIUBI_BUILD' with two entries to allow configuration for two
different '.ubifs'.
Configure 'MKUBIFS_ARGS_*' and 'UBINIZE_ARGS_*' for both configurations.

Signed-off-by: Romuald Jeanne 
---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 25 +++
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 3dc750594c7..d31b43d9cc1 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -199,7 +199,7 @@ class ImageFeatures(OESelftestTestCase):
 image = 'core-image-minimal'
 
 all_image_types = set(get_bb_var("IMAGE_TYPES", image).split())
-skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 
'tar.zst', 'wic.zst', 'squashfs-lzo'))
+skip_image_types = set(('container', 'elf', 'f2fs', 'tar.zst', 
'wic.zst', 'squashfs-lzo'))
 img_types = all_image_types - skip_image_types
 
 config = """
@@ -207,16 +207,31 @@ IMAGE_FSTYPES += "%s"
 WKS_FILE = "wictestdisk.wks"
 MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"
 UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"
+MULTIUBI_BUILD += "mtd_2_128"
+MKUBIFS_ARGS_mtd_2_128 ?= "-m 2048 -e 129024 -c 2047"
+UBINIZE_ARGS_mtd_2_128 ?= "-m 2048 -p 128KiB -s 512"
+MULTIUBI_BUILD += "mtd_4_256"
+MKUBIFS_ARGS_mtd_4_256 ?= "-m 4096 -e 253952 -c 4096"
+UBINIZE_ARGS_mtd_4_256 ?= "-m 4096 -p 256KiB"
 """ % ' '.join(img_types)
 self.write_config(config)
 
 bitbake(image)
-bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
+bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME', 
'MULTIUBI_BUILD'], image)
 
 for itype in img_types:
-image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.%s" % 
(bb_vars['IMAGE_LINK_NAME'], itype))
-# check if result image is in deploy directory
-self.assertTrue(os.path.exists(image_path),
+if itype == 'multiubi':
+# For multiubi build we need to manage MULTIUBI_BUILD entry to 
append
+# specific name to IMAGE_LINK_NAME
+for vname in bb_vars['MULTIUBI_BUILD'].split():
+image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 
"%s_%s.ubifs" % (bb_vars['IMAGE_LINK_NAME'], vname))
+# check if result image is in deploy directory
+self.assertTrue(os.path.exists(image_path),
+"%s image %s doesn't exist" % (itype, 
image_path))
+else:
+   image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.%s" 
% (bb_vars['IMAGE_LINK_NAME'], itype))
+   # check if result image is in deploy directory
+   self.assertTrue(os.path.exists(image_path),
 "%s image %s doesn't exist" % (itype, image_path))
 
 def test_useradd_static(self):
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#179163): 
https://lists.openembedded.org/g/openembedded-core/message/179163
Mute This Topic: https://lists.openembedded.org/mt/97883245/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] oeqa/selftest/imagefeatures: set a test for mutliubi in test_image_fstypes

2023-03-20 Thread Romuald Jeanne via lists.openembedded.org
From: Romuald Jeanne 

Allow 'multiubi' fstype image.
Set 'MULTIUBI_BUILD' with two entries to allow configuration for two
different '.ubifs'.
Configure 'MKUBIFS_ARGS_*' and 'UBINIZE_ARGS_*' for both configurations.

Signed-off-by: Romuald Jeanne 
---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 27 +++
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index bdd4d3200e2..cc374663e1a 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -203,7 +203,7 @@ class ImageFeatures(OESelftestTestCase):
 image_name = 'core-image-minimal'
 
 all_image_types = set(get_bb_var("IMAGE_TYPES", image_name).split())
-skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 
'tar.zst', 'wic.zst', 'squashfs-lzo'))
+skip_image_types = set(('container', 'elf', 'f2fs', 'tar.zst', 
'wic.zst', 'squashfs-lzo'))
 img_types = all_image_types - skip_image_types
 
 config = """
@@ -211,6 +211,12 @@ IMAGE_FSTYPES += "%s"
 WKS_FILE = "wictestdisk.wks"
 MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"
 UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"
+MULTIUBI_BUILD += "mtd_2_128"
+MKUBIFS_ARGS_mtd_2_128 ?= "-m 2048 -e 129024 -c 2047"
+UBINIZE_ARGS_mtd_2_128 ?= "-m 2048 -p 128KiB -s 512"
+MULTIUBI_BUILD += "mtd_4_256"
+MKUBIFS_ARGS_mtd_4_256 ?= "-m 4096 -e 253952 -c 4096"
+UBINIZE_ARGS_mtd_4_256 ?= "-m 4096 -p 256KiB"
 """ % ' '.join(img_types)
 self.write_config(config)
 
@@ -219,10 +225,21 @@ UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"
 deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
 link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
 for itype in img_types:
-image_path = os.path.join(deploy_dir_image, "%s.%s" % (link_name, 
itype))
-# check if result image is in deploy directory
-self.assertTrue(os.path.exists(image_path),
-"%s image %s doesn't exist" % (itype, image_path))
+if itype == 'multiubi':
+# For multiubi build we need to manage MULTIUBI_BUILD entry to 
append
+# specific name to IMAGE_LINK_NAME
+multiubi_build = get_bb_var('MULTIUBI_BUILD', 
image_name).split()
+for vname in multiubi_build:
+image_path = os.path.join(deploy_dir_image, "%s_%s.ubifs" 
% (link_name, vname))
+# check if result image is in deploy directory
+self.assertTrue(os.path.exists(image_path),
+"%s image %s doesn't exist" % (itype, 
image_path))
+else:
+image_path = os.path.join(deploy_dir_image, "%s.%s" % 
(link_name, itype))
+# check if result image is in deploy directory
+self.assertTrue(os.path.exists(image_path),
+"%s image %s doesn't exist" % (itype, 
image_path))
+
 
 def test_useradd_static(self):
 config = """
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#178830): 
https://lists.openembedded.org/g/openembedded-core/message/178830
Mute This Topic: https://lists.openembedded.org/mt/97731135/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] image_types: fix multiubi var init

2023-03-10 Thread Romuald Jeanne via lists.openembedded.org
From: Romuald Jeanne 

Make sure to expand all MKUBIFS_ARGS_ and UBINIZE_ARGS_ vars
in 'do_image_multiubi' task to use them to init the local 'mkubifs_args'
and 'ubinize_args' vars.

See [YOCTO #15065]

Signed-off-by: Romuald JEANNE 
---
 meta/classes-recipe/image_types.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes-recipe/image_types.bbclass 
b/meta/classes-recipe/image_types.bbclass
index 764e6a5574..24948e05e3 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -208,7 +208,10 @@ multiubi_mkfs() {
fi
 }
 
+MULTIUBI_ARGS = "MKUBIFS_ARGS UBINIZE_ARGS"
+
 IMAGE_CMD:multiubi () {
+   ${@' '.join(['%s_%s="%s";' % (arg, name, d.getVar('%s_%s' % (arg, 
name))) for arg in d.getVar('MULTIUBI_ARGS').split() for name in 
d.getVar('MULTIUBI_BUILD').split()])}
# Split MKUBIFS_ARGS_ and UBINIZE_ARGS_
for name in ${MULTIUBI_BUILD}; do
eval local mkubifs_args=\"\$MKUBIFS_ARGS_${name}\"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#178328): 
https://lists.openembedded.org/g/openembedded-core/message/178328
Mute This Topic: https://lists.openembedded.org/mt/97516709/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] image_types: fix vname var init in multiubi_mkfs() function

2023-03-09 Thread Romuald Jeanne via lists.openembedded.org
Hello,

The ‘write_ubi_config()’ is called through ‘multiubi_mkfs()’ where the _ 
separator is managed with proper init of ‘vname’ var.
So I didn’t dropped the _ separator, it is managed on calling function side.

Best regards,

Romuald JEANNE

From: Martin Jansa 
Sent: jeudi 9 mars 2023 09:31
To: Romuald JEANNE 
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] image_types: fix vname var init in 
multiubi_mkfs() function

On Thu, Mar 9, 2023 at 8:55 AM Romuald Jeanne via 
lists.openembedded.org<http://lists.openembedded.org> 
mailto:st@lists.openembedded.org>>
 wrote:
From: Romuald JEANNE mailto:romuald.jea...@st.com>>

As vname var is needed in multiubi_mkfs() function, we need to keep it
defined and use it as parameter to the new write_ubi_config() function.

See [YOCTO #15027]

Signed-off-by: Romuald JEANNE 
mailto:romuald.jea...@st.com>>
---
 meta/classes-recipe/image_types.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/image_types.bbclass 
b/meta/classes-recipe/image_types.bbclass
index 764e6a5574..c6cb8f5336 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -157,11 +157,7 @@ UBI_VOLTYPE ?= "dynamic"
 UBI_IMGTYPE ?= "ubifs"

 write_ubi_config() {
-   if [ -z "$1" ]; then
-   local vname=""
-   else
-   local vname="_$1"
-   fi
+   local vname="$1"

Did you drop the _ separator intentionally?


ST Restricted

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#178214): 
https://lists.openembedded.org/g/openembedded-core/message/178214
Mute This Topic: https://lists.openembedded.org/mt/97491796/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] image_types: fix vname var init in multiubi_mkfs() function

2023-03-08 Thread Romuald Jeanne via lists.openembedded.org
From: Romuald JEANNE 

As vname var is needed in multiubi_mkfs() function, we need to keep it
defined and use it as parameter to the new write_ubi_config() function.

See [YOCTO #15027]

Signed-off-by: Romuald JEANNE 
---
 meta/classes-recipe/image_types.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/image_types.bbclass 
b/meta/classes-recipe/image_types.bbclass
index 764e6a5574..c6cb8f5336 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -157,11 +157,7 @@ UBI_VOLTYPE ?= "dynamic"
 UBI_IMGTYPE ?= "ubifs"
 
 write_ubi_config() {
-   if [ -z "$1" ]; then
-   local vname=""
-   else
-   local vname="_$1"
-   fi
+   local vname="$1"
 
cat < ubinize${vname}-${IMAGE_NAME}.cfg
 [ubifs]
@@ -183,7 +179,12 @@ multiubi_mkfs() {
 bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see 
http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
 fi
 
-   write_ubi_config "$3"
+   if [ -z "$3" ]; then
+   local vname=""
+   else
+   local vname="_$3"
+   fi
+   write_ubi_config "${vname}"
 
if [ -n "$vname" ]; then
mkfs.ubifs -r ${IMAGE_ROOTFS} -o 
${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#178210): 
https://lists.openembedded.org/g/openembedded-core/message/178210
Mute This Topic: https://lists.openembedded.org/mt/97491796/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] image_types: fix vname var init in multiubi_mkfs() function

2023-03-03 Thread Romuald Jeanne via lists.openembedded.org
From: Romuald JEANNE 

As vname var is needed in multiubi_mkfs() function, we need to keep it
defined and use it as parameter to the new write_ubi_config() function.

See [YOCTO #15027]

Signed-off-by: Romuald JEANNE 
---
 meta/classes-recipe/image_types.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/image_types.bbclass 
b/meta/classes-recipe/image_types.bbclass
index 764e6a5574..77cb22cf9c 100644
--- a/meta/classes-recipe/image_types.bbclass
+++ b/meta/classes-recipe/image_types.bbclass
@@ -157,11 +157,7 @@ UBI_VOLTYPE ?= "dynamic"
 UBI_IMGTYPE ?= "ubifs"
 
 write_ubi_config() {
-   if [ -z "$1" ]; then
-   local vname=""
-   else
-   local vname="_$1"
-   fi
+   local vname="$1"
 
cat < ubinize${vname}-${IMAGE_NAME}.cfg
 [ubifs]
@@ -183,7 +179,12 @@ multiubi_mkfs() {
 bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see 
http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
 fi
 
-   write_ubi_config "$3"
+   if [ -z "$1" ]; then
+   local vname=""
+   else
+   local vname="_$3"
+   fi
+   write_ubi_config "${vname}"
 
if [ -n "$vname" ]; then
mkfs.ubifs -r ${IMAGE_ROOTFS} -o 
${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#177985): 
https://lists.openembedded.org/g/openembedded-core/message/177985
Mute This Topic: https://lists.openembedded.org/mt/97359377/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-