{"id":9133,"url":"https://patchwork.libcamera.org/api/patches/9133/?format=json","web_url":"https://patchwork.libcamera.org/patch/9133/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200802190719.9358-1-andrey.konovalov@linaro.org>","date":"2020-08-02T19:07:19","name":"[libcamera-devel,meta-multimedia,v3] libcamera: fix packaging and installation","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d9a9f88b5fef27bcbe5cd47f3fdb2501b40ab62b","submitter":{"id":25,"url":"https://patchwork.libcamera.org/api/people/25/?format=json","name":"Andrey Konovalov","email":"andrey.konovalov@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9133/mbox/","series":[{"id":1176,"url":"https://patchwork.libcamera.org/api/series/1176/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1176","date":"2020-08-02T19:07:19","name":"[libcamera-devel,meta-multimedia,v3] libcamera: fix packaging and installation","version":3,"mbox":"https://patchwork.libcamera.org/series/1176/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9133/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9133/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 60B4FBD87A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  2 Aug 2020 19:07:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F388160999;\n\tSun,  2 Aug 2020 21:07:40 +0200 (CEST)","from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B43A960393\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  2 Aug 2020 21:07:39 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id v12so7088303ljc.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 02 Aug 2020 12:07:39 -0700 (PDT)","from localhost.localdomain (37-144-159-139.broadband.corbina.ru.\n\t[37.144.159.139]) by smtp.googlemail.com with ESMTPSA id\n\te29sm1289126ljp.136.2020.08.02.12.07.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 02 Aug 2020 12:07:38 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"wVRMe7+Q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id;\n\tbh=gffvLB+WlAnYBdMss2eSA+WIA4DrPKNvIyVac0+f32Y=;\n\tb=wVRMe7+QYyf+VYuYRbo5a7YRL633rfhrWcBkKbMh6HRq1mBZmQ8S48POOfXjB3y2dQ\n\tWouYwYSAYuIOdZpLC2ZTqmn3q+rVRQ22apYzKhtf2CEiXqDWcUEiobqfsPVSNrgebHvJ\n\tEAQjSiyGQZnYZM/yp2EnWashLJf7kjcauppBV7wY8eHy8Y+xQdPcsic5JdX9P+yVH/yt\n\tHGpUxTe3MDuwYwAzO86wNfEAwjv0+IpCdOz0bX1Fhh7N9qhk/zbyRN02pWCizWSS4vGK\n\tVoSZcTfrlCVp33WVxm6P6MNNHZJZOOtY4XK2ytSF4D8+PGpK3l9XMwMRi5TsfGV9aOQd\n\tK+Mw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=gffvLB+WlAnYBdMss2eSA+WIA4DrPKNvIyVac0+f32Y=;\n\tb=LLYVRwb4sI0nh09OlrUW8TDvZs6guuiCXgEwZKnYLbTUHk3D2kO8nFsPXz7WpMK4SO\n\th6iUr4r9HhWG4kBYdk6oQc1eWdTN6RBP1VGFiNxIIKO3guUOYi6eM10yiaHoC0j4TINu\n\tOeNlC3DjKb0zKHzcLBT4nsTCznGl4cp1WZEcy0QanjxM9Xm4ilZ2JUo39cOLSzQtU4sd\n\tV4jJ4TgEILzG9z/J580K9O5u5xz8MEAWTBfI+k02VNpp9EuNtLV9aUNhiXyhiOMxGutN\n\t4JRjYAhqGn76UboRY/qJPkX3tfT5DJFa6wjjVAKhrdBlVRt+GRqR0UXACymF8HnoFGOY\n\tf+RQ==","X-Gm-Message-State":"AOAM532lzrzGFTPFDoL5n5J2tmW6Upi8ZQ4NWUtMRrd2jUOEIs9u8lUs\n\t9UldkADuontUGg92nDKAhakfvA==","X-Google-Smtp-Source":"ABdhPJyk49ySFUfJeoNHN2+qiTSBMrVcej/XAoFNOlmQBp2+2SaxZO4ar8C0kDr4clQ1vErVkRQObA==","X-Received":"by 2002:a05:651c:1069:: with SMTP id\n\ty9mr6100342ljm.438.1596395259001; \n\tSun, 02 Aug 2020 12:07:39 -0700 (PDT)","From":"Andrey Konovalov <andrey.konovalov@linaro.org>","To":"openembedded-devel@lists.openembedded.org","Date":"Sun,  2 Aug 2020 22:07:19 +0300","Message-Id":"<20200802190719.9358-1-andrey.konovalov@linaro.org>","X-Mailer":"git-send-email 2.17.1","Subject":"[libcamera-devel] [meta-multimedia][PATCH v3] libcamera: fix\n\tpackaging and installation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, raj.khem@gmail.com,\n\tmadhavan.krishnan@linaro.org","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"libcamera checks if RPATH or RUNPATH dynamic tag is present in\nlibcamera.so. If it does, it assumes that libcamera binaries are\nrun directly from the build directory without installing them, and\ntries to use resorces like IPA modules from the build directory.\nMainline meson strips RPATH/RUNPATH out from libcamera.so file\nat install time. But openembedded-core patches meson to disable\nRPATH/RUNPATH removal. That's why  we need to remove this tag manually\nin do_install_append().\n\nIPA module is signed (with openssl dgst) after it is built. But\nduring packaging the OE build system 1) splits out debugging info,\nand 2) strips the binaries. So the IPA module so file installed\nisn't the one which the signature was calculated against. Then\nthe signature check fails, and libcamera tries to run the IPA\nmodule isolated (in a sandbox), which doesn't work if the IPA\nmodule wasn't designed to run isolated. The solution is to\nrecalculate the IPA modules signatures in ${PKGD} after do_package().\n\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n Changes in v3:\n  - As suggested by Laurent Pinchart, use ipa-sign-install.sh script\n    to recalculate the signatures instead of ipa-sign.sh.\n\n Changes in v2:\n  - Recalculate the IPA modules signatures after do_package()\n    instead of disabling stripping and splitting libcamera package\n\n .../recipes-multimedia/libcamera/libcamera.bb | 19 ++++++++++++++++++-\n 1 file changed, 18 insertions(+), 1 deletion(-)","diff":"diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb\nindex 00a5c480d..b34d673bd 100644\n--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb\n+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera.bb\n@@ -18,13 +18,30 @@ PV = \"202006+git${SRCPV}\"\n \n S = \"${WORKDIR}/git\"\n \n-DEPENDS = \"python3-pyyaml-native udev gnutls boost\"\n+DEPENDS = \"python3-pyyaml-native udev gnutls boost chrpath-native\"\n DEPENDS += \"${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}\"\n \n RDEPENDS_${PN} = \"${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}\"\n \n inherit meson pkgconfig python3native\n \n+do_install_append() {\n+    chrpath -d ${D}${libdir}/libcamera.so\n+}\n+\n+addtask do_recalculate_ipa_signatures_package after do_package before do_packagedata\n+do_recalculate_ipa_signatures_package() {\n+    local modules\n+    for module in $(find \"${PKGD}/usr/lib/libcamera\" -name \"*.so.sign\"); do\n+        module=\"${module%.sign}\"\n+        if [ -f \"${module}\" ] ; then\n+            modules=\"${modules} ${module}\"\n+        fi\n+    done\n+\n+    \"${S}/src/ipa/ipa-sign-install.sh\" \"${B}/src/ipa-priv-key.pem\" \"${modules}\"\n+}\n+\n FILES_${PN}-dev = \"${includedir} ${libdir}/pkgconfig\"\n FILES_${PN} += \" ${libdir}/libcamera.so\"\n \n","prefixes":["libcamera-devel","meta-multimedia","v3"]}