]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base.bbclass: add handling package exclusions to do_populate_sdk
authorYi Zhao <yi.zhao@windriver.com>
Fri, 11 Aug 2017 01:30:43 +0000 (09:30 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Aug 2017 23:01:39 +0000 (00:01 +0100)
There is an error for populate_sdk when we exclude package by using
PACKAGE_EXCLUDE.

Reproduced steps:
echo "PACKAGE_EXCLUDE = \"psplash\"" >> conf/local.conf
bitbake core-image-sato -c populate_sdk

Error log:
ERROR: core-image-sato-1.0-r0 do_populate_sdk: Could not invoke dnf.
Command '/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/recipe-sysroot-native/usr/bin/dnf -y -c
/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/sdk/image/opt/poky/2.3/sysroots/i586-poky-linux/etc/dnf/dnf.conf
--setopt=reposdir=/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/sdk/image/opt/poky/2.3/sysroots/i586-poky-linux/etc/yum.repos.d
--repofrompath=oe-repo,/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/oe-rootfs-repo
--installroot=/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/sdk/image/opt/poky/2.3/sysroots/i586-poky-linux
--setopt=logdir=/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/temp
-x psplash --nogpgcheck install run-postinsts dnf
packagegroup-core-x11-base packagegroup-core-ssh-dropbear
packagegroup-core-standalone-sdk-target packagegroup-base-extended
packagegroup-core-x11-sato psplash packagegroup-core-boot rpm' returned 1:
Unable to detect release version (use '--releasever' to specify release version)
Added oe-repo repo from
/buildarea1/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/oe-rootfs-repo
Last metadata expiration check: 0:00:00 ago on Thu 10 Aug 2017 09:26:32 AM UTC.
No package psplash available.
Error: Unable to find a match

Add handling package exclusions to do_populate_sdk. The code copies from
do_rootfs in image.bbclass.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass

index 0354ee1ab377aee721a01f632a0eba1e2d7e59ae..424c63cbfcb3d286db60de5c6a871459594387d7 100644 (file)
@@ -101,6 +101,26 @@ def populate_sdk_common(d):
     from oe.sdk import populate_sdk
     from oe.manifest import create_manifest, Manifest
 
+    # Handle package exclusions
+    excl_pkgs = (d.getVar("PACKAGE_EXCLUDE") or "").split()
+    inst_pkgs = (d.getVar("PACKAGE_INSTALL") or "").split()
+    inst_attempt_pkgs = (d.getVar("PACKAGE_INSTALL_ATTEMPTONLY") or "").split()
+
+    d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
+    d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
+
+    for pkg in excl_pkgs:
+        if pkg in inst_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s).  It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+            inst_pkgs.remove(pkg)
+
+        if pkg in inst_attempt_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s).  It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+            inst_attempt_pkgs.remove(pkg)
+
+    d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+    d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
+
     pn = d.getVar('PN')
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)