[{"id":35746,"web_url":"https://patchwork.libcamera.org/comment/35746/","msgid":"<175742612306.2127323.13242612253773212662@neptunite.rasen.tech>","date":"2025-09-09T13:55:23","subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Milan,\n\nThanks for the patch.\n\nQuoting Milan Zamazal (2025-07-29 16:32:00)\n> A newly introduced LIBCAMERA_CONFIG_DIR environment variable specifies a\n> directory or a list of directories separated by colons where to look for\n> the libcamera configuration file before trying the standard locations.\n\nOh, this is the path portion from the previous patch... imo it should be\nsquashed.\n\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  Documentation/runtime_configuration.rst |  5 +++++\n>  src/libcamera/global_configuration.cpp  | 28 ++++++++++++++-----------\n>  2 files changed, 21 insertions(+), 12 deletions(-)\n> \n> diff --git a/Documentation/runtime_configuration.rst b/Documentation/runtime_configuration.rst\n> index 71a1a175d..759f6f476 100644\n> --- a/Documentation/runtime_configuration.rst\n> +++ b/Documentation/runtime_configuration.rst\n> @@ -19,6 +19,11 @@ order:\n>  - LIBCAMERA_SYSCONF_DIR/configuration.yaml\n>  - LIBCAMERA_DATA_DIR/libcamera/configuration.yaml\n>  \n> +If LIBCAMERA_CONFIG_DIR environment variable is non-empty then it\n> +specifies additional directories where to look for the configuration\n> +file, before looking at the standard locations. It can be a single\n> +directory or multiple directories separated by colons.\n\nSince this specifies the directory, maybe the variable from the previous patch\nshould only support filename directly?\n\nHm... I'm thinking that if the user wants to specify which configuration file\nthey want to use, then they'd specify the exact file (like\nLIBCAMERA_RPI_CONFIG_FILE), or at most a list of files (delimited by : like\n$PATH). I personally don't see the need for a convenience environment variable\njust to set purely the name of the file to search for within standard config\ndirectories.\n\nWhat do you (or others) think?\n\n\nThanks,\n\nPaul\n\n> +\n>  The default name of the configuration file, configuration.yaml, can be\n>  overridden in LIBCAMERA_CONFIG_NAME environment variable. The variable\n>  can specify just an alternative configuration file name to be looked up\n> diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp\n> index 68a4731a1..d80f5a158 100644\n> --- a/src/libcamera/global_configuration.cpp\n> +++ b/src/libcamera/global_configuration.cpp\n> @@ -68,11 +68,6 @@ bool GlobalConfiguration::loadFile(const std::filesystem::path &fileName)\n>  \n>  void GlobalConfiguration::load()\n>  {\n> -       const std::vector<std::filesystem::path> globalConfigurationDirectories = {\n> -               std::filesystem::path(LIBCAMERA_SYSCONF_DIR),\n> -               std::filesystem::path(LIBCAMERA_DATA_DIR),\n> -       };\n> -\n>         const char *libcameraConfigName =\n>                 utils::secure_getenv(\"LIBCAMERA_CONFIG_NAME\");\n>         if (libcameraConfigName && libcameraConfigName[0] == '\\0')\n> @@ -90,6 +85,16 @@ void GlobalConfiguration::load()\n>         if (configName.empty())\n>                 configName = std::filesystem::path(\"configuration.yaml\");\n>  \n> +       std::vector<std::filesystem::path> configurationDirectories;\n> +\n> +       const char *configDir = utils::secure_getenv(\"LIBCAMERA_CONFIG_DIR\");\n> +       if (configDir) {\n> +               for (auto const &path : utils::split(configDir, \":\")) {\n> +                       if (!path.empty())\n> +                               configurationDirectories.push_back(path);\n> +               }\n> +       }\n> +\n>         std::filesystem::path userConfigurationDirectory;\n>         const char *xdgConfigHome = utils::secure_getenv(\"XDG_CONFIG_HOME\");\n>         if (xdgConfigHome) {\n> @@ -100,15 +105,14 @@ void GlobalConfiguration::load()\n>                         userConfigurationDirectory =\n>                                 std::filesystem::path(home) / \".config\";\n>         }\n> +       if (!userConfigurationDirectory.empty())\n> +               configurationDirectories.push_back(\n> +                       userConfigurationDirectory / \"libcamera\");\n>  \n> -       if (!userConfigurationDirectory.empty()) {\n> -               std::filesystem::path user_configuration_file =\n> -                       userConfigurationDirectory / \"libcamera\" / configName;\n> -               if (loadFile(user_configuration_file))\n> -                       return;\n> -       }\n> +       configurationDirectories.push_back(LIBCAMERA_SYSCONF_DIR);\n> +       configurationDirectories.push_back(LIBCAMERA_DATA_DIR);\n>  \n> -       for (const auto &path : globalConfigurationDirectories)\n> +       for (const auto &path : configurationDirectories)\n>                 if (loadFile(path / configName))\n>                         return;\n>  }\n> -- \n> 2.50.1\n>","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 958C7C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Sep 2025 13:55:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 54A696936B;\n\tTue,  9 Sep 2025 15:55:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62D816934B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Sep 2025 15:55:30 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:6f3a:4f34:f1fa:8b3])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AB157605;\n\tTue,  9 Sep 2025 15:54:16 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"k9TO3ybx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757426057;\n\tbh=qXFf287LFysjLm3NZ6ox60k/OlzgCPI7GhIjj07yT1Q=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=k9TO3ybxqQx12XK46GzMSy6LC9Mx9YCwC5QAhzqPdZQaEdIhhWL2VG3qShdz6aL9L\n\tq8wsAHJuzuypdTBX0xvV0lIzYreL2CEiET4F/PnNa/0BWPkO1Lo6/PUVcIhI/LyqQV\n\t+T+xkwyg8tC+66ovtQA7OvP+NctRcXiMEzftwZFQ=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250729073201.5369-13-mzamazal@redhat.com>","References":"<20250729073201.5369-1-mzamazal@redhat.com>\n\t<20250729073201.5369-13-mzamazal@redhat.com>","Subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 09 Sep 2025 22:55:23 +0900","Message-ID":"<175742612306.2127323.13242612253773212662@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35750,"web_url":"https://patchwork.libcamera.org/comment/35750/","msgid":"<0157f32a-8b5b-4741-8420-19f9b55a17e6@ideasonboard.com>","date":"2025-09-09T14:11:19","subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 09. 09. 15:55 keltezéssel, Paul Elder írta:\n> Hi Milan,\n> \n> Thanks for the patch.\n> \n> Quoting Milan Zamazal (2025-07-29 16:32:00)\n>> A newly introduced LIBCAMERA_CONFIG_DIR environment variable specifies a\n>> directory or a list of directories separated by colons where to look for\n>> the libcamera configuration file before trying the standard locations.\n> \n> Oh, this is the path portion from the previous patch... imo it should be\n> squashed.\n> \n>>\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   Documentation/runtime_configuration.rst |  5 +++++\n>>   src/libcamera/global_configuration.cpp  | 28 ++++++++++++++-----------\n>>   2 files changed, 21 insertions(+), 12 deletions(-)\n>>\n>> diff --git a/Documentation/runtime_configuration.rst b/Documentation/runtime_configuration.rst\n>> index 71a1a175d..759f6f476 100644\n>> --- a/Documentation/runtime_configuration.rst\n>> +++ b/Documentation/runtime_configuration.rst\n>> @@ -19,6 +19,11 @@ order:\n>>   - LIBCAMERA_SYSCONF_DIR/configuration.yaml\n>>   - LIBCAMERA_DATA_DIR/libcamera/configuration.yaml\n>>   \n>> +If LIBCAMERA_CONFIG_DIR environment variable is non-empty then it\n>> +specifies additional directories where to look for the configuration\n>> +file, before looking at the standard locations. It can be a single\n>> +directory or multiple directories separated by colons.\n> \n> Since this specifies the directory, maybe the variable from the previous patch\n> should only support filename directly?\n> \n> Hm... I'm thinking that if the user wants to specify which configuration file\n> they want to use, then they'd specify the exact file (like\n> LIBCAMERA_RPI_CONFIG_FILE), or at most a list of files (delimited by : like\n> $PATH). I personally don't see the need for a convenience environment variable\n> just to set purely the name of the file to search for within standard config\n> directories.\n> \n> What do you (or others) think?\n\nSome of it was my suggestion. So in summary, my preference is the following:\n\n   * have both `LIBCAMERA_CONFIG_NAME` and `LIBCAMERA_CONFIG_DIR`;\n   * if $LIBCAMERA_CONFIG_NAME is empty, load nothing;\n   * otherwise if $LIBCAMERA_CONFIG_NAME is an absolute path, load just that;\n   * otherwise look for $LIBCAMERA_CONFIG_NAME in the following directories:\n     * ':' separated list of directories from $LIBCAMERA_CONFIG_DIR,\n     * pre-defined locations.\n\nI think all of them have use cases. For example, if you have a set of configuration\nin your home directory, it's easiest to use `LIBCAMERA_CONFIG_NAME=myconf1` to select\nbetween them.\n\nSometimes you might want to quickly try a temporary configuration, in that case\nusing LIBCAMERA_CONFIG_NAME with an absolute path is easiest.\n\nAnd `LIBCAMERA_CONFIG_DIR` is very useful is a meson devenv. Admittedly that's a more\ndeveloper centric thing, but it still seems nice to support.\n\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> \n> Thanks,\n> \n> Paul\n> \n>> +\n>>   The default name of the configuration file, configuration.yaml, can be\n>>   overridden in LIBCAMERA_CONFIG_NAME environment variable. The variable\n>>   can specify just an alternative configuration file name to be looked up\n>> diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp\n>> index 68a4731a1..d80f5a158 100644\n>> --- a/src/libcamera/global_configuration.cpp\n>> +++ b/src/libcamera/global_configuration.cpp\n>> @@ -68,11 +68,6 @@ bool GlobalConfiguration::loadFile(const std::filesystem::path &fileName)\n>>   \n>>   void GlobalConfiguration::load()\n>>   {\n>> -       const std::vector<std::filesystem::path> globalConfigurationDirectories = {\n>> -               std::filesystem::path(LIBCAMERA_SYSCONF_DIR),\n>> -               std::filesystem::path(LIBCAMERA_DATA_DIR),\n>> -       };\n>> -\n>>          const char *libcameraConfigName =\n>>                  utils::secure_getenv(\"LIBCAMERA_CONFIG_NAME\");\n>>          if (libcameraConfigName && libcameraConfigName[0] == '\\0')\n>> @@ -90,6 +85,16 @@ void GlobalConfiguration::load()\n>>          if (configName.empty())\n>>                  configName = std::filesystem::path(\"configuration.yaml\");\n>>   \n>> +       std::vector<std::filesystem::path> configurationDirectories;\n>> +\n>> +       const char *configDir = utils::secure_getenv(\"LIBCAMERA_CONFIG_DIR\");\n>> +       if (configDir) {\n>> +               for (auto const &path : utils::split(configDir, \":\")) {\n>> +                       if (!path.empty())\n>> +                               configurationDirectories.push_back(path);\n>> +               }\n>> +       }\n>> +\n>>          std::filesystem::path userConfigurationDirectory;\n>>          const char *xdgConfigHome = utils::secure_getenv(\"XDG_CONFIG_HOME\");\n>>          if (xdgConfigHome) {\n>> @@ -100,15 +105,14 @@ void GlobalConfiguration::load()\n>>                          userConfigurationDirectory =\n>>                                  std::filesystem::path(home) / \".config\";\n>>          }\n>> +       if (!userConfigurationDirectory.empty())\n>> +               configurationDirectories.push_back(\n>> +                       userConfigurationDirectory / \"libcamera\");\n>>   \n>> -       if (!userConfigurationDirectory.empty()) {\n>> -               std::filesystem::path user_configuration_file =\n>> -                       userConfigurationDirectory / \"libcamera\" / configName;\n>> -               if (loadFile(user_configuration_file))\n>> -                       return;\n>> -       }\n>> +       configurationDirectories.push_back(LIBCAMERA_SYSCONF_DIR);\n>> +       configurationDirectories.push_back(LIBCAMERA_DATA_DIR);\n>>   \n>> -       for (const auto &path : globalConfigurationDirectories)\n>> +       for (const auto &path : configurationDirectories)\n>>                  if (loadFile(path / configName))\n>>                          return;\n>>   }\n>> -- \n>> 2.50.1\n>>","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 A17C1C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Sep 2025 14:11:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E1D56936C;\n\tTue,  9 Sep 2025 16:11:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EDE576934B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Sep 2025 16:11:23 +0200 (CEST)","from [192.168.33.22] (185.221.142.115.nat.pool.zt.hu\n\t[185.221.142.115])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 730D75B3;\n\tTue,  9 Sep 2025 16:10:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HEPCZi4z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757427010;\n\tbh=24pjIcINjynVppGRBgKKYrimBu0mn2jtO6GANcbSxrc=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=HEPCZi4zjltQhDLBzH2/ZDSejivx0+pZRzKoRjzGGMXTnFmHXlcXtEbwa1TLH+fxF\n\tNDyiK3QapUgGxaIGm/XkifDOHUM8Gj677wsN8AL9ySwUmwHgJeAJoLcNK7E4s5FRtB\n\t3emyUcR8WfYA0IXgo9vfgqbGPk11MRKO/IylwRis=","Message-ID":"<0157f32a-8b5b-4741-8420-19f9b55a17e6@ideasonboard.com>","Date":"Tue, 9 Sep 2025 16:11:19 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20250729073201.5369-1-mzamazal@redhat.com>\n\t<20250729073201.5369-13-mzamazal@redhat.com>\n\t<175742612306.2127323.13242612253773212662@neptunite.rasen.tech>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<175742612306.2127323.13242612253773212662@neptunite.rasen.tech>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35756,"web_url":"https://patchwork.libcamera.org/comment/35756/","msgid":"<175742909301.2127323.13473331926412661062@neptunite.rasen.tech>","date":"2025-09-09T14:44:53","subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-09-09 23:11:19)\n> Hi\n> \n> 2025. 09. 09. 15:55 keltezéssel, Paul Elder írta:\n> > Hi Milan,\n> > \n> > Thanks for the patch.\n> > \n> > Quoting Milan Zamazal (2025-07-29 16:32:00)\n> >> A newly introduced LIBCAMERA_CONFIG_DIR environment variable specifies a\n> >> directory or a list of directories separated by colons where to look for\n> >> the libcamera configuration file before trying the standard locations.\n> > \n> > Oh, this is the path portion from the previous patch... imo it should be\n> > squashed.\n> > \n> >>\n> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >> ---\n> >>   Documentation/runtime_configuration.rst |  5 +++++\n> >>   src/libcamera/global_configuration.cpp  | 28 ++++++++++++++-----------\n> >>   2 files changed, 21 insertions(+), 12 deletions(-)\n> >>\n> >> diff --git a/Documentation/runtime_configuration.rst b/Documentation/runtime_configuration.rst\n> >> index 71a1a175d..759f6f476 100644\n> >> --- a/Documentation/runtime_configuration.rst\n> >> +++ b/Documentation/runtime_configuration.rst\n> >> @@ -19,6 +19,11 @@ order:\n> >>   - LIBCAMERA_SYSCONF_DIR/configuration.yaml\n> >>   - LIBCAMERA_DATA_DIR/libcamera/configuration.yaml\n> >>   \n> >> +If LIBCAMERA_CONFIG_DIR environment variable is non-empty then it\n> >> +specifies additional directories where to look for the configuration\n> >> +file, before looking at the standard locations. It can be a single\n> >> +directory or multiple directories separated by colons.\n> > \n> > Since this specifies the directory, maybe the variable from the previous patch\n> > should only support filename directly?\n> > \n> > Hm... I'm thinking that if the user wants to specify which configuration file\n> > they want to use, then they'd specify the exact file (like\n> > LIBCAMERA_RPI_CONFIG_FILE), or at most a list of files (delimited by : like\n> > $PATH). I personally don't see the need for a convenience environment variable\n> > just to set purely the name of the file to search for within standard config\n> > directories.\n> > \n> > What do you (or others) think?\n> \n> Some of it was my suggestion. So in summary, my preference is the following:\n> \n>    * have both `LIBCAMERA_CONFIG_NAME` and `LIBCAMERA_CONFIG_DIR`;\n>    * if $LIBCAMERA_CONFIG_NAME is empty, load nothing;\n>    * otherwise if $LIBCAMERA_CONFIG_NAME is an absolute path, load just that;\n>    * otherwise look for $LIBCAMERA_CONFIG_NAME in the following directories:\n>      * ':' separated list of directories from $LIBCAMERA_CONFIG_DIR,\n>      * pre-defined locations.\n> \n> I think all of them have use cases. For example, if you have a set of configuration\n> in your home directory, it's easiest to use `LIBCAMERA_CONFIG_NAME=myconf1` to select\n> between them.\n> \n> Sometimes you might want to quickly try a temporary configuration, in that case\n> using LIBCAMERA_CONFIG_NAME with an absolute path is easiest.\n> \n> And `LIBCAMERA_CONFIG_DIR` is very useful is a meson devenv. Admittedly that's a more\n> developer centric thing, but it still seems nice to support.\n\nHm ok, that makes sense.\n\nThen I'd like the above documented more clearly in the documentation (actually\nthe above description is good so even copy&paste (if Barnabás approves)), and\nsquashed.\n\n\nThanks,\n\nPaul\n\n> \n> \n> Regards,\n> Barnabás Pőcze\n> \n> \n> > \n> > \n> > Thanks,\n> > \n> > Paul\n> > \n> >> +\n> >>   The default name of the configuration file, configuration.yaml, can be\n> >>   overridden in LIBCAMERA_CONFIG_NAME environment variable. The variable\n> >>   can specify just an alternative configuration file name to be looked up\n> >> diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp\n> >> index 68a4731a1..d80f5a158 100644\n> >> --- a/src/libcamera/global_configuration.cpp\n> >> +++ b/src/libcamera/global_configuration.cpp\n> >> @@ -68,11 +68,6 @@ bool GlobalConfiguration::loadFile(const std::filesystem::path &fileName)\n> >>   \n> >>   void GlobalConfiguration::load()\n> >>   {\n> >> -       const std::vector<std::filesystem::path> globalConfigurationDirectories = {\n> >> -               std::filesystem::path(LIBCAMERA_SYSCONF_DIR),\n> >> -               std::filesystem::path(LIBCAMERA_DATA_DIR),\n> >> -       };\n> >> -\n> >>          const char *libcameraConfigName =\n> >>                  utils::secure_getenv(\"LIBCAMERA_CONFIG_NAME\");\n> >>          if (libcameraConfigName && libcameraConfigName[0] == '\\0')\n> >> @@ -90,6 +85,16 @@ void GlobalConfiguration::load()\n> >>          if (configName.empty())\n> >>                  configName = std::filesystem::path(\"configuration.yaml\");\n> >>   \n> >> +       std::vector<std::filesystem::path> configurationDirectories;\n> >> +\n> >> +       const char *configDir = utils::secure_getenv(\"LIBCAMERA_CONFIG_DIR\");\n> >> +       if (configDir) {\n> >> +               for (auto const &path : utils::split(configDir, \":\")) {\n> >> +                       if (!path.empty())\n> >> +                               configurationDirectories.push_back(path);\n> >> +               }\n> >> +       }\n> >> +\n> >>          std::filesystem::path userConfigurationDirectory;\n> >>          const char *xdgConfigHome = utils::secure_getenv(\"XDG_CONFIG_HOME\");\n> >>          if (xdgConfigHome) {\n> >> @@ -100,15 +105,14 @@ void GlobalConfiguration::load()\n> >>                          userConfigurationDirectory =\n> >>                                  std::filesystem::path(home) / \".config\";\n> >>          }\n> >> +       if (!userConfigurationDirectory.empty())\n> >> +               configurationDirectories.push_back(\n> >> +                       userConfigurationDirectory / \"libcamera\");\n> >>   \n> >> -       if (!userConfigurationDirectory.empty()) {\n> >> -               std::filesystem::path user_configuration_file =\n> >> -                       userConfigurationDirectory / \"libcamera\" / configName;\n> >> -               if (loadFile(user_configuration_file))\n> >> -                       return;\n> >> -       }\n> >> +       configurationDirectories.push_back(LIBCAMERA_SYSCONF_DIR);\n> >> +       configurationDirectories.push_back(LIBCAMERA_DATA_DIR);\n> >>   \n> >> -       for (const auto &path : globalConfigurationDirectories)\n> >> +       for (const auto &path : configurationDirectories)\n> >>                  if (loadFile(path / configName))\n> >>                          return;\n> >>   }\n> >> -- \n> >> 2.50.1\n> >>\n>","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 A5C63C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Sep 2025 14:45:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 652276936D;\n\tTue,  9 Sep 2025 16:45:00 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2BC196934B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Sep 2025 16:44:59 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:6f3a:4f34:f1fa:8b3])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 5D3C45B3;\n\tTue,  9 Sep 2025 16:43:45 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"easYjxUh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757429026;\n\tbh=gGth1baSBldF2QGw/x6hy/E+eg81HRjs4kwHTqnQjD0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=easYjxUh7yKhGtIHVoo49BUxn4RUk1LjgYrRmt58yAFIeyT0CnQWtHTHnj3HLyqjC\n\t78hkHQqOVOuZK1SDkWxhqSba+nXCvE9of5kOPiWPu9WwClJ2XwUmURJuzKsu3+Wnxj\n\tTWl/l52g+1Bp4lLehS31HACELhV03522wx9fzYVs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<0157f32a-8b5b-4741-8420-19f9b55a17e6@ideasonboard.com>","References":"<20250729073201.5369-1-mzamazal@redhat.com>\n\t<20250729073201.5369-13-mzamazal@redhat.com>\n\t<175742612306.2127323.13242612253773212662@neptunite.rasen.tech>\n\t<0157f32a-8b5b-4741-8420-19f9b55a17e6@ideasonboard.com>","Subject":"Re: [PATCH v16 12/12] config: Make configuration directories\n\tconfigurable","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 09 Sep 2025 23:44:53 +0900","Message-ID":"<175742909301.2127323.13473331926412661062@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]