Skip to contentSkip to conversation

Resolve conflict between /usr/bin/hello from lmbench and mbedtls

PATCH In review Denys Dmytriyenko 2 participants 5 messages Feb 25, 2023 – Feb 28, 2023

lore
Share & tools
lore
#0 lore raw

cover Resolve conflict between /usr/bin/hello from lmbench and mbedtls

Both lmbench and mbedtls packages provide generically-named /usr/bin/hello binary, which causes a conflict when trying to install them both into a rootfs or SDK. Set up alternative providers to resolve the conflict.

Denys Dmytriyenko (2):
lmbench: set up /usr/bin/hello as alternative
mbedtls: set up /usr/bin/hello as alternative

 .../recipes-connectivity/mbedtls/mbedtls_2.28.2.bb           | 5 ++++-
 meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb          | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 lmbench: set up /usr/bin/hello as alternative

As lmbench installs this rather generically-named /usr/bin/hello binary, it conflicts with the one provided by mbedtls, hence set it up as an alternative to avoid conflicts when both are installed to rootfs or SDK.

---
 meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb +2 -2
index d74c28f3f..03018bb52 100644
@@ -99,6 +99,6 @@ pkg_postinst:${PN} () {
 RDEPENDS:${PN} = "perl"
 FILES:${PN} += "${datadir}/lmbench"
 
-ALTERNATIVE:${PN} = "stream"
+ALTERNATIVE:${PN} = "stream hello"
 ALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream"
-
+ALTERNATIVE_LINK_NAME[hello] = "${bindir}/hello"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 mbedtls: set up /usr/bin/hello as alternative

In reply to Denys Dmytriyenko

As mbedtls installs this rather generically-named /usr/bin/hello binary, it conflicts with the one provided by lmbench, hence set it up as an alternative to avoid conflicts when both are installed to rootfs or SDK.

---
 .../recipes-connectivity/mbedtls/mbedtls_2.28.2.bb           | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb +4 -1
index f5f1236f1..e19587ca0 100644
@@ -26,7 +26,7 @@ S = "${WORKDIR}/git"
 SRCREV = "89f040a5c938985c5f30728baed21e49d0846a53"
 SRC_URI = "git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=mbedtls-2.28"
 
-inherit cmake
+inherit cmake update-alternatives
 
 PACKAGECONFIG ??= "shared-libs programs"
 PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-DUSE_SHARED_MBEDTLS_LIBRARY=OFF"
@@ -47,6 +47,9 @@ RPROVIDES:${PN} = "polarssl"
 PACKAGES =+ "${PN}-programs"
 FILES:${PN}-programs = "${bindir}/"
 
+ALTERNATIVE:${PN}-programs = "hello"
+ALTERNATIVE_LINK_NAME[hello] = "${bindir}/hello"
+
 BBCLASSEXTEND = "native nativesdk"
 
 CVE_PRODUCT = "mbed_tls"
Signature · 1 line
2.25.1
#3 lore raw
In reply to Denys Dmytriyenko
Quoted 4 lines · Denys Dmytriyenko via lists.openembedded.org

Both lmbench and mbedtls packages provide generically-named /usr/bin/hello binary, which causes a conflict when trying to install them both into a rootfs or SDK. Set up alternative providers to resolve the conflict.

Are either of these binaries actually useful? The, well, alternative is to just delete them stupidly named binaries (or rename).

Ross

#4 lore raw
Quoted 8 lines · Ross Burton
Quoted 4 lines · Denys Dmytriyenko via lists.openembedded.org

Both lmbench and mbedtls packages provide generically-named /usr/bin/hello binary, which causes a conflict when trying to install them both into a rootfs or SDK. Set up alternative providers to resolve the conflict.

Are either of these binaries actually useful? The, well, alternative is to just delete them stupidly named binaries (or rename).

My assumption is that at least lmbench is using this binary for some testing or benchmarking. But I haven't looked very deep into it. Plus I wanted to get this backported to Kirkstone, so the least invasive approach made more sense.

Signature · 1 line
Denys