Skip to contentSkip to conversation

image_types: Ensure rootfs dependencies cover DEBUGFS

PATCH In review Richard Purdie 4 participants 5 messages Apr 19, 2016 – May 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types: Ensure rootfs dependencies cover DEBUGFS

If you configure a bz2 debugfs, pbzip2-native currently isn't built. This patch makes sure the dependencies are added.

meta/classes/image_types.bbclass +3 -1
index e2467bd..122e080 100644
@@ -17,7 +17,9 @@ def imagetypes_getdepends(d):
 
     deps = []
     ctypes = d.getVar('COMPRESSIONTYPES', True).split()
-    for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
+    fstypes = set((d.getVar('IMAGE_FSTYPES', True) or "").split())
+    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS', True) or "").split())
+    for type in fstypes:
         if type in ["vmdk", "vdi", "qcow2", "hdddirect", "live", "iso", "hddimg"]:
             type = "ext4"
         basetype = type
#1 lore raw
Quoted 2 lines · Richard Purdie

If you configure a bz2 debugfs, pbzip2-native currently isn't built. This patch makes sure the dependencies are added.

BTW: I've tried to enable IMAGE_GEN_DEBUGFS for first time as described in manual:
Build sysroot paths are now removed from debug symbol files. Removing these paths means that remote GDB using an unstripped build system sysroot will no longer work (although this was never documented to work). The supported method to accomplish something similar is to set IMAGE_GEN_DEBUGFS to "1", which will generate a companion debug image containing unstripped binaries and associated debug sources alongside the image.

and it fails with ugly exception, because IMAGE_FSTYPES_DEBUGFS isn't set by default.

It should either be mentioned in the manual or there should be some sane default for it.

meta/conf/local.conf.sample.extended shows example how to set it next to IMAGE_GEN_DEBUGFS, people reading this sample may notice it, but the comment also says:
If IMAGE_FSTYPES_DEBUGFS is not defined, it defaults to IMAGE_FSTYPES.
which isn't true for some reason in my setup, looking at the code I don't see where it is supposed to default to IMAGE_FSTYPES

if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).split() for t in debugfs_fstypes:
alltypes.append("debugfs_" + t)

Maybe the author meant that IMAGE_FSTYPES variable is set to IMAGE_FSTYPES_DEBUGFS only when IMAGE_FSTYPES_DEBUGFS is set, but that still leaves that split() causing parse failure.

debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True) if debugfs_image_fstypes:
d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes)

ERROR: /OE/build/wpb/webos-ports/meta-webos-ports/meta-luneos/recipes-core/images/luneos-image.bb: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 14, function: <module>

     0010:__anon_38__OE_build_wpb_webos_ports_openembedded_core_meta_classes_rootfs_ipk_bbclass(d)
     0011:__anon_113__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
     0012:__anon_176__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
     0013:__anon_146__OE_build_wpb_webos_ports_openembedded_core_meta_classes_siteinfo_bbclass(d)
 *** 0014:__anon_439__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
File: '/OE/build/wpb/webos-ports/openembedded-core/meta/classes/image.bbclass', lineno: 322, function: __anon_439__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass
     0318:    typedeps = {}
     0319:
     0320:    if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
     0321:        debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).split()
 *** 0322:        for t in debugfs_fstypes: 
     0323:            alltypes.append("debugfs_" + t)
     0324:
     0325:    def _add_type(t):
     0326:        baset = _image_base_type(t)

Exception: AttributeError: 'NoneType' object has no attribute 'split'

ERROR: Failed to parse recipe: /OE/build/wpb/webos-ports/meta-webos-ports/meta-luneos/recipes-core/images/luneos-image.bb

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.

Quoted 25 lines
meta/classes/image_types.bbclass +3 -1
index e2467bd..122e080 100644
@@ -17,7 +17,9 @@ def imagetypes_getdepends(d):
 
     deps = []
     ctypes = d.getVar('COMPRESSIONTYPES', True).split()
-    for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
+    fstypes = set((d.getVar('IMAGE_FSTYPES', True) or "").split())
+    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS', True) or "").split())
+    for type in fstypes:
         if type in ["vmdk", "vdi", "qcow2", "hdddirect", "live", "iso", "hddimg"]:
             type = "ext4"
         basetype = type
Signature · 5 lines
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 3 lines · Martin Jansa
Quoted 2 lines · Richard Purdie

