From c73170388e3aeea6edb0df9f828967a7204d75fa Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 12 Jul 2021 02:05:33 +0300 Subject: libcamera: ipa_manager: Allow forcing IPA module isolation For test purpose it's useful to run open-source IPA modules in isolation. This can already be done by deleting the corresponding signature file, but that method can be inconvenient. Add a way to force IPA module isolation through a new LIBCAMERA_IPA_FORCE_ISOLATION environment variable. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- src/libcamera/ipa_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index 73a86886..55840896 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -276,6 +276,14 @@ IPAModule *IPAManager::module(PipelineHandler *pipe, uint32_t minVersion, bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const { #if HAVE_IPA_PUBKEY + char *force = utils::secure_getenv("LIBCAMERA_IPA_FORCE_ISOLATION"); + if (force && force[0] != '\0') { + LOG(IPAManager, Debug) + << "Isolation of IPA module " << ipa->path() + << " forced through environment variable"; + return false; + } + File file{ ipa->path() }; if (!file.open(File::ReadOnly)) return false; -- cgit v1.2.1