Skip to contentSkip to conversation

yocto-bsp fixes

PATCH Applied [email protected] 2 participants 6 messages Apr 13, 2012 – Apr 14, 2012

lore
Share & tools
lore
#0 lore raw

cover yocto-bsp fixes

From: Tom Zanussi <[email protected]>

This patchset fixes [YOCTO #2222], updating the property value listing code to match the current representation. The following combinations were tested (BSPs generated by yocto-bsp and sato images built and boot-tested):

- qemu i386 generated from JSON using the 3.2 kernel
- qemu arm generated from the text UI using the 3.2 kernel
- qemu x86-64 generated from JSON using the 3.0 kernel
- x86-64 generated from JSON using the 3.2 kernel
- i386 generated from text UI using the 3.0 kernel

Jessica Zhang has also verified that the propery value listing and BSP generation from JSON works for her in the Eclipse plugin.

There are also a few minor patches to the template files here that fix problems encountered when testing.

Please pull into poky/master.

Thanks,

Tom

The following changes since commit 6703173449ad21e1623ac75a66535cb2ed52aeeb:
Richard Purdie (1):
package_rpm.bbclass: Set tmppath for rpm to somewhere which won't conflict with the rootfs

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/2222-fix
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/2222-fix

Tom Zanussi (4):
yocto-bsp: enable property value display of nested properties
yocto-bsp: fix qemuarch test for xserver-xf86-config.bbappend
yocto-bsp: fix multi-provider error in qemu arch template
yocto-bsp: fix x86_64 tuning for qemu arch

 scripts/lib/bsp/engine.py                          |   56 +++++++++++++++++++-
 scripts/lib/bsp/kernel.py                          |    2 +-
 .../arch/qemu/conf/machine/{{=machine}}.conf       |    3 +-
 ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" |    0
 4 files changed, 57 insertions(+), 4 deletions(-)
 rename "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"i386\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" (100%)
#1 lore raw

PATCH 1/4 yocto-bsp: enable property value display of nested properties

From: Tom Zanussi <[email protected]>

Previous versions of yocto-bsp mapped every input element to a unique variable name, which is what the current property value display code expects. When that was changed to a nested form, the display code wasn't updated to match - this updated does that.

Fixes [YOCTO #2222]

---
 scripts/lib/bsp/engine.py |   56 +++++++++++++++++++++++++++++++++++++++++++-
 scripts/lib/bsp/kernel.py |    2 +-
 2 files changed, 55 insertions(+), 3 deletions(-)
scripts/lib/bsp/engine.py +54 -2
index d2f0735..8e53f00 100644
@@ -1222,8 +1222,7 @@ def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, prop
     context = create_context(machine, arch, scripts_path)
     target_files = expand_targets(context, bsp_output_dir)
 
-    if not properties:
-        input_lines = gather_inputlines(target_files)
+    input_lines = gather_inputlines(target_files)
 
     program_lines = []
 
@@ -1316,6 +1315,44 @@ def yocto_bsp_list_properties(arch, scripts_path, properties_file):
     print_dict(properties)
 
 
+def split_nested_property(property):
+    """
+    A property name of the form x.y describes a nested property
+    i.e. the property y is contained within x and can be addressed
+    using standard JSON syntax for nested properties.  Note that if a
+    property name itself contains '.', it should be contained in
+    double quotes.
+    """
+    splittable_property = ""
+    in_quotes = False
+    for c in property:
+        if c == '.' and not in_quotes:
+            splittable_property += '\n'
+            continue
+        if c == '"':
+            in_quotes = not in_quotes
+        splittable_property += c
+
+    split_properties = splittable_property.split('\n')
+
+    if len(split_properties) > 1:
+        return split_properties
+
+    return None
+
+
+def find_input_line_group(substring, input_lines):
+    """
+    Find and return the InputLineGroup containing the specified substring.
+    """
+    for line in input_lines:
+        if isinstance(line, InputLineGroup):
+            if substring in line.group[0].line:
+                return line
+
+    return None
+
+
 def find_input_line(name, input_lines):
     """
     Find the input line with the specified name.
@@ -1330,6 +1367,8 @@ def find_input_line(name, input_lines):
             try:
                 if line.props["name"] == name:
                     return line
+                if line.props["name"] + "_" + line.props["nameappend"] == name:
+                    return line
             except KeyError:
                 pass
 
@@ -1363,6 +1402,17 @@ def yocto_bsp_list_property_values(arch, property, scripts_path, properties_file
 
     properties = get_properties(input_lines)
 
+    nested_properties = split_nested_property(property)
+    if nested_properties:
+        # currently the outer property of a nested property always
+        # corresponds to an input line group
+        input_line_group = find_input_line_group(nested_properties[0], input_lines)
+        if input_line_group:
+            input_lines[:] = input_line_group.group[1:]
+            # The inner property of a nested property name is the
+            # actual property name we want, so reset to that
+            property = nested_properties[1]
+
     input_line = find_input_line(property, input_lines)
     if not input_line:
         print "Couldn't find values for property %s" % property
@@ -1376,6 +1426,8 @@ def yocto_bsp_list_property_values(arch, property, scripts_path, properties_file
     elif type == "choicelist" or type == "checklist":
         try:
             gen_fn = input_line.props["gen"]
+            if nested_properties:
+                context["filename"] = nested_properties[0]
             values_list = input_line.gen_choices_list(context, False)
         except KeyError:
             for choice in input_line.choices:
scripts/lib/bsp/kernel.py +1 -1
index b4e7fbf..360851b 100644
@@ -657,7 +657,7 @@ def find_giturl(context):
     bbs = glob.glob(bbglob)
     for kernel in bbs:
         filename = os.path.splitext(os.path.basename(kernel))[0]
-        if filename == filebase:
+        if filename in filebase:
             giturl = extract_giturl(kernel)
             return giturl
     
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/4 yocto-bsp: fix qemuarch test for xserver-xf86-config.bbappend

From: Tom Zanussi <[email protected]>

While testing the fix for [YOCTO #2222] I noticed that the qemuarch test was wrong - there is no 'x86' qemuarch, just 'i386'. Change the test to match.

---
 ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 rename "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"i386\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" (100%)
scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"i386\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend renamed from scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend +0 -0
similarity index 100%
rename from "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend"
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"i386\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend"
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 3/4 yocto-bsp: fix multi-provider error in qemu arch template

In reply to [email protected]

From: Tom Zanussi <[email protected]>

While testing the fix for [YOCTO #2222] I noticed a new build error that wasn't there in previous testing:

ERROR: Multiple .bb files are due to be built which each provide virtual/libgl

The build still completed and produced a good image, but an error message was displayed, which this patch removes.

---
 .../arch/qemu/conf/machine/{{=machine}}.conf       |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf +1 -0
index 003ead1..61ba842 100644
@@ -9,6 +9,7 @@ PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
 PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
 
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa-dri"
 
 {{ input type:"choicelist" name:"qemuarch" prio:"5" msg:"Which qemu architecture would you like to use?" default:"i386" }}
 {{ input type:"choice" val:"i386" msg:"i386    (32-bit)" }}
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 4/4 yocto-bsp: fix x86_64 tuning for qemu arch

In reply to [email protected]

From: Tom Zanussi <[email protected]>

While testing the fix for [YOCTO #2222] I noticed that the tuning for the qemu x86_64 target was using the wrong tuning file - it should be x86_64 instead of i586. Change the template to match.

---
 .../arch/qemu/conf/machine/{{=machine}}.conf       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf +1 -1
index 61ba842..0e4ecad 100644
@@ -20,7 +20,7 @@ PREFERRED_PROVIDER_virtual/libgl ?= "mesa-dri"
 {{ if qemuarch == "i386": }}
 require conf/machine/include/tune-i586.inc
 {{ if qemuarch == "x86_64": }}
-require conf/machine/include/tune-i586.inc
+require conf/machine/include/tune-x86_64.inc
 {{ if qemuarch == "arm": }}
 require conf/machine/include/tune-arm926ejs.inc
 {{ if qemuarch == "powerpc": }}
Signature · 1 line
1.7.0.4
#5 lore raw
In reply to [email protected]
Quoted 31 lines · On Thu, 2012-04-12 at 22:28 -0500, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This patchset fixes [YOCTO #2222], updating the property value listing code to match the current representation. The following combinations were tested (BSPs generated by yocto-bsp and sato images built and boot-tested):

- qemu i386 generated from JSON using the 3.2 kernel
- qemu arm generated from the text UI using the 3.2 kernel
- qemu x86-64 generated from JSON using the 3.0 kernel
- x86-64 generated from JSON using the 3.2 kernel
- i386 generated from text UI using the 3.0 kernel

Jessica Zhang has also verified that the propery value listing and BSP generation from JSON works for her in the Eclipse plugin.

There are also a few minor patches to the template files here that fix problems encountered when testing.

Please pull into poky/master.

Thanks,

Tom

The following changes since commit 6703173449ad21e1623ac75a66535cb2ed52aeeb:
Richard Purdie (1):
package_rpm.bbclass: Set tmppath for rpm to somewhere which won't conflict with the rootfs

are available in the git repository at:

Quoted 8 lines

git://git.yoctoproject.org/poky-contrib.git tzanussi/2222-fix
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/2222-fix

Tom Zanussi (4):
yocto-bsp: enable property value display of nested properties
yocto-bsp: fix qemuarch test for xserver-xf86-config.bbappend
yocto-bsp: fix multi-provider error in qemu arch template
yocto-bsp: fix x86_64 tuning for qemu arch

Merged to master, thanks.

Richard