[oe-commits] [openembedded-core] 10/14: package: check PKG_ variables before executing ontarget postinst

git at git.openembedded.org git at git.openembedded.org
Thu Jul 11 08:33:45 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit a6af0886d1be584974086c0ddb4a5bc566eb7984
Author: Bruce Ashfield <bruce.ashfield at xilinx.com>
AuthorDate: Fri Jul 5 12:14:05 2019 -0400

    package: check PKG_ variables before executing ontarget postinst
    If a package uses PKG_ variables to map package names to version specific
    variants, on target postinstall functionality will be broken.
    i.e. something like the following casuses rootfs assembly errors:
      d.setVar('pkg_postinst_ontarget_linux-source', 'cd /usr/src/; ln -sf %s linux-source' % source_pkg)
    This breakage is due to the fact that the original package name (as specified by
    the PACKAGES variable) is logged by the intercept scripts, but the mapped /
    specific version is actually installed to the rootfs (and hence logged by the
    package manager).
    When the runtime listing of on-target scripts is performed, we get a package
    manager error due to a missing package, since it checks the generic version
    logged by the intercept scripts.
    We can fix this by ensuring that the PKG_ variable mapped package name
    is logged by the intercept phase, and hence the package manager can locate
    and execute the on target postinst script.
    This variable check is consistent with other places in the code, and has
    no impact if PKG_ variables are not used.
    Signed-off-by: Bruce Ashfield <bruce.ashfield at xilinx.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/classes/package.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index b447153..8b89fb1 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1358,12 +1358,16 @@ python emit_pkgdata() {
     import json
     def process_postinst_on_target(pkg, mlprefix):
+        pkgval = d.getVar('PKG_%s' % pkg)
+        if pkgval is None:
+            pkgval = pkg
         defer_fragment = """
 if [ -n "$D" ]; then
     $INTERCEPT_DIR/postinst_intercept delay_to_first_boot %s mlprefix=%s
     exit 0
-""" % (pkg, mlprefix)
+""" % (pkgval, mlprefix)
         postinst = d.getVar('pkg_postinst_%s' % pkg)
         postinst_ontarget = d.getVar('pkg_postinst_ontarget_%s' % pkg)

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list