From patchwork Tue Apr 7 15:34:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26477 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7BBFAC3333 for ; Tue, 7 Apr 2026 15:35:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6630362E4E; Tue, 7 Apr 2026 17:35:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rRf0lTMd"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C5A862E45 for ; Tue, 7 Apr 2026 17:35:19 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0F9AA596 for ; Tue, 7 Apr 2026 17:33:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1775576032; bh=eyyjC0HOfDmuFtWQQk39lbuP6N3eQG1/g+xSi+YPFJQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rRf0lTMd21fy55USPtjKjPnB3UclmkDG9i8zpzkcpCj8GYA6cyDrD7zDwf32OEkOu mz1RiT5Pe8DkvWmH6oDKp3mp0AvHjjKvl8SMyHYHYgxIN/Fl/BYE/QZtvOboH6X+u+ PlqbPZIe6rc/wAUVP2DfnNlAX8Dk4cCmMN1kTHyY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 37/42] libcamera: global_configuration: Populate empty configuration Date: Tue, 7 Apr 2026 18:34:22 +0300 Message-ID: <20260407153427.1825999-38-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260407153427.1825999-1-laurent.pinchart@ideasonboard.com> References: <20260407153427.1825999-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- Changes since v1: - Move code to constructor to cover all loadFile() calls --- src/libcamera/global_configuration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp index cd9cc25e43fd..c87f56c2d822 100644 --- a/src/libcamera/global_configuration.cpp +++ b/src/libcamera/global_configuration.cpp @@ -61,6 +61,11 @@ LOG_DEFINE_CATEGORY(Configuration) GlobalConfiguration::GlobalConfiguration() { load(); + + if (configuration_->isEmpty()) { + configuration_->add("version", std::make_unique(1)); + configuration_->add("configuration", std::make_unique()); + } } void GlobalConfiguration::load()