mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install
@ 2016-02-29 14:44 Marc Kleine-Budde
  2016-02-29 16:57 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2016-02-29 14:44 UTC (permalink / raw)
  To: ptxdist; +Cc: Marc Kleine-Budde

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install
  2016-02-29 14:44 [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install Marc Kleine-Budde
@ 2016-02-29 16:57 ` Uwe Kleine-König
  2016-03-01  7:58   ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2016-02-29 16:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Marc Kleine-Budde

$Subject ~= s/crc/crc32/ ?

On Mon, Feb 29, 2016 at 03:44:19PM +0100, Marc Kleine-Budde wrote:
> 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

s/crc/crc32/; s/auf/of/

> +	  files, with the same crc32 falvour that the barebox crc32

s/falv/flav/

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install
  2016-02-29 16:57 ` Uwe Kleine-König
@ 2016-03-01  7:58   ` Marc Kleine-Budde
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2016-03-01  7:58 UTC (permalink / raw)
  To: Uwe Kleine-König, ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 658 bytes --]

On 02/29/2016 05:57 PM, Uwe Kleine-König wrote:
> $Subject ~= s/crc/crc32/ ?

>> +config BAREBOX_BAREBOXCRC32
>> +	prompt "install 'bareboxcrc32'"
>> +	bool
>> +	help
>> +	  The tool 'bareboxcrc' can be used to calculate the crc32 auf
> 
> s/crc/crc32/; s/auf/of/
> 
>> +	  files, with the same crc32 falvour that the barebox crc32
> 
> s/falv/flav/

Danke,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-01  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-29 14:44 [ptxdist] [PATCH v2] barebox: add possibility to install: bareboxcrc, bareboximd and kernel-install Marc Kleine-Budde
2016-02-29 16:57 ` Uwe Kleine-König
2016-03-01  7:58   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox