Re: [ptxdist] [RFC] Build MLO from barebox sources
On Thu, Feb 23, 2012 at 08:47:39AM +0100, Jan Weitzel wrote: Am Donnerstag, den 23.02.2012, 08:31 +0100 schrieb Jan Weitzel: [...] +# +# Extract +# +$(STATEDIR)/barebox_mlo.extract: + @$(call targetinfo) + @$(call clean, $(BAREBOX_MLO_DIR)) + @mkdir -p $(BAREBOX_MLO_DIR) + @$(call extract, BAREBOX_MLO) + @$(call patchin, BAREBOX, $(BAREBOX_MLO_DIR)) I saw this is deprecated, is there an other way to get the BAREBOX patchstack? With @$(call patchin, BAREBOX_MLO) I got: extract: pkg_src=/home/ptxdist_src/barebox-2011.12.0.tar.bz2 extract: pkg_extract_dir=BSP-Phytec-phyCARD-XL2/platform-phyCARD-XL2/build-target/barebox_mlo-2011.12.0 patchin: no patches found BAREBOX_MLO_VERSION = $(BAREBOX_VERSION) BAREBOX_MLO = $(BAREBOX) BAREBOX_MLO_DIR = $(BUILDDIR)/barebox_mlo-$(BAREBOX_MLO_VERSION) I think. Then you can remove the extract stage. Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [RFC] Build MLO from barebox sources
On Thu, Feb 23, 2012 at 08:31:12AM +0100, Jan Weitzel wrote: Build MLO in $(BUILDDIR)/barebox_mlo-* with config PTXCONF_BAREBOX_MLO_CONFIG Default config is barebox_mlo.config. Signed-off-by: Jan Weitzel j.weit...@phytec.de --- platforms/barebox_mlo.in | 19 +++ rules/barebox_mlo.make | 124 ++ 2 files changed, 143 insertions(+), 0 deletions(-) create mode 100644 platforms/barebox_mlo.in create mode 100644 rules/barebox_mlo.make diff --git a/platforms/barebox_mlo.in b/platforms/barebox_mlo.in new file mode 100644 index 000..f1e9c78 --- /dev/null +++ b/platforms/barebox_mlo.in @@ -0,0 +1,19 @@ +## SECTION=bootloader + +menuconfig BAREBOX_MLO + prompt barebox mlo + bool + depends on BAREBOX + help + Build mlo from barebox sources. + +if BAREBOX_MLO + +config BAREBOX_MLO_CONFIG + prompt mlo config file + string + default barebox_mlo.config + help + This entry specifies the .config file used to compile mlo. + +endif diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make new file mode 100644 index 000..12e8743 --- /dev/null +++ b/rules/barebox_mlo.make @@ -0,0 +1,124 @@ +# -*-makefile-*- +# +# Copyright (C) 2012 Jan Weitzel j.weit...@phytec.de +# based on barebox.make +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_BAREBOX_MLO) += barebox_mlo + +# +# Paths and names +# +BAREBOX_MLO_VERSION = $(BAREBOX_VERSION) +BAREBOX_MLO = barebox_mlo-$(BAREBOX_MLO_VERSION) +BAREBOX_MLO_DIR = $(BUILDDIR)/$(BAREBOX_MLO) +BAREBOX_MLO_SOURCE = $(BAREBOX_SOURCE) +BAREBOX_MLO_LICENSE := GPLv2 + +BAREBOX_MLO_CONFIG := $(call remove_quotes, $(PTXDIST_PLATFORMCONFIGDIR)/$(PTXCONF_BAREBOX_MLO_CONFIG)) + +# +# Get +# +$(STATEDIR)/barebox_mlo.get: $(STATEDIR)/barebox.get + @$(call targetinfo) + @$(call touch) No need for a get stage. The implicit rules and dependencies can handle multiple packages with the same source. + +# +# Extract +# +$(STATEDIR)/barebox_mlo.extract: + @$(call targetinfo) + @$(call clean, $(BAREBOX_MLO_DIR)) + @mkdir -p $(BAREBOX_MLO_DIR) + @$(call extract, BAREBOX_MLO) + @$(call patchin, BAREBOX, $(BAREBOX_MLO_DIR)) + @$(call touch) see my other mail. + +# +# Prepare +# + +BAREBOX_MLO_PATH := PATH=$(CROSS_PATH) not needed. +BAREBOX_MLO_ENV := KCONFIG_NOTIMESTAMP=1 BAREBOX_MLO_CONF_ENV +BAREBOX_MLO_MAKEVARS := \ + HOSTCC=$(HOSTCC) \ + ARCH=$(PTXCONF_BAREBOX_ARCH_STRING) \ + CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) use BAREBOX_MLO_CONF_OPT here. +$(STATEDIR)/barebox_mlo.prepare: $(BAREBOX_MLO_CONFIG) + @$(call targetinfo) + + @echo Using barebox_mlo config file: $(BAREBOX_MLO_CONFIG) + @install -m 644 $(BAREBOX_MLO_CONFIG) $(BAREBOX_MLO_DIR)/.config + + @$(call ptx/oldconfig, BAREBOX_MLO) + + @$(call touch) Please try removing the prepare stage. There is a default oldconfig prepare stage that is used if PKG_CONF_TOOL=kconfig or PKG_CONFIG is set. + +# +# Compile +# + +$(STATEDIR)/barebox_mlo.compile: + @$(call targetinfo) + cd $(BAREBOX_MLO_DIR) $(BAREBOX_MLO_PATH) $(MAKE) $(BAREBOX_MLO_MAKEVARS) + @$(call touch) The default stage should do the right thing here too. Maybe with BAREBOX_MLO_MAKE_OPT := $(BAREBOX_MLO_CONF_OPT) + +# +# Install +# + +$(STATEDIR)/barebox_mlo.install: + @$(call targetinfo) + @$(call touch) + +# +# Target-Install +# + +$(STATEDIR)/barebox_mlo.targetinstall: + @$(call targetinfo) +#barebox renamed barebox.bin.ift to MLO, so fall back to barebox.bin.ift # # comment + @if test -e $(BAREBOX_MLO_DIR)/MLO; then \ + install -D -m644
Re: [ptxdist] [RFC] Build MLO from barebox sources
Am Donnerstag, den 23.02.2012, 10:40 +0100 schrieb Michael Olbrich: On Thu, Feb 23, 2012 at 08:47:39AM +0100, Jan Weitzel wrote: Am Donnerstag, den 23.02.2012, 08:31 +0100 schrieb Jan Weitzel: [...] +# +# Extract +# +$(STATEDIR)/barebox_mlo.extract: + @$(call targetinfo) + @$(call clean, $(BAREBOX_MLO_DIR)) + @mkdir -p $(BAREBOX_MLO_DIR) + @$(call extract, BAREBOX_MLO) + @$(call patchin, BAREBOX, $(BAREBOX_MLO_DIR)) I saw this is deprecated, is there an other way to get the BAREBOX patchstack? With @$(call patchin, BAREBOX_MLO) I got: extract: pkg_src=/home/ptxdist_src/barebox-2011.12.0.tar.bz2 extract:. pkg_extract_dir=BSP-Phytec-phyCARD-XL2/platform-phyCARD-XL2/build-target/barebox_mlo-2011.12.0 patchin: no patches found BAREBOX_MLO_VERSION = $(BAREBOX_VERSION) BAREBOX_MLO = $(BAREBOX) BAREBOX_MLO_DIR = $(BUILDDIR)/barebox_mlo-$(BAREBOX_MLO_VERSION) I think. Then you can remove the extract stage. Michael Thank you very much. Feel free to put your name into the rule ;) Jan -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [RFC] Build MLO from barebox sources
Am Donnerstag, den 23.02.2012, 08:31 +0100 schrieb Jan Weitzel: Build MLO in $(BUILDDIR)/barebox_mlo-* with config PTXCONF_BAREBOX_MLO_CONFIG Default config is barebox_mlo.config. Signed-off-by: Jan Weitzel j.weit...@phytec.de --- platforms/barebox_mlo.in | 19 +++ rules/barebox_mlo.make | 124 ++ 2 files changed, 143 insertions(+), 0 deletions(-) create mode 100644 platforms/barebox_mlo.in create mode 100644 rules/barebox_mlo.make diff --git a/platforms/barebox_mlo.in b/platforms/barebox_mlo.in new file mode 100644 index 000..f1e9c78 --- /dev/null +++ b/platforms/barebox_mlo.in @@ -0,0 +1,19 @@ +## SECTION=bootloader + +menuconfig BAREBOX_MLO + prompt barebox mlo + bool + depends on BAREBOX + help + Build mlo from barebox sources. + +if BAREBOX_MLO + +config BAREBOX_MLO_CONFIG + prompt mlo config file + string + default barebox_mlo.config + help + This entry specifies the .config file used to compile mlo. + +endif diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make new file mode 100644 index 000..12e8743 --- /dev/null +++ b/rules/barebox_mlo.make @@ -0,0 +1,124 @@ +# -*-makefile-*- +# +# Copyright (C) 2012 Jan Weitzel j.weit...@phytec.de +# based on barebox.make +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_BAREBOX_MLO) += barebox_mlo + +# +# Paths and names +# +BAREBOX_MLO_VERSION = $(BAREBOX_VERSION) +BAREBOX_MLO = barebox_mlo-$(BAREBOX_MLO_VERSION) +BAREBOX_MLO_DIR = $(BUILDDIR)/$(BAREBOX_MLO) +BAREBOX_MLO_SOURCE = $(BAREBOX_SOURCE) +BAREBOX_MLO_LICENSE := GPLv2 + +BAREBOX_MLO_CONFIG := $(call remove_quotes, $(PTXDIST_PLATFORMCONFIGDIR)/$(PTXCONF_BAREBOX_MLO_CONFIG)) + +# +# Get +# +$(STATEDIR)/barebox_mlo.get: $(STATEDIR)/barebox.get + @$(call targetinfo) + @$(call touch) + +# +# Extract +# +$(STATEDIR)/barebox_mlo.extract: + @$(call targetinfo) + @$(call clean, $(BAREBOX_MLO_DIR)) + @mkdir -p $(BAREBOX_MLO_DIR) + @$(call extract, BAREBOX_MLO) + @$(call patchin, BAREBOX, $(BAREBOX_MLO_DIR)) I saw this is deprecated, is there an other way to get the BAREBOX patchstack? With @$(call patchin, BAREBOX_MLO) I got: extract: pkg_src=/home/ptxdist_src/barebox-2011.12.0.tar.bz2 extract: pkg_extract_dir=BSP-Phytec-phyCARD-XL2/platform-phyCARD-XL2/build-target/barebox_mlo-2011.12.0 patchin: no patches found + @$(call touch) + +# +# Prepare +# + +BAREBOX_MLO_PATH := PATH=$(CROSS_PATH) +BAREBOX_MLO_ENV := KCONFIG_NOTIMESTAMP=1 +BAREBOX_MLO_MAKEVARS := \ + HOSTCC=$(HOSTCC) \ + ARCH=$(PTXCONF_BAREBOX_ARCH_STRING) \ + CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) + +$(STATEDIR)/barebox_mlo.prepare: $(BAREBOX_MLO_CONFIG) + @$(call targetinfo) + + @echo Using barebox_mlo config file: $(BAREBOX_MLO_CONFIG) + @install -m 644 $(BAREBOX_MLO_CONFIG) $(BAREBOX_MLO_DIR)/.config + + @$(call ptx/oldconfig, BAREBOX_MLO) + + @$(call touch) + +# +# Compile +# + +$(STATEDIR)/barebox_mlo.compile: + @$(call targetinfo) + cd $(BAREBOX_MLO_DIR) $(BAREBOX_MLO_PATH) $(MAKE) $(BAREBOX_MLO_MAKEVARS) + @$(call touch) + +# +# Install +# + +$(STATEDIR)/barebox_mlo.install: + @$(call targetinfo) + @$(call touch) + +# +# Target-Install +# + +$(STATEDIR)/barebox_mlo.targetinstall: + @$(call targetinfo) +#barebox renamed barebox.bin.ift to MLO, so fall back to barebox.bin.ift + @if test -e $(BAREBOX_MLO_DIR)/MLO; then \ + install -D -m644 $(BAREBOX_MLO_DIR)/MLO $(IMAGEDIR)/MLO ; \ + else \ + install -D -m644 $(BAREBOX_MLO_DIR)/barebox.bin.ift $(IMAGEDIR)/MLO ; \ + fi + + @$(call