mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl via ptxdist <ptxdist@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <ada@thorsis.com>
Subject: [ptxdist] [RFC PATCH 2/7] libubootenv: Add option for installing tools
Date: Fri, 21 Mar 2025 09:52:41 +0100	[thread overview]
Message-ID: <mailman.2960.1742547175.466.ptxdist@pengutronix.de> (raw)
In-Reply-To: <20250321085246.21344-1-ada@thorsis.com>


[-- Attachment #0: Type: message/rfc822, Size: 3934 bytes --]

From: Alexander Dahl <ada@thorsis.com>
To: ptxdist@pengutronix.de
Subject: [RFC PATCH 2/7] libubootenv: Add option for installing tools
Date: Fri, 21 Mar 2025 09:52:41 +0100
Message-ID: <20250321085246.21344-3-ada@thorsis.com>

These tools can also be provided by the u-boot-tools package.  This
variant promises to be board independent, and comes with a library.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 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




  parent reply	other threads:[~2025-03-21  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250321085246.21344-1-ada@thorsis.com>
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 1/7] libubootenv: Introduce new package Alexander Dahl via ptxdist
2025-03-21  8:52 ` Alexander Dahl via ptxdist [this message]
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 3/7] swupdate: " Alexander Dahl via ptxdist
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 4/7] swupdate: Remove targetinstall of example tools Alexander Dahl via ptxdist
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 5/7] swupdate: Add option to build with OpenSSL support Alexander Dahl via ptxdist
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 6/7] swupdate: Fix passing libubootenv dependency Alexander Dahl via ptxdist
2025-03-21  8:52 ` [ptxdist] [RFC PATCH 7/7] swupdate: Add optional zlib support Alexander Dahl via ptxdist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.2960.1742547175.466.ptxdist@pengutronix.de \
    --to=ptxdist@pengutronix.de \
    --cc=ada@thorsis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox