mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
a5c81fc945
commit
c73170388e
2 changed files with 13 additions and 0 deletions
|
@ -24,6 +24,11 @@ LIBCAMERA_IPA_CONFIG_PATH
|
|||
|
||||
Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``
|
||||
|
||||
LIBCAMERA_IPA_FORCE_ISOLATION
|
||||
When set to a non-empty string, force process isolation of all IPA modules.
|
||||
|
||||
Example value: ``1``
|
||||
|
||||
LIBCAMERA_IPA_MODULE_PATH
|
||||
Define custom search locations for IPA modules (`more <IPA module_>`__).
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue