From a9c038b069661e6cd40e3e268719a1678d0dba65 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pavel.zhukov@huawei.com>
Date: Fri, 8 Jul 2022 21:08:21 +0200
Subject: [PATCH] oniro-image-*-tests: Exclude openssh complementary packages

oe-core recommends openssh-sftp-server since [1] this causes conflict
between openssh and dropbear when -tests image is building.
This happens because openssh-ptest is pulled in as complementary package
of openssh-sftp-server
Adding openssh to PACKAGE_EXCLUDE_COMPLEMENTARY excluded openssh from
the list. As a downside of this openssh-ptest,  -dev or -dbg packages
will not be installed using install_complementary and have to be
installed manually (IMAGE_INSTALL:append or similar).
Proper fix should go to oe-core (use -O flag to switch back to old scp
protocol if newer openssh server is used) however it's not clear if
openssh will keep this feature.

Upstream-Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14858

Fixes:
Error:
 Problem: problem with installed package dropbear-2020.81-r0.cortexa53_crypto
  - package dropbear-2020.81-r0.cortexa53_crypto conflicts with openssh provided by openssh-8.9p1-r0.cortexa53_crypto
  - package openssh-8.9p1-r0.cortexa53_crypto conflicts with dropbear provided by dropbear-2020.81-r0.cortexa53_crypto
  - package openssh-ptest-8.9p1-r0.cortexa53_crypto 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)

[1] https://git.openembedded.org/openembedded-core/commit/?id=a98188e83b2c027d99cc38e3367e1ec2a98efbb0

Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
---
 meta-oniro-core/recipes-core/images/oniro-image-extra-tests.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta-oniro-core/recipes-core/images/oniro-image-extra-tests.bb b/meta-oniro-core/recipes-core/images/oniro-image-extra-tests.bb
index 8a073a75..3d8d30e7 100644
--- a/meta-oniro-core/recipes-core/images/oniro-image-extra-tests.bb
+++ b/meta-oniro-core/recipes-core/images/oniro-image-extra-tests.bb
@@ -17,3 +17,6 @@ EXTRA_IMAGE_FEATURES:append = " ptest-pkgs debug-tweaks"
 # For testing purposes, we want to have an extra ext4 format for the root
 # filesystem.
 IMAGE_FSTYPES:append = " ext4"
+
+# Workaround for https://bugzilla.yoctoproject.org/show_bug.cgi?id=14858
+PACKAGE_EXCLUDE_COMPLEMENTARY:append = " openssh "
-- 
GitLab