<?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>11460</bug_id>
          
          <creation_ts>2017-05-04 14:38:42 +0000</creation_ts>
          <short_desc>useradd postinst refers to recipe sysroot</short_desc>
          <delta_ts>2017-05-15 14:14:18 +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>core</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Maxin B. John">maxin.john</assigned_to>
          <cc>brian.avery</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73044</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-05-04 14:38:42 +0000</bug_when>
    <thetext>useradd.bbclass has this in useradd_preinst:

	export PSEUDO_PASSWD=&quot;$SYSROOT:${STAGING_DIR_NATIVE}&quot;

But with recipe-specific-sysroots the STAGING_DIR_NATIVE is in the *recipe* work directory, and may well not exist if the packages were taken from sstate or rm_work is enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73045</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-05-04 14:40:06 +0000</bug_when>
    <thetext>Concrete example: dbus pkg_preinst has this line:

export PSEUDO_PASSWD=&quot;$SYSROOT:/data/poky-master/tmp/work/corei7-64-poky-linux/dbus/1.10.14-r0/recipe-sysroot-native&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73166</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-05-10 16:01:28 +0000</bug_when>
    <thetext>which is used/called as part of -c populate_sdk_ext :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73178</commentid>
    <comment_count>3</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-05-10 20:12:05 +0000</bug_when>
    <thetext>Moving my comments from the duplicate bug I filed before finding this one and closing mine:.
My comments, moved:

The path to pseudo-native/usr/bin/pseudo used by useradd is populated from sstate. This means if the build dir is different from the build dir that was used to generate the sstate, the useradd command will fail. One place this happens is &quot;$bitbake &lt;image&gt; -c populate_sdk_ext&quot; . This tries to do a groupadd for dbus and fails. 

This bug is being opened by me for tracking/discussion, there is a patch already available that seems to fix it in my testing, from Peter Kjellerstedt .  His patch is https://patchwork.openembedded.org/series/6598/ .

His comments on the patch cover letter:
Similar to the problem with the hosttools directory and the state
cache that was recently fixed, there is another problem with the
sysroots-components directory. This only affects postinst-useradd
scripts, so in this case the fix can be activated from useradd.bbclass
rather than sstate.bbclass and thus affects a lot less recipes.

Also, from Jose: 
Bug 11497 created to add a test case for this scenario</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73180</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-05-10 20:13:28 +0000</bug_when>
    <thetext>*** Bug 11489 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73258</commentid>
    <comment_count>5</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-05-15 14:14:18 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=eb30ca2b316076e83e1a709015863670946d5bee</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>