[{"id":4816,"web_url":"https://patchwork.libcamera.org/comment/4816/","msgid":"<CAAFQd5CCLzdPvyquofh68V5UgCPSrYT_s+Bg3Y=aTc36kejy2A@mail.gmail.com>","date":"2020-05-13T17:58:31","subject":"Re: [libcamera-devel] [PATCH] ipa: Only sign IPA modules that are\n\tbeing installed","submitter":{"id":48,"url":"https://patchwork.libcamera.org/api/people/48/","name":"Tomasz Figa","email":"tfiga@google.com"},"content":"On Tue, May 12, 2020 at 6:28 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> The ipa-sign-install.sh script, run when installing libcamera, signs all\n> IPA modules present in the module directory. This would result in\n> third-party modules being signed if any are present in the directory.\n> Fix it by explicitly passing the list of IPA modules to the\n> ipa-sign-install.sh script.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/ipa-sign-install.sh | 12 ++++++++----\n>  src/ipa/meson.build         |  6 ++++--\n>  2 files changed, 12 insertions(+), 6 deletions(-)\n>\n\nThanks a lot for the fix.\n\nWithin the Chromium OS SDK, with --board=soraka:\nTested-by: Tomasz Figa <tfiga@chromium.org>\n\nReviewed-by: Tomasz Figa <tfiga@chromium.org>\n\nBest regards,\nTomasz\n\n> diff --git a/src/ipa/ipa-sign-install.sh b/src/ipa/ipa-sign-install.sh\n> index 5317a8a2042b..bcedb8b5cdd1 100755\n> --- a/src/ipa/ipa-sign-install.sh\n> +++ b/src/ipa/ipa-sign-install.sh\n> @@ -6,13 +6,17 @@\n>  #\n>  # ipa-sign-install.sh - Regenerate IPA module signatures when installing\n>\n> -libdir=$1\n> -key=$2\n> +key=$1\n> +shift\n> +modules=$*\n>\n>  ipa_sign=$(dirname \"$0\")/ipa-sign.sh\n>\n>  echo \"Regenerating IPA modules signatures\"\n>\n> -for module in \"${MESON_INSTALL_DESTDIR_PREFIX}/${libdir}\"/*.so ; do\n> -       \"${ipa_sign}\" \"${key}\" \"${module}\" \"${module}.sign\"\n> +for module in ${modules} ; do\n> +       module=\"${MESON_INSTALL_DESTDIR_PREFIX}/${module}\"\n> +       if [ -f \"${module}\" ] ; then\n> +               \"${ipa_sign}\" \"${key}\" \"${module}\" \"${module}.sign\"\n> +       fi\n>  done\n> diff --git a/src/ipa/meson.build b/src/ipa/meson.build\n> index b103479c1cd0..fd4b2c30438d 100644\n> --- a/src/ipa/meson.build\n> +++ b/src/ipa/meson.build\n> @@ -19,10 +19,12 @@ subdir('libipa')\n>  ipa_sign = files('ipa-sign.sh')\n>\n>  ipas = ['raspberrypi', 'rkisp1', 'vimc']\n> +ipa_names = []\n>\n>  foreach pipeline : get_option('pipelines')\n>      if ipas.contains(pipeline)\n>          subdir(pipeline)\n> +        ipa_names += join_paths(ipa_install_dir, ipa_name + '.so')\n>      endif\n>  endforeach\n>\n> @@ -31,6 +33,6 @@ if ipa_sign_module\n>      # .sign files, as meson strips the DT_RPATH and DT_RUNPATH from binaries at\n>      # install time, which invalidates the signatures.\n>      meson.add_install_script('ipa-sign-install.sh',\n> -                             ipa_install_dir,\n> -                             ipa_priv_key.full_path())\n> +                             ipa_priv_key.full_path(),\n> +                             ipa_names)\n>  endif\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<tfiga@google.com>","Received":["from mail-wr1-x442.google.com (mail-wr1-x442.google.com\n\t[IPv6:2a00:1450:4864:20::442])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 85C92603DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 May 2020 19:58:44 +0200 (CEST)","by mail-wr1-x442.google.com with SMTP id 50so518159wrc.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 May 2020 10:58:44 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=google.com\n\theader.i=@google.com header.b=\"pmcYS5XP\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=RmkqqpITmFUkIDm2Wi6eFeHBUCijL3hQr6bFCCDl6wM=;\n\tb=pmcYS5XP05KeOhnwO9JDYf85jv8dmC2koZY7urr2Quzt4wUGOP8DPdmQxPeXzAobAs\n\tXmIcY1o5BMroKjAC/igPLqiYRfvYCskd4/mbMwaHtGt4aoPVPWDlhbT12Z1OHPmKJkXT\n\totStxlXJqXAidmbsu/OmcYFNc0lijus7cuq4AWU9VWuXy/XAAkBzEfT3Uj1HhsEdnahY\n\tvI7fHCY9N+RCNsiIzPD3yZ80i6GEEPGjgyuaxa2IeFgQ2KaPH41yVa3NvEOP8g9VY9Iz\n\tsc8ldcF4h865Syhsmeq9OA12mbktFBfbpbgcLMec+1ahiB6+wGbymrnZ3CnubspvsbSz\n\ttV/A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=RmkqqpITmFUkIDm2Wi6eFeHBUCijL3hQr6bFCCDl6wM=;\n\tb=CRH4jzPqjaQJG/OgJ3FLqEO0eFdf/9XvLE15eKotU4Zq/dQ2YxYrzaHObqXfUku2FK\n\tZ5LV+GUnzDHu6HiotEebKyXbJarBH99fuMGdxOBO9OTJQ9mJ0kTUfriuZsjIfbNGfH8D\n\t/UhjlwZmrWQIBUIFqZM0jDu46Q1yRjxnqqVj9ewKK77XvHbNXkXRxEOi2Pg0MczgijtT\n\tiF5c3fdxF1ogA/oQu1GkGdYiVNUAnhsrRmF+0HzcwvyUlQScDavkjS7CPnB2Ex2kfgjT\n\tgMBu63uqc5XCpDHvS/Qdx9EjfeReP4aep7xrtuBcHsrb3WRXyY6c5XvdnBnDKgwOvW7k\n\txk+g==","X-Gm-Message-State":"AOAM530dAS6XVcJFW4VOemumJxXy0WlX3rMJOKqmIM02rZAt89PqBhYH\n\tLOQv6yBjDsSOg91aHqPtbb6sdMx9WK8/ApIGgbZWqg==","X-Google-Smtp-Source":"ABdhPJwCmiC/O0FLEAgMzDhsJmIuZ4LBN2yQ6wL04/t83Mjgb4fUaaFuyFXnoUZ3P8dtOSeseh/2MlcHKin03jZsGfQ=","X-Received":"by 2002:a5d:4ccd:: with SMTP id c13mr509779wrt.415.1589392723875;\n\tWed, 13 May 2020 10:58:43 -0700 (PDT)","MIME-Version":"1.0","References":"<20200512162822.21324-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20200512162822.21324-1-laurent.pinchart@ideasonboard.com>","From":"Tomasz Figa <tfiga@google.com>","Date":"Wed, 13 May 2020 19:58:31 +0200","Message-ID":"<CAAFQd5CCLzdPvyquofh68V5UgCPSrYT_s+Bg3Y=aTc36kejy2A@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: Only sign IPA modules that are\n\tbeing installed","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>","X-List-Received-Date":"Wed, 13 May 2020 17:58:44 -0000"}}]