diff mbox series

[v3] core-image.bbclass: Exclude openssh complementary packages

Message ID 20220905162447.22061-1-pavel@zhukoff.net
State Accepted, archived
Commit fa08030b32c2bf77889c23f964892f46e84994a3
Headers show
Series [v3] core-image.bbclass: Exclude openssh complementary packages | expand

Commit Message

Pavel Zhukov Sept. 5, 2022, 4:24 p.m. UTC
Openssh (main) package may be marked for installation via complementary
packages mechanism if sftp-server is installed
and this causes conflict with dropbear [Yocto #14858] [1].
Excluding openssh complementary packages if packagegroup-core-ssh-dropbear
is in PACKAGE_INSTALL fixes this issue.
To install openssh complementary packages in the images with
ssh-server-dropbear they may be added manually into the list because
they will be excluded from the installation even if corresonding class
(dev-pkg or dbg-pkgs) inherited.

[1]
Error:
 Problem: problem with installed package dropbear-2020.81-r0.core2_64
  - package dropbear-2020.81-r0.core2_64 conflicts with openssh provided by openssh-8.9p1-r0.core2_64
  - package openssh-8.9p1-r0.core2_64 conflicts with dropbear provided by dropbear-2020.81-r0.core2_64
  - package openssh-ptest-8.9p1-r0.core2_64 requires openssh, but none of the providers can be installed
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
---
 meta/classes-recipe/core-image.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/core-image.bbclass b/meta/classes-recipe/core-image.bbclass
index 4b5f2c99c4..90d9eb9d3f 100644
--- a/meta/classes-recipe/core-image.bbclass
+++ b/meta/classes-recipe/core-image.bbclass
@@ -62,6 +62,10 @@  FEATURE_PACKAGES_hwcodecs = "${MACHINE_HWCODECS}"
 # IMAGE_FEATURES_REPLACES_foo = 'bar1 bar2'
 # Including image feature foo would replace the image features bar1 and bar2
 IMAGE_FEATURES_REPLACES_ssh-server-openssh = "ssh-server-dropbear"
+# Do not install openssh complementary packages if either packagegroup-core-ssh-dropbear or dropbear
+# is installed # to avoid openssh-dropbear conflict
+# see [Yocto #14858] for more information
+PACKAGE_EXCLUDE_COMPLEMENTARY:append = "${@bb.utils.contains_any('PACKAGE_INSTALL', 'packagegroup-core-ssh-dropbear dropbear', 'openssh', '' , d)}"
 
 # IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2'
 # An error exception would be raised if both image features foo and bar1(or bar2) are included