From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 19 Sep 2025 12:07:11 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uzY1H-004oRI-1Y for lore@lore.pengutronix.de; Fri, 19 Sep 2025 12:07:11 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1uzY1H-0007kI-3e; Fri, 19 Sep 2025 12:07:11 +0200 Received: from mail.thorsis.com ([217.92.40.78]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1uzY0v-0007av-7n for ptxdist@pengutronix.de; Fri, 19 Sep 2025 12:06:49 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B452B1489B87 for ; Fri, 19 Sep 2025 12:06:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1758276408; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=9w95WnVxE4GgxHDOMvLH3dLyIF37kSU+bha+UMJDDQY=; b=niF2mAAvpUAyqd/6uk9QkhMWTmcNTk8mFjUEk9YapUxyXZItzp/wc7fAlXl2iWvhJQa3PN ZtiB1c2dhuPWIocJ/JeBgj3U/iN5giwKklwvyn12pkkKEePj6nx4oCKpfu58Ehm2KNKuBW qevgKlC21UzVdwDS/mbY0+lwM+le8Tdf2O5ct077mLS4TNZQcyME+pDULbjJNRMvClfoYR SEIawa2uOPVrkzLUL5OaUSvHs4S4SrOwE9mmTABvCwgrrCRRSeNW3kysYJCnedU5B3cjCC mqyROzuvPRKkzVYhHru44eLyNKd2h/8GGxXIsL23+z0FX+YB/wOGvCU6J4x4uA== To: ptxdist@pengutronix.de Date: Fri, 19 Sep 2025 12:06:40 +0200 Message-Id: <20250919100643.199174-3-ada@thorsis.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250919100643.199174-1-ada@thorsis.com> References: <20250919100643.199174-1-ada@thorsis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH v2 2/5] libubootenv: Add option for installing tools X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alexander Dahl via ptxdist Reply-To: ptxdist@pengutronix.de Cc: Alexander Dahl Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false These tools can also be provided by the u-boot-tools package. This variant promises to be board independent, and comes with a library, and has more features. Can be used as drop-in replacement for fw_printenv and fw_setenv. Helpful for writing env to mmcblockXbootX which is ro by default, and u-boot-tools does not handle that. Signed-off-by: Alexander Dahl --- Notes: v2: - reworded commit message v1: - Link: https://lore.ptxdist.org/ptxdist/mailman.2960.1742547175.466.ptxdist@pengutronix.de/ rules/libubootenv.in | 18 ++++++++++++++++-- rules/libubootenv.make | 7 +++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/rules/libubootenv.in b/rules/libubootenv.in index 70f6d9863..317a440fc 100644 --- a/rules/libubootenv.in +++ b/rules/libubootenv.in @@ -1,15 +1,29 @@ ## SECTION=system_libraries -config LIBUBOOTENV +menuconfig LIBUBOOTENV tristate select HOST_CMAKE select LIBYAML select ZLIB - prompt "libubootenv" + prompt "libubootenv " help Generic library and tools to access and modify U-Boot environment from User Space. https://github.com/sbabic/libubootenv +if LIBUBOOTENV + +config LIBUBOOTENV_TOOLS + bool + prompt "fw_printenv / fw_setenv" + depends on !U_BOOT_TOOLS || ALLYES + help + Install fw_printenv and fw_setenv to target. + +comment "u-boot-tools is selected!" + depends on U_BOOT_TOOLS + +endif + # vim: ft=kconfig noet tw=72 ts=8 sw=8 diff --git a/rules/libubootenv.make b/rules/libubootenv.make index d4e678152..769961dfa 100644 --- a/rules/libubootenv.make +++ b/rules/libubootenv.make @@ -51,6 +51,13 @@ $(STATEDIR)/libubootenv.targetinstall: @$(call install_lib, libubootenv, 0, 0, 0644, libubootenv) +ifdef PTXCONF_LIBUBOOTENV_TOOLS +# # same path as the equivalents from u-boot-tools package + @$(call install_copy, libubootenv, 0, 0, 0755, \ + $(LIBUBOOTENV_PKGDIR)/usr/bin/fw_printenv, /usr/sbin/fw_printenv) + @$(call install_link, libubootenv, fw_printenv, /usr/sbin/fw_setenv) +endif + @$(call install_finish, libubootenv) @$(call touch) -- 2.39.5