<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2222</bug_id>
          
          <creation_ts>2012-04-01 06:52:56 +0000</creation_ts>
          <short_desc>[yocto-bsp] fails to create bsp with json file</short_desc>
          <delta_ts>2012-04-23 07:42:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(1.2)(patch submitted for review)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          <blocked>1610</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jiajun Xu">jiajun.xu</reporter>
          <assigned_to name="Tom Zanussi">tom.zanussi</assigned_to>
          <cc>hongnax.xu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>lianhao.lu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>19772</commentid>
    <comment_count>0</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2012-04-01 06:52:56 +0000</bug_when>
    <thetext>tree/branch: poky/1.2 M4
commit: da6233ea034f35eff59306fdad31f318c340c359

With 1.2 M4, I could create bsp layer with yocto-bsp command by manual. If I use a predefined json file with parameters defined, it will report error as below:
###########

Traceback (most recent call last):
  File &quot;/home/jxu49/osel/m4/scripts/yocto-bsp&quot;, line 137, in &lt;module&gt;
    ret = main()
  File &quot;/home/jxu49/osel/m4/scripts/yocto-bsp&quot;, line 132, in main
    invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands)
  File &quot;/home/jxu49/osel/m4/scripts/lib/bsp/help.py&quot;, line 73, in invoke_subcommand
    subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
  File &quot;/home/jxu49/osel/m4/scripts/yocto-bsp&quot;, line 76, in yocto_bsp_create_subcommand
    yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file)
  File &quot;/home/jxu49/osel/m4/scripts/lib/bsp/engine.py&quot;, line 1244, in yocto_bsp_create
    run_program_lines(program_lines, codedump)
  File &quot;&lt;string&gt;&quot;, line 287
     of.write(&quot;\n&quot;)
###########

The file I used for testing as below:
##########
{&quot;kernel_choice&quot;:&quot;linux-yocto_3.2&quot;,&quot;use_default_kernel&quot;:&quot;n&quot;,&quot;keyboard&quot;:&quot;y&quot;,&quot;qemuarch&quot;:&quot;x86&quot;,&quot;smp_linux_yocto_3_2&quot;:&quot;y&quot;,&quot;touchscreen&quot;:&quot;n&quot;,&quot;new_kbranch_linux_yocto_3_2&quot;:&quot;y&quot;,&quot;base_kbranch_linux_yocto_3_2&quot;:&quot;standard\/default\/base&quot;}
##########</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20131</commentid>
    <comment_count>1</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2012-04-10 14:43:42 +0000</bug_when>
    <thetext>These json properties were from an earlier version of yocto-bsp - some details were changed in the committed version and those properties will no longer work.

Specifically, some properties that previously were uniquely named no longer are, such as new_kbranch_linux_yocto_3_2, which is now just new_kbranch, but nonetheless still need to be qualified in order to be set.  The same thing is the case for listing specific property values.

I need to update the interface in both these cases to allow for arbitrary nesting of properties using a dot notation in the properties themselves e.g.

linux_yocto_2.3.new_kbranch

Until this is changed, the JSON interface won&apos;t work for some properties such as in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20199</commentid>
    <comment_count>2</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2012-04-11 19:50:20 +0000</bug_when>
    <thetext>The following branch contains a fix for this bug, which also fixes the support for &apos;yocto-bsp list property&apos; (see details below).

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

I won&apos;t submit it until Jessica verifies that it supplies what she needs for the ADT integration.

I tested it with the following new JSON file:

{&quot;kernel_choice&quot;:&quot;linux-yocto_3.2&quot;,&quot;use_default_kernel&quot;:&quot;n&quot;,&quot;keyboard&quot;:&quot;y&quot;,&quot;qemuarch&quot;:&quot;i386&quot;,&quot;smp&quot;:&quot;y&quot;,&quot;touchscreen&quot;:&quot;n&quot;,&quot;need_new_kbranch&quot;:&quot;y&quot;,&quot;new_kbranch&quot;:&quot;standard/default/base&quot;}

