<?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>15034</bug_id>
          
          <creation_ts>2023-02-16 12:46:32 +0000</creation_ts>
          <short_desc>When using USERADDEXTENSION = &quot;useradd-staticids&quot; swtpm recipe cause troubles on parsing</short_desc>
          <delta_ts>2024-02-09 08:50:53 +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>Other YP Layers</product>
          <component>meta-security</component>
          <version>4.1.4</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>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Piotr Łobacz">p.lobacz</reporter>
          <assigned_to name="akuster">akuster808</assigned_to>
          <cc>a.abfattah</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>94934</commentid>
    <comment_count>0</comment_count>
    <who name="Piotr Łobacz">p.lobacz</who>
    <bug_when>2023-02-16 12:46:32 +0000</bug_when>
    <thetext>As in subject when I&apos;m having useradd-staticids enabled I&apos;m getting error from swtpm recipe during parsing which looks like that:

ERROR: /work/build/yocto/meta-security/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb: argument -d/--home-dir: expected one argument

Temporary solution is to remove swtpm from recipes-tpm, which solves the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95630</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmed Abdelfattah">a.abfattah</who>
    <bug_when>2023-06-04 20:49:56 +0000</bug_when>
    <thetext>Hi Piotr

I am trying to investigate  so more info will be helpful from your side, i can suggest from the error message that there is possibly a typo as the error message suggests

A solution could be to pass a home-dir arg (e.g. /)

USERADD_PARAM:${PN} = &quot;--system -g ${TSS_GROUP} --home-dir / \
    --no-create-home  --shell /bin/false ${BPN}&quot;

instead of

USERADD_PARAM:${PN} = &quot;--system -g ${TSS_GROUP} --home-dir  \
    --no-create-home  --shell /bin/false ${BPN}&quot;


but I am not able to reproduce your compilation issue , i built both the security-build-image and security-tpm-image with both of the variants for useradd above



Here is my build configuration 

Build Configuration:
--------------------
BB_VERSION           = &quot;2.2.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;ubuntu-22.04&quot;
TARGET_SYS           = &quot;x86_64-poky-linux&quot;
MACHINE              = &quot;qemux86-64&quot;
DISTRO               = &quot;poky&quot;
DISTRO_VERSION       = &quot;4.1.4&quot;
TUNE_FEATURES        = &quot;m64 core2&quot;
TARGET_FPU           = &quot;&quot;
meta                 
meta-poky            
meta-yocto-bsp       = &quot;HEAD:3e95f268ce04b49ba6731fd4bbc53b1693c21963&quot;
meta-oe              = &quot;langdale:cbbaa82238cd60f08c9b9cb58dde59d5f9318c7b&quot;
meta-security        = &quot;langdale:a4562b19126ab655869da6db40e8eff49f84c490&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95641</commentid>
    <comment_count>2</comment_count>
    <who name="Piotr Łobacz">p.lobacz</who>
    <bug_when>2023-06-07 08:04:54 +0000</bug_when>
    <thetext>OK that fixed the problem for me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95642</commentid>
    <comment_count>3</comment_count>
    <who name="Piotr Łobacz">p.lobacz</who>
    <bug_when>2023-06-07 08:07:17 +0000</bug_when>
    <thetext>Question shall I make a patch for that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95645</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmed Abdelfattah">a.abfattah</who>
    <bug_when>2023-06-08 02:28:52 +0000</bug_when>
    <thetext>I will try to send a patch this weekend.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95646</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmed Abdelfattah">a.abfattah</who>
    <bug_when>2023-06-08 04:34:33 +0000</bug_when>
    <thetext>Actually I have just sent it out.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>