All of
 help / color / mirror / Atom feed
From: "Andrey Konovalov" <>
	Andrey Konovalov <>
Subject: [meta-multimedia][PATCH v2] libcamera: fix packaging and installation
Date: Fri, 31 Jul 2020 17:39:19 +0300	[thread overview]
Message-ID: <> (raw)

libcamera checks if RPATH or RUNPATH dynamic tag is present in If it does, it assumes that libcamera binaries are
run directly from the build directory without installing them, and
tries to use resorces like IPA modules from the build directory.
Mainline meson strips RPATH/RUNPATH out from file
at install time. But openembedded-core patches meson to disable
RPATH/RUNPATH removal. That's why  we need to remove this tag manually
in do_install_append().

IPA module is signed (with openssl dgst) after it is built. But
during packaging the OE build system 1) splits out debugging info,
and 2) strips the binaries. So the IPA module so file installed
isn't the one which the signature was calculated against. Then
the signature check fails, and libcamera tries to run the IPA
module isolated (in a sandbox), which doesn't work if the IPA
module wasn't designed to run isolated. The solution is to
recalculate the IPA modules signatures in ${PKGD} after do_package().

Signed-off-by: Andrey Konovalov <>
 Changes in v2:
  - Recalculate the IPA modules signatures after do_package()
    instead of disabling stripping and splitting libcamera package

 .../recipes-multimedia/libcamera/     | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta-multimedia/recipes-multimedia/libcamera/ b/meta-multimedia/recipes-multimedia/libcamera/
index 00a5c480d..30c6600e5 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/
+++ b/meta-multimedia/recipes-multimedia/libcamera/
@@ -18,13 +18,26 @@ PV = "202006+git${SRCPV}"
 S = "${WORKDIR}/git"
-DEPENDS = "python3-pyyaml-native udev gnutls boost"
+DEPENDS = "python3-pyyaml-native udev gnutls boost chrpath-native"
 DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}"
 RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}"
 inherit meson pkgconfig python3native
+do_install_append() {
+    chrpath -d ${D}${libdir}/
+addtask do_recalculate_ipa_signatures_package after do_package before do_packagedata
+do_recalculate_ipa_signatures_package() {
+    for module in $(find "${PKGD}/usr/lib/libcamera" -name "*.so.sign"); do
+        if [ -f "${module%.sign}" ] ; then
+            "${S}/src/ipa/" "${B}/src/ipa-priv-key.pem" "${module%.sign}" "${module}"
+        fi
+    done
 FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig"
 FILES_${PN} += " ${libdir}/"

             reply	other threads:[~2020-07-31 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 14:39 Andrey Konovalov [this message]
2020-08-01 13:01 ` [libcamera-devel] " Laurent Pinchart
2020-08-02 19:04   ` Andrey Konovalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [meta-multimedia][PATCH v2] libcamera: fix packaging and installation' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.