The new &apos;yocto-bsp list property&apos; support accounts for the change in the way variables are named.  Looking at the output of &apos;yocto-bsp list properties&apos; you see that some input properties are contained within a top-level &apos;property&apos;.  For example, the &apos;new_kbranch&apos; input property is contained within the &quot;if kernel_choice == &quot;linux-yocto-rt_3.0&quot;:&quot; &apos;property&apos;.  Similarly, the same-named &apos;new_kbranch&apos; property is also listed under other &quot;if kernel_choice == ...&quot; properties.

&quot;if kernel_choice == &quot;linux-yocto-rt_3.0&quot;:&quot; : {
    &quot;smp&quot; : {
        &quot;default&quot; : y
        &quot;msg&quot; : Do you need SMP support? (y/n)
        &quot;type&quot; : boolean
        &quot;prio&quot; : 30
        &quot;filename&quot; : /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == &quot;linux-yocto-rt_3.0&quot;: }} linux-yocto-rt_3.0.bbappend
    }
    &quot;new_kbranch&quot; : {
        &quot;prio&quot; : 20
        &quot;default&quot; : yocto/standard/preempt-rt
        &quot;nameappend&quot; : mips
        &quot;filename&quot; : /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == &quot;linux-yocto-rt_3.0&quot;: }} linux-yocto-rt_3.0.bbappend
        &quot;msg&quot; : Please choose a machine branch to base this BSP on:
        &quot;type&quot; : choicelist
        &quot;gen&quot; : bsp.kernel.all_branches
    }

&quot;if kernel_choice == &quot;linux-yocto_3.2&quot;:&quot; : {
    &quot;smp&quot; : {
        &quot;default&quot; : y
        &quot;msg&quot; : Do you need SMP support? (y/n)
        &quot;type&quot; : boolean
        &quot;prio&quot; : 30
        &quot;filename&quot; : /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == &quot;linux-yocto_3.2&quot;: }} linux-yocto_3.2.bbappend
    }
    &quot;new_kbranch&quot; : {
        &quot;prio&quot; : 20
        &quot;default&quot; : standard/default
        &quot;nameappend&quot; : mips
        &quot;filename&quot; : /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == &quot;linux-yocto_3.2&quot;: }} linux-yocto_3.2.bbappend
        &quot;msg&quot; : Please choose a machine branch to base this BSP on:
        &quot;type&quot; : choicelist
        &quot;gen&quot; : bsp.kernel.all_branches
    }

In order to allow the contained properties to be specified unambiguously, the standard &apos;.&apos; notation used in JSON is supported.  For example:

$ yocto-bsp list i386 property &quot;if kernel_choice == \&quot;linux-yocto-rt_3.2\&quot;.new_kbranch

To make it easier to use, a subset of the top-level property can be specified instead (it will return the first match, so should be unique, which the full string always would be, but here specifying just the kernel name is too):

$ yocto-bsp list i386 property \&quot;linux-yocto-rt_3.2\&quot;.new_kbranch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20200</commentid>
    <comment_count>3</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2012-04-11 19:54:28 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; The following branch contains a fix for this bug, which also fixes the support
