diff options
author | Andrey Konovalov <andrey.konovalov@linaro.org> | 2020-08-13 23:36:08 +0300 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-08-13 22:37:48 -0700 |
commit | bbf746857d102eca913ae200cb53f8dee563acd8 (patch) | |
tree | 25772915f4164a4d5e4806adc9e62965fbe21dad /meta-multimedia | |
parent | 98991b2e0fae9d07b17c504a7dd4a9f32ad07a0b (diff) | |
download | meta-openembedded-bbf746857d102eca913ae200cb53f8dee563acd8.tar.gz |
libcamera: fix packaging and installation
libcamera checks if RPATH or RUNPATH dynamic tag is present in
libcamera.so. 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 libcamera.so 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 <andrey.konovalov@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
-rw-r--r-- | meta-multimedia/recipes-multimedia/libcamera/libcamera.bb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb index af2d3b4e1..c66c93ec5 100644 --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb | |||
@@ -18,13 +18,30 @@ PV = "202006+git${SRCPV}" | |||
18 | 18 | ||
19 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
20 | 20 | ||
21 | DEPENDS = "python3-pyyaml-native udev gnutls boost" | 21 | DEPENDS = "python3-pyyaml-native udev gnutls boost chrpath-native" |
22 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}" | 22 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}" |
23 | 23 | ||
24 | RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}" | 24 | RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}" |
25 | 25 | ||
26 | inherit meson pkgconfig python3native | 26 | inherit meson pkgconfig python3native |
27 | 27 | ||
28 | do_install_append() { | ||
29 | chrpath -d ${D}${libdir}/libcamera.so | ||
30 | } | ||
31 | |||
32 | addtask do_recalculate_ipa_signatures_package after do_package before do_packagedata | ||
33 | do_recalculate_ipa_signatures_package() { | ||
34 | local modules | ||
35 | for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do | ||
36 | module="${module%.sign}" | ||
37 | if [ -f "${module}" ] ; then | ||
38 | modules="${modules} ${module}" | ||
39 | fi | ||
40 | done | ||
41 | |||
42 | ${S}/src/ipa/ipa-sign-install.sh ${B}/src/ipa-priv-key.pem "${modules}" | ||
43 | } | ||
44 | |||
28 | FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig" | 45 | FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig" |
29 | FILES_${PN} += " ${libdir}/libcamera.so" | 46 | FILES_${PN} += " ${libdir}/libcamera.so" |
30 | 47 | ||