If you configure a bz2 debugfs, pbzip2-native currently isn't built. This patch makes sure the dependencies are added.

I thought this had been fixed.

IMAGE_FSTYPES_DEBUGFS -should- be set to default to:

IMAGE_FSTYPES_DEBUGFS ?= "${IMAGE_FSTYPES}"

I usually set it to "tar.gz" myself.

So this is a bug, and we definitely need to fix it. :P

--Mark

Quoted 80 lines

BTW: I've tried to enable IMAGE_GEN_DEBUGFS for first time as described in manual:
Build sysroot paths are now removed from debug symbol files. Removing these paths means that remote GDB using an unstripped build system sysroot will no longer work (although this was never documented to work). The supported method to accomplish something similar is to set IMAGE_GEN_DEBUGFS to "1", which will generate a companion debug image containing unstripped binaries and associated debug sources alongside the image.

and it fails with ugly exception, because IMAGE_FSTYPES_DEBUGFS isn't set by default.

It should either be mentioned in the manual or there should be some sane default for it.

meta/conf/local.conf.sample.extended shows example how to set it next to IMAGE_GEN_DEBUGFS, people reading this sample may notice it, but the comment also says:
If IMAGE_FSTYPES_DEBUGFS is not defined, it defaults to IMAGE_FSTYPES.
which isn't true for some reason in my setup, looking at the code I don't see where it is supposed to default to IMAGE_FSTYPES

if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).split() for t in debugfs_fstypes:
alltypes.append("debugfs_" + t)

Maybe the author meant that IMAGE_FSTYPES variable is set to IMAGE_FSTYPES_DEBUGFS only when IMAGE_FSTYPES_DEBUGFS is set, but that still leaves that split() causing parse failure.

debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True) if debugfs_image_fstypes:
d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes)

ERROR: /OE/build/wpb/webos-ports/meta-webos-ports/meta-luneos/recipes-core/images/luneos-image.bb: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 14, function: <module>

     0010:__anon_38__OE_build_wpb_webos_ports_openembedded_core_meta_classes_rootfs_ipk_bbclass(d)
     0011:__anon_113__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
     0012:__anon_176__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
     0013:__anon_146__OE_build_wpb_webos_ports_openembedded_core_meta_classes_siteinfo_bbclass(d)
 *** 0014:__anon_439__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass(d)
File: '/OE/build/wpb/webos-ports/openembedded-core/meta/classes/image.bbclass', lineno: 322, function: __anon_439__OE_build_wpb_webos_ports_openembedded_core_meta_classes_image_bbclass
     0318:    typedeps = {}
     0319:
     0320:    if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
     0321:        debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).split()
 *** 0322:        for t in debugfs_fstypes: 
     0323:            alltypes.append("debugfs_" + t)
     0324:
     0325:    def _add_type(t):
     0326:        baset = _image_base_type(t)

Exception: AttributeError: 'NoneType' object has no attribute 'split'

ERROR: Failed to parse recipe: /OE/build/wpb/webos-ports/meta-webos-ports/meta-luneos/recipes-core/images/luneos-image.bb

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.

Quoted 25 lines
meta/classes/image_types.bbclass +3 -1
index e2467bd..122e080 100644
@@ -17,7 +17,9 @@ def imagetypes_getdepends(d):
 
     deps = []
     ctypes = d.getVar('COMPRESSIONTYPES', True).split()
-    for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
+    fstypes = set((d.getVar('IMAGE_FSTYPES', True) or "").split())
+    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS', True) or "").split())
+    for type in fstypes:
         if type in ["vmdk", "vdi", "qcow2", "hdddirect", "live", "iso", "hddimg"]:
             type = "ext4"
         basetype = type
Signature · 5 lines
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
#3 lore raw
Quoted 10 lines · Mark Hatle

I thought this had been fixed.

IMAGE_FSTYPES_DEBUGFS -should- be set to default to:

IMAGE_FSTYPES_DEBUGFS ?= "${IMAGE_FSTYPES}"

I usually set it to "tar.gz" myself.

So this is a bug, and we definitely need to fix it. :P

Nope, nothing in oe-core sets that. Can some at WR send a patch?

Ross

#4 lore raw
Quoted 2 lines · Ross

Nope, nothing in oe-core sets that. Can some at WR send a patch?

Never mind, just sent it using your example.

Ross