&gt; for &apos;yocto-bsp list property&apos; (see details below).
&gt; 
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/2222-fix
&gt; 
&gt; I won&apos;t submit it until Jessica verifies that it supplies what she needs for
&gt; the ADT integration.
&gt; 
&gt; I tested it with the following new JSON file:
&gt; 
&gt; {&quot;kernel_choice&quot;:&quot;linux-yocto_3.2&quot;,&quot;use_default_kernel&quot;:&quot;n&quot;,&quot;keyboard&quot;:&quot;y&quot;,&quot;qemuarch&quot;:&quot;i386&quot;,&quot;smp&quot;:&quot;y&quot;,&quot;touchscreen&quot;:&quot;n&quot;,&quot;need_new_kbranch&quot;:&quot;y&quot;,&quot;new_kbranch&quot;:&quot;standard/default/base&quot;}
&gt; 
&gt; The new &apos;yocto-bsp list property&apos; support accounts for the change in the way
&gt; variables are named.  Looking at the output of &apos;yocto-bsp list properties&apos; you
&gt; see that some input properties are contained within a top-level &apos;property&apos;. 
&gt; For example, the &apos;new_kbranch&apos; input property is contained within the &quot;if
&gt; kernel_choice == &quot;linux-yocto-rt_3.0&quot;:&quot; &apos;property&apos;.  Similarly, the same-named
&gt; &apos;new_kbranch&apos; property is also listed under other &quot;if kernel_choice == ...&quot;
&gt; properties.
&gt; 
&gt; &quot;if kernel_choice == &quot;linux-yocto-rt_3.0&quot;:&quot; : {
&gt;     &quot;smp&quot; : {
&gt;         &quot;default&quot; : y
&gt;         &quot;msg&quot; : Do you need SMP support? (y/n)
&gt;         &quot;type&quot; : boolean
&gt;         &quot;prio&quot; : 30
&gt;         &quot;filename&quot; :
&gt; /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{
&gt; if kernel_choice == &quot;linux-yocto-rt_3.0&quot;: }} linux-yocto-rt_3.0.bbappend
&gt;     }
&gt;     &quot;new_kbranch&quot; : {
&gt;         &quot;prio&quot; : 20
&gt;         &quot;default&quot; : yocto/standard/preempt-rt
&gt;         &quot;nameappend&quot; : mips
&gt;         &quot;filename&quot; :
&gt; /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{
&gt; if kernel_choice == &quot;linux-yocto-rt_3.0&quot;: }} linux-yocto-rt_3.0.bbappend
&gt;         &quot;msg&quot; : Please choose a machine branch to base this BSP on:
&gt;         &quot;type&quot; : choicelist
&gt;         &quot;gen&quot; : bsp.kernel.all_branches
&gt;     }
&gt; 
&gt; &quot;if kernel_choice == &quot;linux-yocto_3.2&quot;:&quot; : {
&gt;     &quot;smp&quot; : {
&gt;         &quot;default&quot; : y
&gt;         &quot;msg&quot; : Do you need SMP support? (y/n)
&gt;         &quot;type&quot; : boolean
&gt;         &quot;prio&quot; : 30
&gt;         &quot;filename&quot; :
&gt; /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{
&gt; if kernel_choice == &quot;linux-yocto_3.2&quot;: }} linux-yocto_3.2.bbappend
&gt;     }
&gt;     &quot;new_kbranch&quot; : {
&gt;         &quot;prio&quot; : 20
&gt;         &quot;default&quot; : standard/default
&gt;         &quot;nameappend&quot; : mips
&gt;         &quot;filename&quot; :
&gt; /usr/local/dev/yocto/yocto-bsp-fix/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{
&gt; if kernel_choice == &quot;linux-yocto_3.2&quot;: }} linux-yocto_3.2.bbappend
&gt;         &quot;msg&quot; : Please choose a machine branch to base this BSP on:
&gt;         &quot;type&quot; : choicelist
&gt;         &quot;gen&quot; : bsp.kernel.all_branches
&gt;     }
&gt; 
&gt; In order to allow the contained properties to be specified unambiguously, the
&gt; standard &apos;.&apos; notation used in JSON is supported.  For example:
&gt; 
&gt; $ yocto-bsp list i386 property &quot;if kernel_choice ==
&gt; \&quot;linux-yocto-rt_3.2\&quot;.new_kbranch
&gt; 
&gt; To make it easier to use, a subset of the top-level property can be specified
&gt; instead (it will return the first match, so should be unique, which the full
&gt; string always would be, but here specifying just the kernel name is too):
&gt; 
&gt; $ yocto-bsp list i386 property \&quot;linux-yocto-rt_3.2\&quot;.new_kbranch

Just one note that I forgot - because the property separator is &apos;.&apos;, if you have a portion of the property that itself contains a &apos;.&apos;, you need to put that part of it in double quotes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20201</commentid>
    <comment_count>4</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2012-04-11 21:40:43 +0000</bug_when>
    <thetext>Modified Eclipse plug-in according to the latest changes and everything works, from query property value to using JSON file create BSP</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20386</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-04-14 22:01:22 +0000</bug_when>
    <thetext>Fixed in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=6f527e23e045fd948fddf6775705f4f7f7feefd6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20807</commentid>
    <comment_count>6</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2012-04-23 07:42:25 +0000</bug_when>
    <thetext>I tested denzil branch that the bug is fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>