mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>
To: ptxdist@pengutronix.de
Cc: Ivo Sieben <meltedpianoman@gmail.com>
Subject: [ptxdist] [PATCH] u-boot: Add option to install u-boot environment tools on target
Date: Mon, 28 May 2012 14:42:38 +0200	[thread overview]
Message-ID: <1338208981-8681-12-git-send-email-bartvdrmeulen@gmail.com> (raw)

From: Remy Bohmer <linux@bohmer.net>

Add config option that can be used to install u-boot tools on target
Current tools that can be selected:
- fw_setenv
- fw_printenv
- gen_eth_addr

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com>
---
 platforms/u-boot.in |    6 ++++++
 rules/u-boot.make   |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index e5401d6..f3a7a63 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -79,5 +79,11 @@ config U_BOOT_INSTALL_U_BOOT_IMG

 endif

+config U_BOOT_INSTALL_TOOLS
+	prompt "install u-boot userspace tools"
+	bool
+	help
+	  Installs the u-boot user space tools (fw_printenv, fw_setenv &
+	  gen_eth_addr) tools in the target image.
 endif

diff --git a/rules/u-boot.make b/rules/u-boot.make
index 36760ee..7ab9959 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -50,11 +50,30 @@ $(STATEDIR)/u-boot.prepare:
 	@$(call touch)

 # ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/u-boot.compile:
+	@$(call targetinfo)
+	@$(call world/compile,U_BOOT)
+ifdef PTXCONF_U_BOOT_INSTALL_TOOLS
+	@cd $(U_BOOT_DIR) && make env CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) HOSTCC=$(PTXCONF_GNU_TARGET)-gcc
+	@cd $(U_BOOT_DIR) && make eth CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) HOSTCC=$(PTXCONF_GNU_TARGET)-gcc
+endif
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------

 $(STATEDIR)/u-boot.install:
 	@$(call targetinfo)
+ifdef PTXCONF_U_BOOT_INSTALL_TOOLS
+	@mkdir -p $(U_BOOT_PKGDIR)/usr/bin/ $(U_BOOT_PKGDIR)/etc/
+	@install -D -m 755 $(U_BOOT_DIR)/tools/env/fw_printenv $(U_BOOT_PKGDIR)/usr/bin/
+	@ln -sf fw_printenv $(U_BOOT_PKGDIR)/usr/bin/fw_setenv
+	@install -D -m 755 $(U_BOOT_DIR)/tools/eth/gen_eth_addr $(U_BOOT_PKGDIR)/usr/bin/
+endif
 	@$(call touch)

 # ----------------------------------------------------------------------------
@@ -76,6 +95,21 @@ endif
 ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMG
 	@install -D -m644 $(U_BOOT_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img
 endif
+
+ifdef PTXCONF_U_BOOT_INSTALL_TOOLS
+	@$(call install_init, u-boot)
+	@$(call install_fixup, u-boot,PRIORITY,optional)
+	@$(call install_fixup, u-boot,SECTION,base)
+	@$(call install_fixup, u-boot,AUTHOR,"Remy Bohmer <linux@bohmer.net>")
+	@$(call install_fixup, u-boot,DESCRIPTION,missing)
+
+	@$(call install_copy, u-boot, 0, 0, 0755, -, /usr/bin/fw_printenv)
+	@$(call install_link, u-boot, fw_printenv, /usr/bin/fw_setenv)
+	@$(call install_copy, u-boot, 0, 0, 0755, -, /usr/bin/gen_eth_addr)
+
+	@$(call install_finish, u-boot)
+endif
+
 	@$(call touch)

 # ----------------------------------------------------------------------------
--
1.7.9.5


-- 
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2012-05-28 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 12:42 Bart vdr. Meulen [this message]
2012-05-29  8:31 ` Alexander Dahl
2012-05-29 15:34   ` Bart van der Meulen

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=1338208981-8681-12-git-send-email-bartvdrmeulen@gmail.com \
    --to=bartvdrmeulen@gmail.com \
    --cc=meltedpianoman@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /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