Skip to contentSkip to conversation

meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU

PATCH Superseded Aníbal Limón 3 participants 5 messages Oct 16, 2018 – Jan 2, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU

When use simpleremote target the flash/boot process is executed manually, the IMAGE_FSTYPES validation is only needed when execute testimage against qemu.

The supported_fstypes comes from oeqa.core.target.qemu module.

---
 meta/classes/testimage.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meta/classes/testimage.bbclass +7 -6
index 2642a722e7..734cb7caae 100644
@@ -194,12 +194,13 @@ def testimage_main(d):
     machine = d.getVar("MACHINE")
 
     # Get rootfs
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
-                  if fs in supported_fstypes]
-    if not fstypes:
-        bb.fatal('Unsupported image type built. Add a comptible image to '
-                 'IMAGE_FSTYPES. Supported types: %s' %
-                 ', '.join(supported_fstypes))
+    fstypes = d.getVar('IMAGE_FSTYPES')
+    if d.getVar("TEST_TARGET") == "qemu":
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]
+        if not fstypes:
+            bb.fatal('Unsupported image type built. Add a comptible image to '
+                     'IMAGE_FSTYPES. Supported types: %s' %
+                     ', '.join(supported_fstypes))
     rootfs = '%s.%s' % (image_name, fstypes[0])
 
     # Get tmpdir (not really used, just for compatibility)
Signature · 1 line
2.11.0
#1 lore raw
Quoted 25 lines · Aníbal Limón

When use simpleremote target the flash/boot process is executed manually, the IMAGE_FSTYPES validation is only needed when execute testimage against qemu.

The supported_fstypes comes from oeqa.core.target.qemu module.

---
 meta/classes/testimage.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meta/classes/testimage.bbclass +0 -6
index 2642a722e7..734cb7caae 100644
@@ -194,12 +194,13 @@ def testimage_main(d):
     machine = d.getVar("MACHINE")
 
     # Get rootfs
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
-                  if fs in supported_fstypes]
-    if not fstypes:
-        bb.fatal('Unsupported image type built. Add a comptible image to '
-                 'IMAGE_FSTYPES. Supported types: %s' %
-                 ', '.join(supported_fstypes))

meta/classes/testimage.bbclass def testimage_main(d): · line 206

Quoted 10 lines
meta/classes/testimage.bbclass +7 -0
+    fstypes = d.getVar('IMAGE_FSTYPES')
+    if d.getVar("TEST_TARGET") == "qemu":
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]
+        if not fstypes:
+            bb.fatal('Unsupported image type built. Add a comptible image to '
+                     'IMAGE_FSTYPES. Supported types: %s' %
+                     ', '.join(supported_fstypes))
     rootfs = '%s.%s' % (image_name, fstypes[0])
 
     # Get tmpdir (not really used, just for compatibility)

This causes the autobuilder to break and there is a bug in the logic above:

https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c

(one of many failures as everything broke)

Cheers,

Richard

#2 lore raw
Quoted 38 lines · On Sat, 20 Oct 2018 at 02:11, <[email protected]> wrote:
Quoted 4 lines · Aníbal Limón

When use simpleremote target the flash/boot process is executed manually, the IMAGE_FSTYPES validation is only needed when execute testimage against qemu.

Review

Quoted 8 lines

The supported_fstypes comes from oeqa.core.target.qemu module.

---
 meta/classes/testimage.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
(quoted diff) +0 -0

b/meta/classes/testimage.bbclass

meta/classes/testimage.bbclass def testimage_main(d): · line 200

Quoted 11 lines

index 2642a722e7..734cb7caae 100644

meta/classes/testimage.bbclass +0 -4
@@ -194,12 +194,13 @@ def testimage_main(d):
     machine = d.getVar("MACHINE")
 
     # Get rootfs
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
-                  if fs in supported_fstypes]
-    if not fstypes:
-        bb.fatal('Unsupported image type built. Add a comptible image

to '

meta/classes/testimage.bbclass def testimage_main(d):

Quoted 7 lines
meta/classes/testimage.bbclass +5 -2
-                 'IMAGE_FSTYPES. Supported types: %s' %
-                 ', '.join(supported_fstypes))
+    fstypes = d.getVar('IMAGE_FSTYPES')
+    if d.getVar("TEST_TARGET") == "qemu":
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]
+        if not fstypes:
+            bb.fatal('Unsupported image type built. Add a comptible

image to '

Quoted 4 lines
meta/classes/testimage.bbclass +2 -0
+                     'IMAGE_FSTYPES. Supported types: %s' %
+                     ', '.join(supported_fstypes))
     rootfs = '%s.%s' % (image_name, fstypes[0])
 
Quoted 7 lines

meta/classes/testimage.bbclass def testimage_main(d): · line 206

Quoted 1 line
meta/classes/testimage.bbclass +0 -0
     # Get tmpdir (not really used, just for compatibility)

This causes the autobuilder to break and there is a bug in the logic above:

https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c

I'm not seeing this error, I executed testimage in qemuarm and qemux86, I'm looking at the configuration but should not fail because I added only a conditional to filter only
when the target is qemu.

Regards,
Anibal

Quoted 10 lines

(one of many failures as everything broke)

Cheers,

Richard

#3 lore raw
Quoted 4 lines · Anibal Limon
Quoted 4 lines

meta/classes/testimage.bbclass def testimage_main(d): · line 199

Quoted 4 lines
meta/classes/testimage.bbclass +2 -1
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
 
+    fstypes = d.getVar('IMAGE_FSTYPES')
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]

That's the problem, the old code takes IMAGE_FSTYPES and splits it on whitespace, the new code iterates over each *character*

Ross

#4 lore raw
Quoted 10 lines · Ross
Quoted 4 lines · Anibal Limon
Quoted 4 lines

meta/classes/testimage.bbclass def testimage_main(d): · line 199

Quoted 4 lines
meta/classes/testimage.bbclass +2 -1
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
 
+    fstypes = d.getVar('IMAGE_FSTYPES')
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]

That's the problem, the old code takes IMAGE_FSTYPES and splits it on whitespace, the new code iterates over each *character*

I sent an old version, sorry for that, sending v3...

Anibal

Quoted 3 lines

Ross