| Message ID | 20260113000808.15395-32-laurent.pinchart@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
2026. 01. 13. 1:08 keltezéssel, Laurent Pinchart írta: > If no configuration file can be parsed, populate an empty configuration. > This will serve as a base to store the configuration options set through > environment variables. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/libcamera/global_configuration.cpp | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp > index 4d154c026e44..a759a086b9a4 100644 > --- a/src/libcamera/global_configuration.cpp > +++ b/src/libcamera/global_configuration.cpp > @@ -93,7 +93,12 @@ void GlobalConfiguration::load() > > for (const auto &path : globalConfigurationFiles) { > if (loadFile(path)) > - return; > + break; > + } This misses the earlier `loadFile()` call in the `if (!userConfigurationDirectory.empty()) {` block. > + > + if (configuration_->isEmpty()) { > + configuration_->add("version", std::make_unique<ValueNode>(1)); > + configuration_->add("configuration", std::make_unique<ValueNode>()); > } > } >
On Tue, Jan 13, 2026 at 02:30:39PM +0100, Barnabás Pőcze wrote: > 2026. 01. 13. 1:08 keltezéssel, Laurent Pinchart írta: > > If no configuration file can be parsed, populate an empty configuration. > > This will serve as a base to store the configuration options set through > > environment variables. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > src/libcamera/global_configuration.cpp | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp > > index 4d154c026e44..a759a086b9a4 100644 > > --- a/src/libcamera/global_configuration.cpp > > +++ b/src/libcamera/global_configuration.cpp > > @@ -93,7 +93,12 @@ void GlobalConfiguration::load() > > > > for (const auto &path : globalConfigurationFiles) { > > if (loadFile(path)) > > - return; > > + break; > > + } > > This misses the earlier `loadFile()` call in the `if (!userConfigurationDirectory.empty()) {` block. Indeed. I'll reorganize the code. > > + > > + if (configuration_->isEmpty()) { > > + configuration_->add("version", std::make_unique<ValueNode>(1)); > > + configuration_->add("configuration", std::make_unique<ValueNode>()); > > } > > } > > >
diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp index 4d154c026e44..a759a086b9a4 100644 --- a/src/libcamera/global_configuration.cpp +++ b/src/libcamera/global_configuration.cpp @@ -93,7 +93,12 @@ void GlobalConfiguration::load() for (const auto &path : globalConfigurationFiles) { if (loadFile(path)) - return; + break; + } + + if (configuration_->isEmpty()) { + configuration_->add("version", std::make_unique<ValueNode>(1)); + configuration_->add("configuration", std::make_unique<ValueNode>()); } }
If no configuration file can be parsed, populate an empty configuration. This will serve as a base to store the configuration options set through environment variables. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/libcamera/global_configuration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)