<?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>6704</bug_id>
          
          <creation_ts>2014-09-10 15:04:39 +0000</creation_ts>
          <short_desc>wic: bootimg_dir lost to source plugins when auto detecting</short_desc>
          <delta_ts>2014-12-11 23:23:52 +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>OE-Core</product>
          <component>deployment</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ola Nilsson">ola.x.nilsson</reporter>
          <assigned_to name="Tom Zanussi">tom.zanussi</assigned_to>
          <cc>ola.x.nilsson</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>45519</commentid>
    <comment_count>0</comment_count>
    <who name="Ola Nilsson">ola.x.nilsson</who>
    <bug_when>2014-09-10 15:04:39 +0000</bug_when>
    <thetext>WIC autodetects the bootimg_dir as the value of HDDDIR.  On the way to the source plugin this value is lost. 

lib/wic/engine.py - find_artefacts detects hdddir as the value of the HDDDIR variable.  There is no autodetect for bootimg_dir. It can be defined on the command line but only if -e is not used.

Both values are passed to wic_create.

wic_create passes both values to Creator.main

Via some convoluted cmdln and plugin handling all of Creator.mains arguments end up in DirectPlugin.do_create, which passes them to DirectImageCreator.

DirectImageCreator&apos;s destructor stores them in member variables bootimg_dir and hdddir. 

The DirectImageCreator._create function seems to be the culprit as it passes self.bootimg_dir to Wic_PartData.prepare.  This seems logical as that is the name of the parameter.  But when the -e flag is used on the commandline the bootimg_dir variable is empty at this point, which is why the bootimg_efi source plugin has to look up the HDDDIR from a bitbake variable. 

It is hard for me to say what is &apos;right&apos; in this situation.  The HDDDIR variable seems very specific to a certain type of system while the bootimg_dir is more general.  On the other hand there is no way to autodetect the bootimg_dir at the moment. And if HDDDIR is the correct variable then its value has to be passed along all the way to the source plugin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47536</commentid>
    <comment_count>1</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2014-12-11 23:23:52 +0000</bug_when>
    <thetext>I believe the following patch changes things so that this should no longer be a concern.  Basically bootimg_dir now only refers to the bootimg_dir defined on the command line, if specified, otherwise plugins are responsible for finding the bootimg_dir they need otherwise e.g HDDDIR or whatever.

commit 42d0334aa8bf59937262f957f2ea04abc271138b
Author: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Date:   Wed Oct 29 17:04:23 2014 -0500

    wic: Remove special-case bootimg_dir

    The first iterations of wic very shortsightedly catered to two
    specific use-cases and added special-purpose params for those cases so
    that they could be directly given their corresponding boot artifacts.
    (hdddir and staging_data_dir).
    
    As more use-cases are added, it becomes rather obvious that such a
    scheme doens&apos;t scale, and additionally causes confusion for plugin
    writers.
    
    This removes those special cases and states explicitly in the help
    text that plugins are responsible for locating their own boot
    artifacts.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>