<?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>7632</bug_id>
          
          <creation_ts>2015-04-20 13:24:54 +0000</creation_ts>
          <short_desc>ROOTFS_POSTPROCESS_COMMAND no longer accepts raw commands, just functions</short_desc>
          <delta_ts>2015-09-01 13:44:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Reference</product>
          <component>handbook</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>11 May 2015: RESOLVED</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.9 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Laszlo Papp">lpapp</reporter>
          <assigned_to name="Scott Rifenbark">srifenbark</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bluelightning</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>poky.doc.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>srifenbark</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50414</commentid>
    <comment_count>0</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2015-04-20 13:24:54 +0000</bug_when>
    <thetext>I am now in the process of updating our software stack from a dylan based solution to daisy. I have just happened to come through this issue during the process.

It seems that ROOTFS_POSTPROCESS_COMMAND no longer accepts raw commands as it used to. As a workaround, we need to wrap our commands into a function. One could argue that it is also better style, but still.

WARNING: Function mkdir /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/opt doesn&apos;t exist
WARNING: Function chown foo:foo /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/opt doesn&apos;t exist
WARNING: Function [ -d /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/tmp ] &amp;&amp; rmdir /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/tmp doesn&apos;t exist
WARNING: Function ln -s /var/tmp /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/tmp doesn&apos;t exist
WARNING: Function [ -d /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-linux-gnueabi/foo-core-image/1.0-r0/rootfs/run ] &amp;&amp; rmdir /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-gnueabi/polatis-core-image/1.0-r0/rootfs/run doesn&apos;t exist</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50433</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-21 08:51:14 +0000</bug_when>
    <thetext>As I said on IRC I&apos;m leaning towards this being a regression that we should fix rather than something we would note in the manual.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50766</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-05-04 21:19:09 +0000</bug_when>
    <thetext>Someone else should own this bug if we are going to treat it as a regression that should be fixed.  

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50777</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-05 09:08:23 +0000</bug_when>
    <thetext>I&apos;ve discussed this with Richard and he would prefer to leave the behaviour as-is, as with the change we now have the ability to call python functions, where that was not possible previously. So it turns out we really do need to change the documentation.

What this means is:

1) Change the variable entry for the following variables so that we note that it&apos;s expected to be a semicolon-separated list of *functions* to call and not arbitrary shell commands:

ROOTFS_PREPROCESS_COMMAND
ROOTFS_POSTPROCESS_COMMAND
SDK_POSTPROCESS_COMMAND
POPULATE_SDK_POST_TARGET_COMMAND
POPULATE_SDK_POST_HOST_COMMAND
IMAGE_POSTPROCESS_COMMAND
IMAGE_PREPROCESS_COMMAND
ROOTFS_POSTUNINSTALL_COMMAND
ROOTFS_POSTINSTALL_COMMAND

It appears that some of these are currently undocumented so we&apos;ll need to add them.

2) Somewhat late, but in the daisy migration notes we should mention this behaviour change so that anyone using them to port their metadata over will know what to do. This should mention that arbitrary shell commands simply need to be wrapped in a shell function when migrating.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50803</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-05-05 19:56:34 +0000</bug_when>
    <thetext>Hi, 

I will need some information for these variables.  I made some guesses as to how they work.  Please review them and let me know where I need to make corrections:

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-ROOTFS_PREPROCESS_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-ROOTFS_POSTPROCESS_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-SDK_POSTPROCESS_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-POPULATE_SDK_POST_TARGET_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-POPULATE_SDK_POST_HOST_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-IMAGE_POSTPROCESS_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-IMAGE_PREPROCESS_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-ROOTFS_POSTUNINSTALL_COMMAND

 * http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#var-ROOTFS_POSTINSTALL_COMMAND

I also updated the daisy migration notes with this:

 http://www.yoctoproject.org/docs/1.9/ref-manual/ref-manual.html#migration-1.6-variable-changes-variable-entry-behavior</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50804</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-05 21:39:42 +0000</bug_when>
    <thetext>* Can we replace &quot;Added by classes to run post processing commands&quot; with &quot;Specifies a list of functions to call&quot;?

* The entry for ROOTFS_PREPROCESS_COMMAND uses ROOTFS_POSTPROCESS_COMMAND in its example (copy-paste?)

* In some of the examples you have &quot;functions&quot; instead of &quot;function&quot;.

* &quot;which points to the root filesystem image&quot; -&gt; &quot;which points to the directory that will become the root filesystem image&quot;

* For ROOTFS_POSTUNINSTALL_COMMAND, can we extend &quot;has removed unnecessary packages&quot; with &quot;(when runtime package management is disabled in the image, several packages are removed including base-passwd, shadow and update-alternatives)&quot;.

* For IMAGE_PREPROCESS_COMMAND and IMAGE_POSTPROCESS_COMMAND, we need to be a bit clearer about when these run. I&apos;d suggest &quot;created the image&quot; -&gt; &quot;created the final image output files&quot; or similar.

* For the migration entry: as I said above we need to mention for migration purposes that arbitrary shell commands simply need to be wrapped in a shell function when migrating, e.g.:

my_postprocess_function() {
   echo &quot;hello&quot; &gt; ${IMAGE_ROOTFS}/hello.txt
}
ROOTFS_POSTPROCESS_COMMAND += &quot;my_postprocess_function; &quot;

* Also on the migration entry, can we rename it from &quot;Variable Entry Behavior&quot; to something more specific such as &quot;Preprocess / Postprocess Command Variable Behaviour&quot; ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50805</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-05-05 23:04:35 +0000</bug_when>
    <thetext>Hi, 

I have implemented Paul&apos;s changes.  I will leave in IN PROGRESS REVIEW for a while longer.

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50847</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-07 13:29:52 +0000</bug_when>
    <thetext>Looks good, I think we&apos;re probably done - thanks. Could you also please update the 1.8 manuals to include these changes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50891</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-05-11 13:33:44 +0000</bug_when>
    <thetext>Updated for fido branch last week.  I have marked as RESOLVED and set the doc flag to &quot;done.&quot; 

Thanks 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53597</commentid>
    <comment_count>9</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-09-01 13:44:26 +0000</bug_when>
    <thetext>verified</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>