<?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>14616</bug_id>
          
          <creation_ts>2021-11-05 22:44:32 +0000</creation_ts>
          <short_desc>pkg_postinst_${PN}_append doesn&apos;t always append</short_desc>
          <delta_ts>2026-05-28 15:17:35 +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>oe-core other</component>
          <version>3.2.5</version>
          <rep_platform>Other</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>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Burr">Michael.Burr</reporter>
          <assigned_to name="Aníbal Limón">anibal</assigned_to>
          <cc>anibal</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</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>91894</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Burr">Michael.Burr</who>
    <bug_when>2021-11-05 22:44:32 +0000</bug_when>
    <thetext>Try appending the post-install script for wpa_supplicant in a &quot;wpa_supplicant_%.bbappend&quot; file, like this:

pkg_postinst_${PN}_append () { ... }

At least in my case, it caused a warning of this form:

WARNING: Variable key pkg_postinst_${PN} (...) replaces original key pkg_postinst_wpa-supplicant (...).

The warning is correct, insofar as wpa_supplicant already has a post-install script in its main recipe, and the outcome in the WORKDIR seems to be that it was overwritten instead of appended.

On the other hand, the following worked as expected, and eliminated the warning too:

pkg_postinst_wpa-supplicant_append () { ... }

Not sure if it&apos;s relevant, but the main recipe itself does _not_ use ${PN}: it rather writes in the name explicitly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91912</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-11-08 21:50:59 +0000</bug_when>
    <thetext>When you write such an append you do need to write the append in the form the recipe had written in in so this is really expected. It can be problematic which is why the code throws the warning if something happened where bitbake thinks the wrong thing may have happened. I appreciate this isn&apos;t ideal but we&apos;ve struggled to come up with anything better than showing the warning.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91913</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Burr">Michael.Burr</who>
    <bug_when>2021-11-08 22:13:47 +0000</bug_when>
    <thetext>Thank you very much for the reply!

Could I suggest one (or more) of the following possible mitigations?

1. Change the main wpa_supplicant.bb recipe so it uses ${PN} instead of the explicit name (assuming the former is considered the &apos;right&apos; or better way).

2. Make the language of the warning more specific, so that basically it tells the user what you just told me, if it can detect this particular situation. (Since the solution wasn&apos;t at all obvious, and I only found it with a lucky guess.)

3. Improve documentation about this (non-obvious) requirement for appending post-install scripts.

Although: is this a more a general thing, that is documented elsewhere and maybe I should&apos;ve known it? Is it true that *any* BB task or function can only be successfully appended with exactly the same name (i.e. no expansion takes place when trying to match the function name)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91978</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-11-11 17:16:28 +0000</bug_when>
    <thetext>I&apos;ve sent out a patch for 1). The language in the warning is tricky since it is generic code, it can&apos;t be specific to a specific use case. For 3), I&apos;ll reassign this bug to documentation in case they can see how to better document the issue.

(The issue is that package overrides should match the form used in PACKAGES.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99993</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-10-24 15:03:54 +0000</bug_when>
    <thetext>Bulk move of 5.1 M4 to 5.2 M2 as approved by AlexB.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102183</commentid>
    <comment_count>5</comment_count>
    <who name="Antonin Godard">antonin.godard</who>
    <bug_when>2025-06-06 07:42:30 +0000</bug_when>
    <thetext>Bulk move of bugs I am assigned to from Milestone 5.2M4 to 5.3M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105655</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-05-28 15:17:35 +0000</bug_when>
    <thetext>Issue 1) that Michael identified has been fixed.
The other two issues are not tractable for reasons explained in comments.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>