From patchwork Tue May 12 16:28:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3782 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E366603E0 for ; Tue, 12 May 2020 18:28:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="E6Q2JNRh"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A445D51F; Tue, 12 May 2020 18:28:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589300911; bh=jZUmtwmTpC2BajTXgKvB1uhU5+vzbTo3N3x7Vhg54D4=; h=From:To:Cc:Subject:Date:From; b=E6Q2JNRht3/BkLn7km18TijbScOYsXp4QfFkFXWT/xMMQnZ1SssZHetGhWErcRZze 3WlmqzpFSyK8LcRFt2lwiqNVBXuv7XohT0bwtf+TojUCyWXc1UUkSJHDJlPAPdr6vB NIrUG+sjTv0dNL4OILUKnEY1uOB9QY7CIdn0c1oM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Tomasz Figa Date: Tue, 12 May 2020 19:28:22 +0300 Message-Id: <20200512162822.21324-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] ipa: Only sign IPA modules that are being installed X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:28:32 -0000 The ipa-sign-install.sh script, run when installing libcamera, signs all IPA modules present in the module directory. This would result in third-party modules being signed if any are present in the directory. Fix it by explicitly passing the list of IPA modules to the ipa-sign-install.sh script. Signed-off-by: Laurent Pinchart Tested-by: Tomasz Figa Reviewed-by: Tomasz Figa --- src/ipa/ipa-sign-install.sh | 12 ++++++++---- src/ipa/meson.build | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ipa/ipa-sign-install.sh b/src/ipa/ipa-sign-install.sh index 5317a8a2042b..bcedb8b5cdd1 100755 --- a/src/ipa/ipa-sign-install.sh +++ b/src/ipa/ipa-sign-install.sh @@ -6,13 +6,17 @@ # # ipa-sign-install.sh - Regenerate IPA module signatures when installing -libdir=$1 -key=$2 +key=$1 +shift +modules=$* ipa_sign=$(dirname "$0")/ipa-sign.sh echo "Regenerating IPA modules signatures" -for module in "${MESON_INSTALL_DESTDIR_PREFIX}/${libdir}"/*.so ; do - "${ipa_sign}" "${key}" "${module}" "${module}.sign" +for module in ${modules} ; do + module="${MESON_INSTALL_DESTDIR_PREFIX}/${module}" + if [ -f "${module}" ] ; then + "${ipa_sign}" "${key}" "${module}" "${module}.sign" + fi done diff --git a/src/ipa/meson.build b/src/ipa/meson.build index b103479c1cd0..fd4b2c30438d 100644 --- a/src/ipa/meson.build +++ b/src/ipa/meson.build @@ -19,10 +19,12 @@ subdir('libipa') ipa_sign = files('ipa-sign.sh') ipas = ['raspberrypi', 'rkisp1', 'vimc'] +ipa_names = [] foreach pipeline : get_option('pipelines') if ipas.contains(pipeline) subdir(pipeline) + ipa_names += join_paths(ipa_install_dir, ipa_name + '.so') endif endforeach @@ -31,6 +33,6 @@ if ipa_sign_module # .sign files, as meson strips the DT_RPATH and DT_RUNPATH from binaries at # install time, which invalidates the signatures. meson.add_install_script('ipa-sign-install.sh', - ipa_install_dir, - ipa_priv_key.full_path()) + ipa_priv_key.full_path(), + ipa_names) endif