mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install
Date: Mon, 29 Feb 2016 15:44:19 +0100	[thread overview]
Message-ID: <1456757059-12988-1-git-send-email-mkl@pengutronix.de> (raw)

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---

changed since v1:
- fix typo in commit message bareboximx -> bareboximd

Marc

 platforms/barebox.in | 23 +++++++++++++++++++++++
 rules/barebox.make   | 44 +++++++++++++++++++++++++++++++-------------
 2 files changed, 54 insertions(+), 13 deletions(-)

diff --git a/platforms/barebox.in b/platforms/barebox.in
index 9364e78473c7..87a48ad8462e 100644
--- a/platforms/barebox.in
+++ b/platforms/barebox.in
@@ -54,6 +54,29 @@ config BAREBOX_BAREBOXENV
 	  environment. Enable this option access the barebox environment
 	  from the target Linux system.
 
+config BAREBOX_BAREBOXCRC32
+	prompt "install 'bareboxcrc32'"
+	bool
+	help
+	  The tool 'bareboxcrc' can be used to calculate the crc32 auf
+	  files, with the same crc32 falvour that the barebox crc32
+	  command uses.
+
+config BAREBOX_KERNEL_INSTALL
+	prompt "install 'kernel-install'"
+	bool
+	help
+	  The tool 'kernel-install' can be used to install a kernel
+	  according to the bootloader spec:
+	  http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/
+
+config BAREBOX_BAREBOXIMD
+	prompt "install 'bareboximd'"
+	bool
+	help
+	  The tool 'bareboximd' can be used to extract metadata from
+	  the (flashed) barebox image.
+
 config BAREBOX_NEEDS_HOST_LIBUSB
 	prompt "barebox needs libusb"
 	bool
diff --git a/rules/barebox.make b/rules/barebox.make
index 5f938db03db1..60d8e2e8bb05 100644
--- a/rules/barebox.make
+++ b/rules/barebox.make
@@ -107,18 +107,32 @@ $(STATEDIR)/barebox.compile:
 # Install
 # ----------------------------------------------------------------------------
 
+BAREBOX_PROGS_HOST := \
+	bareboxenv \
+	kernel-install \
+	bareboxcrc32 \
+	bareboximd \
+	setupmbr/setupmbr
+
+BAREBOX_PROGS_TARGET_y :=
+BAREBOX_PROGS_TARGET_$(PTXCONF_BAREBOX_BAREBOXENV) += bareboxenv
+BAREBOX_PROGS_TARGET_$(PTXCONF_BAREBOX_BAREBOXCRC32) += kernel-install
+BAREBOX_PROGS_TARGET_$(PTXCONF_BAREBOX_KERNEL_INSTALL) += bareboxcrc32
+BAREBOX_PROGS_TARGET_$(PTXCONF_BAREBOX_BAREBOXIMD) += bareboximd
+
 $(STATEDIR)/barebox.install:
 	@$(call targetinfo)
-	@install -v -D -m755 $(BAREBOX_DIR)/scripts/bareboxenv $(PTXCONF_SYSROOT_HOST)/bin/bareboxenv
-	@if [ -e $(BAREBOX_DIR)/scripts/bareboxcrc32 ]; then \
-		install -v -D -m755 $(BAREBOX_DIR)/scripts/bareboxcrc32 $(PTXCONF_SYSROOT_HOST)/bin/bareboxcrc32; \
-	fi
-ifdef PTXCONF_ARCH_X86
-	@if [ -e $(BAREBOX_DIR)/scripts/setupmbr/setupmbr ]; then \
-		install -v -D -m755 $(BAREBOX_DIR)/scripts/setupmbr/setupmbr \
-			$(PTXCONF_SYSROOT_HOST)/bin/setupmbr; \
-	fi
-endif
+
+	@$(foreach prog, $(BAREBOX_PROGS_HOST), \
+		if [ -e $(BAREBOX_DIR)/scripts/$(prog) ]; then \
+			install -v -D -m755 $(BAREBOX_DIR)/scripts/$(prog) \
+				$(PTXCONF_SYSROOT_HOST)/bin/$(notdir $(prog)); \
+		fi;)
+
+	@$(foreach prog, $(BAREBOX_PROGS_TARGET_y), \
+		install -v -D -m755 $(BAREBOX_DIR)/scripts/$(prog)-target \
+			$(BAREBOX_PKGDIR)/usr/bin/$(prog);)
+
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
@@ -128,18 +142,20 @@ endif
 $(STATEDIR)/barebox.targetinstall:
 	@$(call targetinfo)
 
-ifdef PTXCONF_BAREBOX_BAREBOXENV
+ifneq ($(strip $(BAREBOX_PROGS_TARGET_y)),)
 	@$(call install_init, barebox)
 	@$(call install_fixup, barebox,PRIORITY,optional)
 	@$(call install_fixup, barebox,SECTION,base)
 	@$(call install_fixup, barebox,AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
 	@$(call install_fixup, barebox,DESCRIPTION,missing)
 
-	@$(call install_copy, barebox, 0, 0, 0755, $(BAREBOX_DIR)/scripts/bareboxenv-target, \
-		/usr/bin/bareboxenv)
+	@$(foreach prog, $(BAREBOX_PROGS_TARGET_y), \
+		$(call install_copy, barebox, 0, 0, 0755, -, \
+			/usr/bin/$(prog));)
 
 	@$(call install_finish, barebox)
 endif
+
 	@rm -f $(IMAGEDIR)/barebox-image
 	@find $(BAREBOX_DIR)/images/ -name "barebox-*.img" | sort | while read image; do \
 		install -D -m644 $$image $(IMAGEDIR)/`basename $$image`; \
@@ -170,6 +186,8 @@ endif
 $(STATEDIR)/barebox.clean:
 	@$(call targetinfo)
 	@$(call clean_pkg, BAREBOX)
+	@$(foreach prog, $(BAREBOX_PROGS_HOST), \
+		rm -rf $(PTXCONF_SYSROOT_HOST)/bin/$(notdir $(prog));)
 	rm -rf $(IMAGEDIR)/barebox-image $(IMAGEDIR)/barebox-default-environment
 
 # ----------------------------------------------------------------------------
-- 
2.7.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2016-02-29 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 14:44 Marc Kleine-Budde [this message]
2016-02-29 16:57 ` Uwe Kleine-König
2016-03-01  7:58   ` Marc Kleine-Budde

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=1456757059-12988-1-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --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