All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
@ 2016-03-20 22:35 Pieter Smith
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
                   ` (8 more replies)
  0 siblings, 9 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

This patch-set adds support for building barebox with up to 2 configurations.
It can be used to build the barebox x-loader or MLO (also called Secondary
Program Loader) in addition to the standard barebox build (Tertiary Program
Loader). This implements the design proposed in
http://elinux.org/Buildroot#Todo_list, with minor adjustments:
1. Have boot/barebox/barebox.mk contain the common stuff.
2. Add a second package boot/barebox/barebox-2.
3. There is only one version selection, but each package allows to
   define the configuration to be used.
4. Design is a little bit like package/gcc, where we have multiple gcc builds,
   but share a lot of common definitions between the packages.

To demonstrate that it works as advertized, the last patch adds a defconfig for
the beaglebone that makes use of the added functionality.

Revision history:
v4: Introduces barebox-package function to reduce duplication and maintenance
    Simplifies built image selection
    Ease review with smaller patches
    Review re-work: Special thanks to Arnout Vandecappelle and Yegor Yefremov
v3: Updated for master at 544e2c5871f223facd1ab3c2853cd07ad70dd9d1
v2: Dropped x-loader build specialization in favor of 2 generic barebox builds
v1: Initial posting

Pieter Smith (7):
  barebox: support multi-image-build image selection
  barebox: friendly error on missing built image
  barebox: support custom barebox output image name
  barebox: introduce barebox-package function
  barebox: extract package name argument
  barebox: support 2nd config build
  beaglebone: adds barebox bootloader defconfig

 board/beaglebone/barebox.env/boot/sd      |   6 +
 board/beaglebone/barebox.env/config-board |   4 +
 boot/barebox/Config.in                    |  18 +++
 boot/barebox/barebox-2/Config.in          |  79 +++++++++++++
 boot/barebox/barebox-2/barebox-2.hash     |   1 +
 boot/barebox/barebox-2/barebox-2.mk       |   9 ++
 boot/barebox/barebox.mk                   | 178 ++++++++++++++++++------------
 configs/beaglebone_barebox_defconfig      |  41 +++++++
 8 files changed, 266 insertions(+), 70 deletions(-)
 create mode 100644 board/beaglebone/barebox.env/boot/sd
 create mode 100644 board/beaglebone/barebox.env/config-board
 create mode 100644 boot/barebox/barebox-2/Config.in
 create mode 120000 boot/barebox/barebox-2/barebox-2.hash
 create mode 100644 boot/barebox/barebox-2/barebox-2.mk
 create mode 100644 configs/beaglebone_barebox_defconfig

-- 
2.5.0

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  5:44   ` Yegor Yefremov
                     ` (2 more replies)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image Pieter Smith
                   ` (7 subsequent siblings)
  8 siblings, 3 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

Support selection of the built image filename in a multi-image barebox build.
This makes it possible to specify which image to pick in a in a multi-image
barebox config such as the am335x_defconfig.

The specified image can either be located in the barebox build directory or the
barebox build images directory.

For compatibility with contemporary barbox builds, a sane default has been
chosen. For barebox versions older than 2012.10, the user will have to specify
'barebox.bin'.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in  | 9 +++++++++
 boot/barebox/barebox.mk | 9 ++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index bbe6ae2..4f6872c 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -97,6 +97,15 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
 	  A space-separated list of configuration fragment files,
 	  that will be merged to the main Barebox configuration file.
 
+config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
+	string "Built image filename"
+	default "barebox-flash-image"
+	help
+	  Name of the built barebox image filename in the barebox build or
+	  build images directory.
+
+	  Set to barebox.bin for barebox versions older than 2012.10.
+
 config BR2_TARGET_BAREBOX_BAREBOXENV
 	bool "bareboxenv tool in target"
 	help
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 7715daf..2a3b724 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -92,10 +92,10 @@ define BAREBOX_BUILD_CMDS
 endef
 
 define BAREBOX_INSTALL_IMAGES_CMDS
-	if test -h $(@D)/barebox-flash-image ; then \
-		cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
+	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
+		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
 	else \
-		cp $(@D)/barebox.bin $(BINARIES_DIR);\
+		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
 	fi
 	$(BAREBOX_INSTALL_CUSTOM_ENV)
 endef
@@ -115,6 +115,9 @@ ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
 ifeq ($(or $(BAREBOX_KCONFIG_FILE),$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
 $(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
 endif
+ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
+$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
+endif
 endif
 
 $(eval $(kconfig-package))
-- 
2.5.0

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

* [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:01   ` Yegor Yefremov
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

Gives the user a friendly error to help him troubleshoot missing built barebox
image.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/barebox.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 2a3b724..d0f28cf 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -94,8 +94,14 @@ endef
 define BAREBOX_INSTALL_IMAGES_CMDS
 	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
 		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
-	else \
+	elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
 		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
+	else \
+		echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
+		echo "       in: $(@D)/" >&2 ; \
+		echo "       or: $(@D)/images/" >&2 ; \
+		echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
+		exit 1 ; \
 	fi
 	$(BAREBOX_INSTALL_CUSTOM_ENV)
 endef
-- 
2.5.0

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:03   ` Yegor Yefremov
                     ` (2 more replies)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
                   ` (5 subsequent siblings)
  8 siblings, 3 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

In preparation for building a 2nd barebox config, a configuration option is
added to allow customization of the image filename when the built image is
copied to the output/images directory.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in  | 7 +++++++
 boot/barebox/barebox.mk | 9 +++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 4f6872c..7769866 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -106,6 +106,13 @@ config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
 
 	  Set to barebox.bin for barebox versions older than 2012.10.
 
+config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
+	string "Output image filename"
+	default "barebox.bin"
+	help
+	  Name to use when copying the barebox image to the output/images
+	  directory.
+
 config BR2_TARGET_BAREBOX_BAREBOXENV
 	bool "bareboxenv tool in target"
 	help
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index d0f28cf..4eea470 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -93,9 +93,11 @@ endef
 
 define BAREBOX_INSTALL_IMAGES_CMDS
 	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
+		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
+		      $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
 	elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
+		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
+		   $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
 	else \
 		echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
 		echo "       in: $(@D)/" >&2 ; \
@@ -124,6 +126,9 @@ endif
 ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
 $(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
 endif
+ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
+$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
+endif
 endif
 
 $(eval $(kconfig-package))
-- 
2.5.0

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

* [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (2 preceding siblings ...)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:12   ` Yegor Yefremov
                     ` (2 more replies)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 5/7] barebox: extract package name argument Pieter Smith
                   ` (4 subsequent siblings)
  8 siblings, 3 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

No functional changes: Introduces a barebox-package function towards re-use by
a 2nd config build.

Because the function is meant to be called from within a $(eval), all instances
of '$' has to be escaped. I.e. rename '$' -> '$$'.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/barebox.mk | 134 +++++++++++++++++++++++++++---------------------
 1 file changed, 76 insertions(+), 58 deletions(-)

diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 4eea470..d84c479 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -4,23 +4,31 @@
 #
 ################################################################################
 
-BAREBOX_VERSION = $(call qstrip,$(BR2_TARGET_BAREBOX_VERSION))
+################################################################################
+# inner-barebox-package -- generates the KConfig logic and make targets needed
+# to support a barebox package. All barebox packages are built from the same
+# source (origin, version and patches).
+################################################################################
+
+define inner-barebox-package
 
-ifeq ($(BAREBOX_VERSION),custom)
+BAREBOX_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
+
+ifeq ($$(BAREBOX_VERSION),custom)
 # Handle custom Barebox tarballs as specified by the configuration
-BAREBOX_TARBALL = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
-BAREBOX_SITE = $(patsubst %/,%,$(dir $(BAREBOX_TARBALL)))
-BAREBOX_SOURCE = $(notdir $(BAREBOX_TARBALL))
-BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
-else ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
-BAREBOX_SITE = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
+BAREBOX_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
+BAREBOX_SITE = $$(patsubst %/,%,$$(dir $$(BAREBOX_TARBALL)))
+BAREBOX_SOURCE = $$(notdir $$(BAREBOX_TARBALL))
+BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
+else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
+BAREBOX_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
 BAREBOX_SITE_METHOD = git
 else
 # Handle stable official Barebox versions
-BAREBOX_SOURCE = barebox-$(BAREBOX_VERSION).tar.bz2
+BAREBOX_SOURCE = barebox-$$(BAREBOX_VERSION).tar.bz2
 BAREBOX_SITE = http://www.barebox.org/download
-ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
-BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
+ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
+BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
 endif
 endif
 
@@ -28,107 +36,117 @@ BAREBOX_DEPENDENCIES = host-lzop
 BAREBOX_LICENSE = GPLv2 with exceptions
 BAREBOX_LICENSE_FILES = COPYING
 
-ifneq ($(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
+ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
 define BAREBOX_APPLY_CUSTOM_PATCHES
-	$(APPLY_PATCHES) $(@D) \
-		$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
+	$$(APPLY_PATCHES) $$(@D) \
+		$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
 endef
 
 BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
 endif
 
 BAREBOX_INSTALL_IMAGES = YES
-ifneq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
+ifneq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
 BAREBOX_INSTALL_TARGET = NO
 endif
 
-ifeq ($(KERNEL_ARCH),i386)
+ifeq ($$(KERNEL_ARCH),i386)
 BAREBOX_ARCH = x86
-else ifeq ($(KERNEL_ARCH),x86_64)
+else ifeq ($$(KERNEL_ARCH),x86_64)
 BAREBOX_ARCH = x86
-else ifeq ($(KERNEL_ARCH),powerpc)
+else ifeq ($$(KERNEL_ARCH),powerpc)
 BAREBOX_ARCH = ppc
 else
-BAREBOX_ARCH = $(KERNEL_ARCH)
+BAREBOX_ARCH = $$(KERNEL_ARCH)
 endif
 
-BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(TARGET_CROSS)"
-BAREBOX_MAKE_ENV = $(TARGET_MAKE_ENV)
+BAREBOX_MAKE_FLAGS = ARCH=$$(BAREBOX_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
+BAREBOX_MAKE_ENV = $$(TARGET_MAKE_ENV)
 
-ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
-BAREBOX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
-else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
-BAREBOX_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
+ifeq ($$(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
+BAREBOX_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
+else ifeq ($$(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
+BAREBOX_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
 endif
 
-BAREBOX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
+BAREBOX_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
 BAREBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
-BAREBOX_KCONFIG_OPTS = $(BAREBOX_MAKE_FLAGS)
+BAREBOX_KCONFIG_OPTS = $$(BAREBOX_MAKE_FLAGS)
 
-ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
+ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
 define BAREBOX_BUILD_BAREBOXENV_CMDS
-	$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $(@D)/bareboxenv \
-		$(@D)/scripts/bareboxenv.c
+	$$(TARGET_CC) $$(TARGET_CFLAGS) $$(TARGET_LDFLAGS) -o $$(@D)/bareboxenv \
+		$$(@D)/scripts/bareboxenv.c
 endef
 endif
 
-ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
-BAREBOX_ENV_NAME = $(notdir $(call qstrip,\
-	$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
+ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
+BAREBOX_ENV_NAME = $$(notdir $$(call qstrip,\
+	$$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
 define BAREBOX_BUILD_CUSTOM_ENV
-	$(@D)/scripts/bareboxenv -s \
-		$(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
-		$(@D)/$(BAREBOX_ENV_NAME)
+	$$(@D)/scripts/bareboxenv -s \
+		$$(call qstrip, $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
+		$$(@D)/$$(BAREBOX_ENV_NAME)
 endef
 define BAREBOX_INSTALL_CUSTOM_ENV
-	cp $(@D)/$(BAREBOX_ENV_NAME) $(BINARIES_DIR)
+	cp $$(@D)/$$(BAREBOX_ENV_NAME) $$(BINARIES_DIR)
 endef
 endif
 
 define BAREBOX_BUILD_CMDS
-	$(BAREBOX_BUILD_BAREBOXENV_CMDS)
-	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D)
-	$(BAREBOX_BUILD_CUSTOM_ENV)
+	$$(BAREBOX_BUILD_BAREBOXENV_CMDS)
+	$$(TARGET_MAKE_ENV) $$(MAKE) $$(BAREBOX_MAKE_FLAGS) -C $$(@D)
+	$$(BAREBOX_BUILD_CUSTOM_ENV)
 endef
 
 define BAREBOX_INSTALL_IMAGES_CMDS
-	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
-		      $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
-	elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
-		   $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
+	if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
+		cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
+		      $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
+	elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
+		cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
+		   $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
 	else \
-		echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
-		echo "       in: $(@D)/" >&2 ; \
-		echo "       or: $(@D)/images/" >&2 ; \
+		echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
+		echo "       in: $$(@D)/" >&2 ; \
+		echo "       or: $$(@D)/images/" >&2 ; \
 		echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
 		exit 1 ; \
 	fi
-	$(BAREBOX_INSTALL_CUSTOM_ENV)
+	$$(BAREBOX_INSTALL_CUSTOM_ENV)
 endef
 
-ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
+ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
 define BAREBOX_INSTALL_TARGET_CMDS
-	cp $(@D)/bareboxenv $(TARGET_DIR)/usr/bin
+	cp $$(@D)/bareboxenv $$(TARGET_DIR)/usr/bin
 endef
 endif
 
 # Checks to give errors that the user can understand
 # Must be before we call to kconfig-package
-ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
+ifeq ($$(BR2_TARGET_BAREBOX)$$(BR_BUILDING),yy)
 # We must use the user-supplied kconfig value, because
 # BAREBOX_KCONFIG_DEFCONFIG will at least contain the
 # trailing _defconfig
-ifeq ($(or $(BAREBOX_KCONFIG_FILE),$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
-$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
+ifeq ($$(or $$(BAREBOX_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
+$$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
 endif
 ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
-$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
+$$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
 endif
 ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
-$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
+$$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
 endif
 endif
 
-$(eval $(kconfig-package))
+$$(eval $$(kconfig-package))
+endef
+
+################################################################################
+# barebox-package -- the target generator macro for barebox packages
+################################################################################
+
+barebox-package=$(call inner-barebox-package)
+
+# instantiate this barebox package
+$(eval $(call barebox-package))
-- 
2.5.0

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

* [Buildroot] [PATCH v4 5/7] barebox: extract package name argument
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (3 preceding siblings ...)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:16   ` Yegor Yefremov
  2016-04-04 23:01   ` Arnout Vandecappelle
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build Pieter Smith
                   ` (3 subsequent siblings)
  8 siblings, 2 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

No functional changes: Extracts an argument to the inner-barebox-package
function to automatically determine the uppercase package name. This is needed
to support a 2nd config build. This results in the following renaming:
  'BAREBOX' -> '$(1)'

All barebox packages are meant to be built from the same sources, so related
KConfig variables (origin, version and patch directory) are not extracted.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/barebox.mk | 139 +++++++++++++++++++++++++-----------------------
 1 file changed, 71 insertions(+), 68 deletions(-)

diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index d84c479..8892ab5 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -7,135 +7,138 @@
 ################################################################################
 # inner-barebox-package -- generates the KConfig logic and make targets needed
 # to support a barebox package. All barebox packages are built from the same
-# source (origin, version and patches).
+# source (origin, version and patches). The remainder of the package
+# configuration is unique to each barebox package.
+#
+#  argument 1 is the uppercase package name (used for variable name-space)
 ################################################################################
 
 define inner-barebox-package
 
-BAREBOX_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
+$(1)_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
 
-ifeq ($$(BAREBOX_VERSION),custom)
+ifeq ($$($(1)_VERSION),custom)
 # Handle custom Barebox tarballs as specified by the configuration
-BAREBOX_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
-BAREBOX_SITE = $$(patsubst %/,%,$$(dir $$(BAREBOX_TARBALL)))
-BAREBOX_SOURCE = $$(notdir $$(BAREBOX_TARBALL))
-BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
+$(1)_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
+$(1)_SITE = $$(patsubst %/,%,$$(dir $$($(1)_TARBALL)))
+$(1)_SOURCE = $$(notdir $$($(1)_TARBALL))
+BR_NO_CHECK_HASH_FOR += $$($(1)_SOURCE)
 else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
-BAREBOX_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
-BAREBOX_SITE_METHOD = git
+$(1)_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
+$(1)_SITE_METHOD = git
 else
 # Handle stable official Barebox versions
-BAREBOX_SOURCE = barebox-$$(BAREBOX_VERSION).tar.bz2
-BAREBOX_SITE = http://www.barebox.org/download
+$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
+$(1)_SITE = http://www.barebox.org/download
 ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
-BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
+BR_NO_CHECK_HASH_FOR += $$($(1)_SOURCE)
 endif
 endif
 
-BAREBOX_DEPENDENCIES = host-lzop
-BAREBOX_LICENSE = GPLv2 with exceptions
-BAREBOX_LICENSE_FILES = COPYING
+$(1)_DEPENDENCIES = host-lzop
+$(1)_LICENSE = GPLv2 with exceptions
+$(1)_LICENSE_FILES = COPYING
 
 ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
-define BAREBOX_APPLY_CUSTOM_PATCHES
+define $(1)_APPLY_CUSTOM_PATCHES
 	$$(APPLY_PATCHES) $$(@D) \
 		$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
 endef
 
-BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
+$(1)_POST_PATCH_HOOKS += $(1)_APPLY_CUSTOM_PATCHES
 endif
 
-BAREBOX_INSTALL_IMAGES = YES
-ifneq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
-BAREBOX_INSTALL_TARGET = NO
+$(1)_INSTALL_IMAGES = YES
+ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
+$(1)_INSTALL_TARGET = NO
 endif
 
 ifeq ($$(KERNEL_ARCH),i386)
-BAREBOX_ARCH = x86
+$(1)_ARCH = x86
 else ifeq ($$(KERNEL_ARCH),x86_64)
-BAREBOX_ARCH = x86
+$(1)_ARCH = x86
 else ifeq ($$(KERNEL_ARCH),powerpc)
-BAREBOX_ARCH = ppc
+$(1)_ARCH = ppc
 else
-BAREBOX_ARCH = $$(KERNEL_ARCH)
+$(1)_ARCH = $$(KERNEL_ARCH)
 endif
 
-BAREBOX_MAKE_FLAGS = ARCH=$$(BAREBOX_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
-BAREBOX_MAKE_ENV = $$(TARGET_MAKE_ENV)
+$(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
+$(1)_MAKE_ENV = $$(TARGET_MAKE_ENV)
 
-ifeq ($$(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
-BAREBOX_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
-else ifeq ($$(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
-BAREBOX_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
+ifeq ($$(BR2_TARGET_$(1)_USE_DEFCONFIG),y)
+$(1)_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))_defconfig
+else ifeq ($$(BR2_TARGET_$(1)_USE_CUSTOM_CONFIG),y)
+$(1)_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE))
 endif
 
-BAREBOX_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
-BAREBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
-BAREBOX_KCONFIG_OPTS = $$(BAREBOX_MAKE_FLAGS)
+$(1)_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_CONFIG_FRAGMENT_FILES))
+$(1)_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
+$(1)_KCONFIG_OPTS = $$($(1)_MAKE_FLAGS)
 
-ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
-define BAREBOX_BUILD_BAREBOXENV_CMDS
+ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
+define $(1)_BUILD_BAREBOXENV_CMDS
 	$$(TARGET_CC) $$(TARGET_CFLAGS) $$(TARGET_LDFLAGS) -o $$(@D)/bareboxenv \
 		$$(@D)/scripts/bareboxenv.c
 endef
 endif
 
-ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
-BAREBOX_ENV_NAME = $$(notdir $$(call qstrip,\
-	$$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
-define BAREBOX_BUILD_CUSTOM_ENV
+ifeq ($$(BR2_TARGET_$(1)_CUSTOM_ENV),y)
+$(1)_ENV_NAME = $$(notdir $$(call qstrip,\
+	$$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)))
+define $(1)_BUILD_CUSTOM_ENV
 	$$(@D)/scripts/bareboxenv -s \
-		$$(call qstrip, $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
-		$$(@D)/$$(BAREBOX_ENV_NAME)
+		$$(call qstrip, $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)) \
+		$$(@D)/$$($(1)_ENV_NAME)
 endef
-define BAREBOX_INSTALL_CUSTOM_ENV
-	cp $$(@D)/$$(BAREBOX_ENV_NAME) $$(BINARIES_DIR)
+define $(1)_INSTALL_CUSTOM_ENV
+	cp $$(@D)/$$($(1)_ENV_NAME) $$(BINARIES_DIR)
 endef
 endif
 
-define BAREBOX_BUILD_CMDS
-	$$(BAREBOX_BUILD_BAREBOXENV_CMDS)
-	$$(TARGET_MAKE_ENV) $$(MAKE) $$(BAREBOX_MAKE_FLAGS) -C $$(@D)
-	$$(BAREBOX_BUILD_CUSTOM_ENV)
+define $(1)_BUILD_CMDS
+	$$($(1)_BUILD_BAREBOXENV_CMDS)
+	$$(TARGET_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
+	$$($(1)_BUILD_CUSTOM_ENV)
 endef
 
-define BAREBOX_INSTALL_IMAGES_CMDS
-	if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
-		      $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
-	elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
-		cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
-		   $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
+define $(1)_INSTALL_IMAGES_CMDS
+	if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)); then \
+		cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)) \
+		      $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE)) ; \
+	elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)); then \
+		cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)) \
+		   $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE)) ; \
 	else \
-		echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
+		echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE))" >&2 ; \
 		echo "       in: $$(@D)/" >&2 ; \
 		echo "       or: $$(@D)/images/" >&2 ; \
-		echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
+		echo "       Check your BR2_TARGET_$(1)_BUILT_IMAGE_FILE setting." >&2 ; \
 		exit 1 ; \
 	fi
-	$$(BAREBOX_INSTALL_CUSTOM_ENV)
+	$$($(1)_INSTALL_CUSTOM_ENV)
 endef
 
-ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
-define BAREBOX_INSTALL_TARGET_CMDS
+ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
+define $(1)_INSTALL_TARGET_CMDS
 	cp $$(@D)/bareboxenv $$(TARGET_DIR)/usr/bin
 endef
 endif
 
 # Checks to give errors that the user can understand
 # Must be before we call to kconfig-package
-ifeq ($$(BR2_TARGET_BAREBOX)$$(BR_BUILDING),yy)
+ifeq ($$(BR2_TARGET_$(1))$$(BR_BUILDING),yy)
 # We must use the user-supplied kconfig value, because
-# BAREBOX_KCONFIG_DEFCONFIG will at least contain the
+# $(1)_KCONFIG_DEFCONFIG will at least contain the
 # trailing _defconfig
-ifeq ($$(or $$(BAREBOX_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
-$$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
+ifeq ($$(or $$($(1)_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))),)
+$$(error No Barebox config. Check your BR2_TARGET_$(1)_BOARD_DEFCONFIG or BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE settings)
 endif
-ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
-$$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
+ifndef BR2_TARGET_$(1)_BUILT_IMAGE_FILE
+$$(error No barebox built image filename specified. Check your BR2_TARGET_$(1)_BUILT_IMAGE_FILE setting)
 endif
-ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
-$$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
+ifndef BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE
+$$(error No barebox output image filename specified. Check your BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE setting)
 endif
 endif
 
@@ -146,7 +149,7 @@ endef
 # barebox-package -- the target generator macro for barebox packages
 ################################################################################
 
-barebox-package=$(call inner-barebox-package)
+barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
 
 # instantiate this barebox package
 $(eval $(call barebox-package))
-- 
2.5.0

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

* [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (4 preceding siblings ...)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 5/7] barebox: extract package name argument Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:17   ` Yegor Yefremov
  2016-04-04 23:25   ` Arnout Vandecappelle
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig Pieter Smith
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

Adds support to build barebox with a 2nd config.

This is useful for building an SPL (Secondary Program Loader) in addition to
the traditional TPL (Tertiary Program Loader). The Beaglebone Black for example
has two barebox configurations:
- am335x_defconfig builds the full barebox bootloader with device tree, and
- am335x_mlo_defconfig builds the smaller MLO bootloader that loads the full
  barebox bootloader from the eMMC or SD card.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in                |  2 +
 boot/barebox/barebox-2/Config.in      | 79 +++++++++++++++++++++++++++++++++++
 boot/barebox/barebox-2/barebox-2.hash |  1 +
 boot/barebox/barebox-2/barebox-2.mk   |  9 ++++
 boot/barebox/barebox.mk               |  3 ++
 5 files changed, 94 insertions(+)
 create mode 100644 boot/barebox/barebox-2/Config.in
 create mode 120000 boot/barebox/barebox-2/barebox-2.hash
 create mode 100644 boot/barebox/barebox-2/barebox-2.mk

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 7769866..e92cdc3 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -137,4 +137,6 @@ config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
 	  barebox devfs format, stored in the images directory, with
 	  the same name as the directory name given here.
 
+source boot/barebox/barebox-2/Config.in
+
 endif
diff --git a/boot/barebox/barebox-2/Config.in b/boot/barebox/barebox-2/Config.in
new file mode 100644
index 0000000..5bd8347
--- /dev/null
+++ b/boot/barebox/barebox-2/Config.in
@@ -0,0 +1,79 @@
+menuconfig BR2_TARGET_BAREBOX_2
+	bool "Build barebox with a 2nd config"
+	help
+	  Build barebox with a 2nd configuration.
+
+	  Useful for building an SPL (Secondary Program Loader) in addition to
+	  the traditional TPL (Tertiary Program Loader), such as the X-Loader
+	  or MLO for Texas Instruments processors.
+
+if BR2_TARGET_BAREBOX_2
+
+choice
+	prompt "Barebox configuration"
+	default BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
+
+config BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
+	bool "Using a defconfig"
+
+config BR2_TARGET_BAREBOX_2_USE_CUSTOM_CONFIG
+	bool "Using a custom config file"
+
+endchoice
+
+config BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG
+	string "board defconfig"
+	depends on BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
+	help
+	  Name of the board for which Barebox should be built, without
+	  the _defconfig suffix.
+
+
+config BR2_TARGET_BAREBOX_2_CUSTOM_CONFIG_FILE
+	string "Configuration file path"
+	depends on BR2_TARGET_BAREBOX_2_USE_CUSTOM_CONFIG
+	help
+	  Path to the barebox configuration file
+
+config BR2_TARGET_BAREBOX_2_CONFIG_FRAGMENT_FILES
+	string "Additional configuration fragment files"
+	help
+	  A space-separated list of configuration fragment files,
+	  that will be merged to the main Barebox configuration file.
+
+config BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE
+	string "Built image filename"
+	default "barebox-flash-image"
+	help
+	  Name of the built barebox image filename in the barebox build or
+	  build images directory.
+
+	  Set to barebox.bin for barebox versions older than 2012.10.
+
+config BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE
+	string "Output image filename"
+	default "barebox-2.bin"
+	help
+	  Name to use when copying the barebox image to the output/images
+	  directory.
+
+config BR2_TARGET_BAREBOX_2_CUSTOM_ENV
+	bool "Generate an environment image"
+	help
+	  Generate a custom environment image. This environment will
+	  contain the variables and scripts to be used at boot by
+	  barebox.
+
+config BR2_TARGET_BAREBOX_2_CUSTOM_ENV_PATH
+	string "Environment path"
+	depends on BR2_TARGET_BAREBOX_2_CUSTOM_ENV
+	help
+	  Path to the directory containing the custom barebox
+	  environment. Depending on your setup, it will probably be
+	  based on either the content of the defaultenv or
+	  defaultenv-2 directories in the barebox source code, plus
+	  the additions needed. The output will be an image in the
+	  barebox devfs format, stored in the images directory, with
+	  the same name as the directory name given here.
+
+endif
diff --git a/boot/barebox/barebox-2/barebox-2.hash b/boot/barebox/barebox-2/barebox-2.hash
new file mode 120000
index 0000000..b6462b8
--- /dev/null
+++ b/boot/barebox/barebox-2/barebox-2.hash
@@ -0,0 +1 @@
+../barebox.hash
\ No newline at end of file
diff --git a/boot/barebox/barebox-2/barebox-2.mk b/boot/barebox/barebox-2/barebox-2.mk
new file mode 100644
index 0000000..7a88f93
--- /dev/null
+++ b/boot/barebox/barebox-2/barebox-2.mk
@@ -0,0 +1,9 @@
+################################################################################
+#
+# barebox-2
+#
+################################################################################
+
+# Instantiate a 2nd barebox package, built from the same sources as the 1st,
+# but with it's own configuration:
+$(eval $(call barebox-package))
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 8892ab5..71eb33a 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -153,3 +153,6 @@ barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
 
 # instantiate this barebox package
 $(eval $(call barebox-package))
+
+# add the 2nd barebox package build
+include boot/barebox/barebox-2/barebox-2.mk
-- 
2.5.0

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (5 preceding siblings ...)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build Pieter Smith
@ 2016-03-20 22:35 ` Pieter Smith
  2016-03-31  6:21   ` Yegor Yefremov
  2016-04-04 23:37   ` Arnout Vandecappelle
  2016-03-21 11:38 ` [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Yegor Yefremov
  2016-04-19 19:24 ` Thomas Petazzoni
  8 siblings, 2 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-20 22:35 UTC (permalink / raw)
  To: buildroot

* Builds the barebox MLO and bootloader.
* Generates a barebox environment that boots from eMMC by default.
* Barebox integrates a perfectly good device-tree for the bbb, so no dtb is
  being generated with the kernel.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 board/beaglebone/barebox.env/boot/sd      |  6 +++++
 board/beaglebone/barebox.env/config-board |  4 +++
 configs/beaglebone_barebox_defconfig      | 41 +++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 board/beaglebone/barebox.env/boot/sd
 create mode 100644 board/beaglebone/barebox.env/config-board
 create mode 100644 configs/beaglebone_barebox_defconfig

diff --git a/board/beaglebone/barebox.env/boot/sd b/board/beaglebone/barebox.env/boot/sd
new file mode 100644
index 0000000..7a80e29
--- /dev/null
+++ b/board/beaglebone/barebox.env/boot/sd
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/boot/zImage
+#global.bootm.oftree=/boot/oftree
+#global.bootm.initrd=<path to initrd>
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext2 rootwait"
diff --git a/board/beaglebone/barebox.env/config-board b/board/beaglebone/barebox.env/config-board
new file mode 100644
index 0000000..cd7b26d
--- /dev/null
+++ b/board/beaglebone/barebox.env/config-board
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+global.boot.default=sd
+
diff --git a/configs/beaglebone_barebox_defconfig b/configs/beaglebone_barebox_defconfig
new file mode 100644
index 0000000..6324dbf
--- /dev/null
+++ b/configs/beaglebone_barebox_defconfig
@@ -0,0 +1,41 @@
+# architecture
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_ARM_EABIHF=y
+
+# system
+BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+# BR2_ROOTFS_POST_IMAGE_SCRIPT is not set
+
+# filesystem
+BR2_PACKAGE_AM33X_CM3=y
+BR2_TARGET_ROOTFS_EXT2=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Linux headers same as kernel, a 4.4 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+
+# bootloader
+BR2_TARGET_BAREBOX=y
+BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
+BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone.img"
+BR2_TARGET_BAREBOX_CUSTOM_ENV=y
+BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH="board/beaglebone/barebox.env"
+BR2_TARGET_BAREBOX_2=y
+BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
+BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone-mlo.img"
+BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE="MLO"
+
+# kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
+BR2_LINUX_KERNEL_ZIMAGE=y
+
+# Use the barebox built-in dtb
+# BR2_LINUX_KERNEL_DTS_SUPPORT is not set
-- 
2.5.0

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (6 preceding siblings ...)
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig Pieter Smith
@ 2016-03-21 11:38 ` Yegor Yefremov
  2016-03-21 11:56   ` Pieter Smith
  2016-04-19 19:24 ` Thomas Petazzoni
  8 siblings, 1 reply; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-21 11:38 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> This patch-set adds support for building barebox with up to 2 configurations.
> It can be used to build the barebox x-loader or MLO (also called Secondary
> Program Loader) in addition to the standard barebox build (Tertiary Program
> Loader). This implements the design proposed in
> http://elinux.org/Buildroot#Todo_list, with minor adjustments:
> 1. Have boot/barebox/barebox.mk contain the common stuff.
> 2. Add a second package boot/barebox/barebox-2.
> 3. There is only one version selection, but each package allows to
>    define the configuration to be used.
> 4. Design is a little bit like package/gcc, where we have multiple gcc builds,
>    but share a lot of common definitions between the packages.
>
> To demonstrate that it works as advertized, the last patch adds a defconfig for
> the beaglebone that makes use of the added functionality.
>
> Revision history:
> v4: Introduces barebox-package function to reduce duplication and maintenance
>     Simplifies built image selection
>     Ease review with smaller patches
>     Review re-work: Special thanks to Arnout Vandecappelle and Yegor Yefremov
> v3: Updated for master at 544e2c5871f223facd1ab3c2853cd07ad70dd9d1
> v2: Dropped x-loader build specialization in favor of 2 generic barebox builds
> v1: Initial posting
>
> Pieter Smith (7):
>   barebox: support multi-image-build image selection
>   barebox: friendly error on missing built image
>   barebox: support custom barebox output image name
>   barebox: introduce barebox-package function
>   barebox: extract package name argument
>   barebox: support 2nd config build
>   beaglebone: adds barebox bootloader defconfig
>
>  board/beaglebone/barebox.env/boot/sd      |   6 +
>  board/beaglebone/barebox.env/config-board |   4 +
>  boot/barebox/Config.in                    |  18 +++
>  boot/barebox/barebox-2/Config.in          |  79 +++++++++++++
>  boot/barebox/barebox-2/barebox-2.hash     |   1 +
>  boot/barebox/barebox-2/barebox-2.mk       |   9 ++
>  boot/barebox/barebox.mk                   | 178 ++++++++++++++++++------------
>  configs/beaglebone_barebox_defconfig      |  41 +++++++
>  8 files changed, 266 insertions(+), 70 deletions(-)
>  create mode 100644 board/beaglebone/barebox.env/boot/sd
>  create mode 100644 board/beaglebone/barebox.env/config-board
>  create mode 100644 boot/barebox/barebox-2/Config.in
>  create mode 120000 boot/barebox/barebox-2/barebox-2.hash
>  create mode 100644 boot/barebox/barebox-2/barebox-2.mk
>  create mode 100644 configs/beaglebone_barebox_defconfig

Tested-by: Yegor Yefremov <yegorslists@googlemail.com>

for the whole series.

Yegor

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-03-21 11:38 ` [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Yegor Yefremov
@ 2016-03-21 11:56   ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-03-21 11:56 UTC (permalink / raw)
  To: buildroot

On Mon, 21 Mar 2016, 12:39 Yegor Yefremov, <yegorslists@googlemail.com>
wrote:

> On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > This patch-set adds support for building barebox with up to 2
> configurations.
> > It can be used to build the barebox x-loader or MLO (also called
> Secondary
> > Program Loader) in addition to the standard barebox build (Tertiary
> Program
> > Loader). This implements the design proposed in
> > http://elinux.org/Buildroot#Todo_list, with minor adjustments:
> > 1. Have boot/barebox/barebox.mk contain the common stuff.
> > 2. Add a second package boot/barebox/barebox-2.
> > 3. There is only one version selection, but each package allows to
> >    define the configuration to be used.
> > 4. Design is a little bit like package/gcc, where we have multiple gcc
> builds,
> >    but share a lot of common definitions between the packages.
> >
> > To demonstrate that it works as advertized, the last patch adds a
> defconfig for
> > the beaglebone that makes use of the added functionality.
> >
> > Revision history:
> > v4: Introduces barebox-package function to reduce duplication and
> maintenance
> >     Simplifies built image selection
> >     Ease review with smaller patches
> >     Review re-work: Special thanks to Arnout Vandecappelle and Yegor
> Yefremov
> > v3: Updated for master at 544e2c5871f223facd1ab3c2853cd07ad70dd9d1
> > v2: Dropped x-loader build specialization in favor of 2 generic barebox
> builds
> > v1: Initial posting
> >
> > Pieter Smith (7):
> >   barebox: support multi-image-build image selection
> >   barebox: friendly error on missing built image
> >   barebox: support custom barebox output image name
> >   barebox: introduce barebox-package function
> >   barebox: extract package name argument
> >   barebox: support 2nd config build
> >   beaglebone: adds barebox bootloader defconfig
> >
> >  board/beaglebone/barebox.env/boot/sd      |   6 +
> >  board/beaglebone/barebox.env/config-board |   4 +
> >  boot/barebox/Config.in                    |  18 +++
> >  boot/barebox/barebox-2/Config.in          |  79 +++++++++++++
> >  boot/barebox/barebox-2/barebox-2.hash     |   1 +
> >  boot/barebox/barebox-2/barebox-2.mk       |   9 ++
> >  boot/barebox/barebox.mk                   | 178
> ++++++++++++++++++------------
> >  configs/beaglebone_barebox_defconfig      |  41 +++++++
> >  8 files changed, 266 insertions(+), 70 deletions(-)
> >  create mode 100644 board/beaglebone/barebox.env/boot/sd
> >  create mode 100644 board/beaglebone/barebox.env/config-board
> >  create mode 100644 boot/barebox/barebox-2/Config.in
> >  create mode 120000 boot/barebox/barebox-2/barebox-2.hash
> >  create mode 100644 boot/barebox/barebox-2/barebox-2.mk
> >  create mode 100644 configs/beaglebone_barebox_defconfig
>
> Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
>
> for the whole series.
>
> Yegor
>

Thanks!

- Pieter

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160321/f9816862/attachment-0001.html>

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
@ 2016-03-31  5:44   ` Yegor Yefremov
  2016-04-06 20:28     ` Pieter Smith
  2016-04-02 15:31   ` Thomas Petazzoni
  2016-04-04 22:16   ` Arnout Vandecappelle
  2 siblings, 1 reply; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  5:44 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Support selection of the built image filename in a multi-image barebox build.
> This makes it possible to specify which image to pick in a in a multi-image

you seem to have double "in a"

> barebox config such as the am335x_defconfig.
>
> The specified image can either be located in the barebox build directory or the
> barebox build images directory.
>
> For compatibility with contemporary barbox builds, a sane default has been
> chosen. For barebox versions older than 2012.10, the user will have to specify
> 'barebox.bin'.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  boot/barebox/Config.in  | 9 +++++++++
>  boot/barebox/barebox.mk | 9 ++++++---
>  2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index bbe6ae2..4f6872c 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -97,6 +97,15 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
>           A space-separated list of configuration fragment files,
>           that will be merged to the main Barebox configuration file.
>
> +config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> +       string "Built image filename"
> +       default "barebox-flash-image"
> +       help
> +         Name of the built barebox image filename in the barebox build or
> +         build images directory.
> +
> +         Set to barebox.bin for barebox versions older than 2012.10.
> +
>  config BR2_TARGET_BAREBOX_BAREBOXENV
>         bool "bareboxenv tool in target"
>         help
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 7715daf..2a3b724 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -92,10 +92,10 @@ define BAREBOX_BUILD_CMDS
>  endef
>
>  define BAREBOX_INSTALL_IMAGES_CMDS
> -       if test -h $(@D)/barebox-flash-image ; then \
> -               cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
> +       if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> +               cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>         else \
> -               cp $(@D)/barebox.bin $(BINARIES_DIR);\
> +               cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>         fi
>         $(BAREBOX_INSTALL_CUSTOM_ENV)
>  endef
> @@ -115,6 +115,9 @@ ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
>  ifeq ($(or $(BAREBOX_KCONFIG_FILE),$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
>  $(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
>  endif
> +ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> +$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
> +endif
>  endif
>
>  $(eval $(kconfig-package))
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image Pieter Smith
@ 2016-03-31  6:01   ` Yegor Yefremov
  0 siblings, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:01 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Gives the user a friendly error to help him troubleshoot missing built barebox
> image.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  boot/barebox/barebox.mk | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 2a3b724..d0f28cf 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -94,8 +94,14 @@ endef
>  define BAREBOX_INSTALL_IMAGES_CMDS
>         if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
>                 cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> -       else \
> +       elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
>                 cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +       else \
> +               echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
> +               echo "       in: $(@D)/" >&2 ; \
> +               echo "       or: $(@D)/images/" >&2 ; \
> +               echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
> +               exit 1 ; \
>         fi
>         $(BAREBOX_INSTALL_CUSTOM_ENV)
>  endef
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
@ 2016-03-31  6:03   ` Yegor Yefremov
  2016-04-04 22:31   ` Arnout Vandecappelle
  2016-04-04 23:20   ` Arnout Vandecappelle
  2 siblings, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:03 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> In preparation for building a 2nd barebox config, a configuration option is
> added to allow customization of the image filename when the built image is
> copied to the output/images directory.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  boot/barebox/Config.in  | 7 +++++++
>  boot/barebox/barebox.mk | 9 +++++++--
>  2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index 4f6872c..7769866 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -106,6 +106,13 @@ config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>
>           Set to barebox.bin for barebox versions older than 2012.10.
>
> +config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +       string "Output image filename"
> +       default "barebox.bin"
> +       help
> +         Name to use when copying the barebox image to the output/images
> +         directory.
> +
>  config BR2_TARGET_BAREBOX_BAREBOXENV
>         bool "bareboxenv tool in target"
>         help
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index d0f28cf..4eea470 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -93,9 +93,11 @@ endef
>
>  define BAREBOX_INSTALL_IMAGES_CMDS
>         if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +               cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +                     $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>         elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +               cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +                  $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>         else \
>                 echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
>                 echo "       in: $(@D)/" >&2 ; \
> @@ -124,6 +126,9 @@ endif
>  ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>  $(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
>  endif
> +ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
> +endif
>  endif
>
>  $(eval $(kconfig-package))
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
@ 2016-03-31  6:12   ` Yegor Yefremov
  2016-04-04 22:59   ` Arnout Vandecappelle
  2016-04-04 23:23   ` Arnout Vandecappelle
  2 siblings, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:12 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> No functional changes: Introduces a barebox-package function towards re-use by
> a 2nd config build.
>
> Because the function is meant to be called from within a $(eval), all instances
> of '$' has to be escaped. I.e. rename '$' -> '$$'.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

below some typos

> ---
>  boot/barebox/barebox.mk | 134 +++++++++++++++++++++++++++---------------------
>  1 file changed, 76 insertions(+), 58 deletions(-)
>
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 4eea470..d84c479 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -4,23 +4,31 @@
>  #
>  ################################################################################
>
> -BAREBOX_VERSION = $(call qstrip,$(BR2_TARGET_BAREBOX_VERSION))
> +################################################################################
> +# inner-barebox-package -- generates the KConfig logic and make targets needed

s/KConfig/Kconfig and s/make/makes

> +# to support a barebox package. All barebox packages are built from the same
> +# source (origin, version and patches).
> +################################################################################
> +
> +define inner-barebox-package
>
> -ifeq ($(BAREBOX_VERSION),custom)
> +BAREBOX_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
> +
> +ifeq ($$(BAREBOX_VERSION),custom)
>  # Handle custom Barebox tarballs as specified by the configuration
> -BAREBOX_TARBALL = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
> -BAREBOX_SITE = $(patsubst %/,%,$(dir $(BAREBOX_TARBALL)))
> -BAREBOX_SOURCE = $(notdir $(BAREBOX_TARBALL))
> -BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
> -else ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
> -BAREBOX_SITE = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
> +BAREBOX_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
> +BAREBOX_SITE = $$(patsubst %/,%,$$(dir $$(BAREBOX_TARBALL)))
> +BAREBOX_SOURCE = $$(notdir $$(BAREBOX_TARBALL))
> +BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
> +else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
> +BAREBOX_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
>  BAREBOX_SITE_METHOD = git
>  else
>  # Handle stable official Barebox versions
> -BAREBOX_SOURCE = barebox-$(BAREBOX_VERSION).tar.bz2
> +BAREBOX_SOURCE = barebox-$$(BAREBOX_VERSION).tar.bz2
>  BAREBOX_SITE = http://www.barebox.org/download
> -ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
> -BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
> +ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
> +BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
>  endif
>  endif
>
> @@ -28,107 +36,117 @@ BAREBOX_DEPENDENCIES = host-lzop
>  BAREBOX_LICENSE = GPLv2 with exceptions
>  BAREBOX_LICENSE_FILES = COPYING
>
> -ifneq ($(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
> +ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
>  define BAREBOX_APPLY_CUSTOM_PATCHES
> -       $(APPLY_PATCHES) $(@D) \
> -               $(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
> +       $$(APPLY_PATCHES) $$(@D) \
> +               $$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
>  endef
>
>  BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
>  endif
>
>  BAREBOX_INSTALL_IMAGES = YES
> -ifneq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> +ifneq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
>  BAREBOX_INSTALL_TARGET = NO
>  endif
>
> -ifeq ($(KERNEL_ARCH),i386)
> +ifeq ($$(KERNEL_ARCH),i386)
>  BAREBOX_ARCH = x86
> -else ifeq ($(KERNEL_ARCH),x86_64)
> +else ifeq ($$(KERNEL_ARCH),x86_64)
>  BAREBOX_ARCH = x86
> -else ifeq ($(KERNEL_ARCH),powerpc)
> +else ifeq ($$(KERNEL_ARCH),powerpc)
>  BAREBOX_ARCH = ppc
>  else
> -BAREBOX_ARCH = $(KERNEL_ARCH)
> +BAREBOX_ARCH = $$(KERNEL_ARCH)
>  endif
>
> -BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(TARGET_CROSS)"
> -BAREBOX_MAKE_ENV = $(TARGET_MAKE_ENV)
> +BAREBOX_MAKE_FLAGS = ARCH=$$(BAREBOX_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
> +BAREBOX_MAKE_ENV = $$(TARGET_MAKE_ENV)
>
> -ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
> -BAREBOX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
> -else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
> -BAREBOX_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
> +ifeq ($$(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
> +BAREBOX_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
> +else ifeq ($$(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
> +BAREBOX_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
>  endif
>
> -BAREBOX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
> +BAREBOX_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
>  BAREBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
> -BAREBOX_KCONFIG_OPTS = $(BAREBOX_MAKE_FLAGS)
> +BAREBOX_KCONFIG_OPTS = $$(BAREBOX_MAKE_FLAGS)
>
> -ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> +ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
>  define BAREBOX_BUILD_BAREBOXENV_CMDS
> -       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $(@D)/bareboxenv \
> -               $(@D)/scripts/bareboxenv.c
> +       $$(TARGET_CC) $$(TARGET_CFLAGS) $$(TARGET_LDFLAGS) -o $$(@D)/bareboxenv \
> +               $$(@D)/scripts/bareboxenv.c
>  endef
>  endif
>
> -ifeq ($(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
> -BAREBOX_ENV_NAME = $(notdir $(call qstrip,\
> -       $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
> +ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
> +BAREBOX_ENV_NAME = $$(notdir $$(call qstrip,\
> +       $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
>  define BAREBOX_BUILD_CUSTOM_ENV
> -       $(@D)/scripts/bareboxenv -s \
> -               $(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
> -               $(@D)/$(BAREBOX_ENV_NAME)
> +       $$(@D)/scripts/bareboxenv -s \
> +               $$(call qstrip, $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
> +               $$(@D)/$$(BAREBOX_ENV_NAME)
>  endef
>  define BAREBOX_INSTALL_CUSTOM_ENV
> -       cp $(@D)/$(BAREBOX_ENV_NAME) $(BINARIES_DIR)
> +       cp $$(@D)/$$(BAREBOX_ENV_NAME) $$(BINARIES_DIR)
>  endef
>  endif
>
>  define BAREBOX_BUILD_CMDS
> -       $(BAREBOX_BUILD_BAREBOXENV_CMDS)
> -       $(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D)
> -       $(BAREBOX_BUILD_CUSTOM_ENV)
> +       $$(BAREBOX_BUILD_BAREBOXENV_CMDS)
> +       $$(TARGET_MAKE_ENV) $$(MAKE) $$(BAREBOX_MAKE_FLAGS) -C $$(@D)
> +       $$(BAREBOX_BUILD_CUSTOM_ENV)
>  endef
>
>  define BAREBOX_INSTALL_IMAGES_CMDS
> -       if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> -                     $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
> -       elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> -                  $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
> +       if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> +               cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +                     $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
> +       elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> +               cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +                  $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>         else \
> -               echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
> -               echo "       in: $(@D)/" >&2 ; \
> -               echo "       or: $(@D)/images/" >&2 ; \
> +               echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
> +               echo "       in: $$(@D)/" >&2 ; \
> +               echo "       or: $$(@D)/images/" >&2 ; \
>                 echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
>                 exit 1 ; \
>         fi
> -       $(BAREBOX_INSTALL_CUSTOM_ENV)
> +       $$(BAREBOX_INSTALL_CUSTOM_ENV)
>  endef
>
> -ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> +ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
>  define BAREBOX_INSTALL_TARGET_CMDS
> -       cp $(@D)/bareboxenv $(TARGET_DIR)/usr/bin
> +       cp $$(@D)/bareboxenv $$(TARGET_DIR)/usr/bin
>  endef
>  endif
>
>  # Checks to give errors that the user can understand
>  # Must be before we call to kconfig-package
> -ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
> +ifeq ($$(BR2_TARGET_BAREBOX)$$(BR_BUILDING),yy)
>  # We must use the user-supplied kconfig value, because
>  # BAREBOX_KCONFIG_DEFCONFIG will at least contain the
>  # trailing _defconfig
> -ifeq ($(or $(BAREBOX_KCONFIG_FILE),$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
> -$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
> +ifeq ($$(or $$(BAREBOX_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
> +$$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
>  endif
>  ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> -$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
> +$$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
>  endif
>  ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> -$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
> +$$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
>  endif
>  endif
>
> -$(eval $(kconfig-package))
> +$$(eval $$(kconfig-package))
> +endef
> +
> +################################################################################
> +# barebox-package -- the target generator macro for barebox packages
> +################################################################################
> +
> +barebox-package=$(call inner-barebox-package)
> +
> +# instantiate this barebox package
> +$(eval $(call barebox-package))
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 5/7] barebox: extract package name argument
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 5/7] barebox: extract package name argument Pieter Smith
@ 2016-03-31  6:16   ` Yegor Yefremov
  2016-04-04 23:01   ` Arnout Vandecappelle
  1 sibling, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:16 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> No functional changes: Extracts an argument to the inner-barebox-package
> function to automatically determine the uppercase package name. This is needed
> to support a 2nd config build. This results in the following renaming:
>   'BAREBOX' -> '$(1)'
>
> All barebox packages are meant to be built from the same sources, so related
> KConfig variables (origin, version and patch directory) are not extracted.

Kconfig

>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  boot/barebox/barebox.mk | 139 +++++++++++++++++++++++++-----------------------
>  1 file changed, 71 insertions(+), 68 deletions(-)
>
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index d84c479..8892ab5 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -7,135 +7,138 @@
>  ################################################################################
>  # inner-barebox-package -- generates the KConfig logic and make targets needed
>  # to support a barebox package. All barebox packages are built from the same
> -# source (origin, version and patches).
> +# source (origin, version and patches). The remainder of the package
> +# configuration is unique to each barebox package.
> +#
> +#  argument 1 is the uppercase package name (used for variable name-space)
>  ################################################################################
>
>  define inner-barebox-package
>
> -BAREBOX_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
> +$(1)_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
>
> -ifeq ($$(BAREBOX_VERSION),custom)
> +ifeq ($$($(1)_VERSION),custom)
>  # Handle custom Barebox tarballs as specified by the configuration
> -BAREBOX_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
> -BAREBOX_SITE = $$(patsubst %/,%,$$(dir $$(BAREBOX_TARBALL)))
> -BAREBOX_SOURCE = $$(notdir $$(BAREBOX_TARBALL))
> -BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
> +$(1)_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
> +$(1)_SITE = $$(patsubst %/,%,$$(dir $$($(1)_TARBALL)))
> +$(1)_SOURCE = $$(notdir $$($(1)_TARBALL))
> +BR_NO_CHECK_HASH_FOR += $$($(1)_SOURCE)
>  else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
> -BAREBOX_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
> -BAREBOX_SITE_METHOD = git
> +$(1)_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
> +$(1)_SITE_METHOD = git
>  else
>  # Handle stable official Barebox versions
> -BAREBOX_SOURCE = barebox-$$(BAREBOX_VERSION).tar.bz2
> -BAREBOX_SITE = http://www.barebox.org/download
> +$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
> +$(1)_SITE = http://www.barebox.org/download
>  ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_VERSION),y)
> -BR_NO_CHECK_HASH_FOR += $$(BAREBOX_SOURCE)
> +BR_NO_CHECK_HASH_FOR += $$($(1)_SOURCE)
>  endif
>  endif
>
> -BAREBOX_DEPENDENCIES = host-lzop
> -BAREBOX_LICENSE = GPLv2 with exceptions
> -BAREBOX_LICENSE_FILES = COPYING
> +$(1)_DEPENDENCIES = host-lzop
> +$(1)_LICENSE = GPLv2 with exceptions
> +$(1)_LICENSE_FILES = COPYING
>
>  ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
> -define BAREBOX_APPLY_CUSTOM_PATCHES
> +define $(1)_APPLY_CUSTOM_PATCHES
>         $$(APPLY_PATCHES) $$(@D) \
>                 $$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
>  endef
>
> -BAREBOX_POST_PATCH_HOOKS += BAREBOX_APPLY_CUSTOM_PATCHES
> +$(1)_POST_PATCH_HOOKS += $(1)_APPLY_CUSTOM_PATCHES
>  endif
>
> -BAREBOX_INSTALL_IMAGES = YES
> -ifneq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> -BAREBOX_INSTALL_TARGET = NO
> +$(1)_INSTALL_IMAGES = YES
> +ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
> +$(1)_INSTALL_TARGET = NO
>  endif
>
>  ifeq ($$(KERNEL_ARCH),i386)
> -BAREBOX_ARCH = x86
> +$(1)_ARCH = x86
>  else ifeq ($$(KERNEL_ARCH),x86_64)
> -BAREBOX_ARCH = x86
> +$(1)_ARCH = x86
>  else ifeq ($$(KERNEL_ARCH),powerpc)
> -BAREBOX_ARCH = ppc
> +$(1)_ARCH = ppc
>  else
> -BAREBOX_ARCH = $$(KERNEL_ARCH)
> +$(1)_ARCH = $$(KERNEL_ARCH)
>  endif
>
> -BAREBOX_MAKE_FLAGS = ARCH=$$(BAREBOX_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
> -BAREBOX_MAKE_ENV = $$(TARGET_MAKE_ENV)
> +$(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
> +$(1)_MAKE_ENV = $$(TARGET_MAKE_ENV)
>
> -ifeq ($$(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
> -BAREBOX_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
> -else ifeq ($$(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
> -BAREBOX_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
> +ifeq ($$(BR2_TARGET_$(1)_USE_DEFCONFIG),y)
> +$(1)_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))_defconfig
> +else ifeq ($$(BR2_TARGET_$(1)_USE_CUSTOM_CONFIG),y)
> +$(1)_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE))
>  endif
>
> -BAREBOX_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES))
> -BAREBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
> -BAREBOX_KCONFIG_OPTS = $$(BAREBOX_MAKE_FLAGS)
> +$(1)_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_CONFIG_FRAGMENT_FILES))
> +$(1)_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
> +$(1)_KCONFIG_OPTS = $$($(1)_MAKE_FLAGS)
>
> -ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> -define BAREBOX_BUILD_BAREBOXENV_CMDS
> +ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
> +define $(1)_BUILD_BAREBOXENV_CMDS
>         $$(TARGET_CC) $$(TARGET_CFLAGS) $$(TARGET_LDFLAGS) -o $$(@D)/bareboxenv \
>                 $$(@D)/scripts/bareboxenv.c
>  endef
>  endif
>
> -ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_ENV),y)
> -BAREBOX_ENV_NAME = $$(notdir $$(call qstrip,\
> -       $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
> -define BAREBOX_BUILD_CUSTOM_ENV
> +ifeq ($$(BR2_TARGET_$(1)_CUSTOM_ENV),y)
> +$(1)_ENV_NAME = $$(notdir $$(call qstrip,\
> +       $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)))
> +define $(1)_BUILD_CUSTOM_ENV
>         $$(@D)/scripts/bareboxenv -s \
> -               $$(call qstrip, $$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
> -               $$(@D)/$$(BAREBOX_ENV_NAME)
> +               $$(call qstrip, $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)) \
> +               $$(@D)/$$($(1)_ENV_NAME)
>  endef
> -define BAREBOX_INSTALL_CUSTOM_ENV
> -       cp $$(@D)/$$(BAREBOX_ENV_NAME) $$(BINARIES_DIR)
> +define $(1)_INSTALL_CUSTOM_ENV
> +       cp $$(@D)/$$($(1)_ENV_NAME) $$(BINARIES_DIR)
>  endef
>  endif
>
> -define BAREBOX_BUILD_CMDS
> -       $$(BAREBOX_BUILD_BAREBOXENV_CMDS)
> -       $$(TARGET_MAKE_ENV) $$(MAKE) $$(BAREBOX_MAKE_FLAGS) -C $$(@D)
> -       $$(BAREBOX_BUILD_CUSTOM_ENV)
> +define $(1)_BUILD_CMDS
> +       $$($(1)_BUILD_BAREBOXENV_CMDS)
> +       $$(TARGET_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
> +       $$($(1)_BUILD_CUSTOM_ENV)
>  endef
>
> -define BAREBOX_INSTALL_IMAGES_CMDS
> -       if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> -                     $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
> -       elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -               cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> -                  $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
> +define $(1)_INSTALL_IMAGES_CMDS
> +       if test -e $$(@D)/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)); then \
> +               cp -L $$(@D)/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)) \
> +                     $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE)) ; \
> +       elif test -e $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)); then \
> +               cp $$(@D)/images/$$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE)) \
> +                  $$(BINARIES_DIR)/$$(call qstrip,$$(BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE)) ; \
>         else \
> -               echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
> +               echo "error: Specified built image file not found: $$(call qstrip,$$(BR2_TARGET_$(1)_BUILT_IMAGE_FILE))" >&2 ; \
>                 echo "       in: $$(@D)/" >&2 ; \
>                 echo "       or: $$(@D)/images/" >&2 ; \
> -               echo "       Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting." >&2 ; \
> +               echo "       Check your BR2_TARGET_$(1)_BUILT_IMAGE_FILE setting." >&2 ; \
>                 exit 1 ; \
>         fi
> -       $$(BAREBOX_INSTALL_CUSTOM_ENV)
> +       $$($(1)_INSTALL_CUSTOM_ENV)
>  endef
>
> -ifeq ($$(BR2_TARGET_BAREBOX_BAREBOXENV),y)
> -define BAREBOX_INSTALL_TARGET_CMDS
> +ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
> +define $(1)_INSTALL_TARGET_CMDS
>         cp $$(@D)/bareboxenv $$(TARGET_DIR)/usr/bin
>  endef
>  endif
>
>  # Checks to give errors that the user can understand
>  # Must be before we call to kconfig-package
> -ifeq ($$(BR2_TARGET_BAREBOX)$$(BR_BUILDING),yy)
> +ifeq ($$(BR2_TARGET_$(1))$$(BR_BUILDING),yy)
>  # We must use the user-supplied kconfig value, because
> -# BAREBOX_KCONFIG_DEFCONFIG will at least contain the
> +# $(1)_KCONFIG_DEFCONFIG will at least contain the
>  # trailing _defconfig
> -ifeq ($$(or $$(BAREBOX_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
> -$$(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
> +ifeq ($$(or $$($(1)_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))),)
> +$$(error No Barebox config. Check your BR2_TARGET_$(1)_BOARD_DEFCONFIG or BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE settings)
>  endif
> -ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> -$$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
> +ifndef BR2_TARGET_$(1)_BUILT_IMAGE_FILE
> +$$(error No barebox built image filename specified. Check your BR2_TARGET_$(1)_BUILT_IMAGE_FILE setting)
>  endif
> -ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> -$$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
> +ifndef BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE
> +$$(error No barebox output image filename specified. Check your BR2_TARGET_$(1)_OUTPUT_IMAGE_FILE setting)
>  endif
>  endif
>
> @@ -146,7 +149,7 @@ endef
>  # barebox-package -- the target generator macro for barebox packages
>  ################################################################################
>
> -barebox-package=$(call inner-barebox-package)
> +barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
>
>  # instantiate this barebox package
>  $(eval $(call barebox-package))
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build Pieter Smith
@ 2016-03-31  6:17   ` Yegor Yefremov
  2016-04-04 23:25   ` Arnout Vandecappelle
  1 sibling, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:17 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Adds support to build barebox with a 2nd config.
>
> This is useful for building an SPL (Secondary Program Loader) in addition to
> the traditional TPL (Tertiary Program Loader). The Beaglebone Black for example
> has two barebox configurations:
> - am335x_defconfig builds the full barebox bootloader with device tree, and
> - am335x_mlo_defconfig builds the smaller MLO bootloader that loads the full
>   barebox bootloader from the eMMC or SD card.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  boot/barebox/Config.in                |  2 +
>  boot/barebox/barebox-2/Config.in      | 79 +++++++++++++++++++++++++++++++++++
>  boot/barebox/barebox-2/barebox-2.hash |  1 +
>  boot/barebox/barebox-2/barebox-2.mk   |  9 ++++
>  boot/barebox/barebox.mk               |  3 ++
>  5 files changed, 94 insertions(+)
>  create mode 100644 boot/barebox/barebox-2/Config.in
>  create mode 120000 boot/barebox/barebox-2/barebox-2.hash
>  create mode 100644 boot/barebox/barebox-2/barebox-2.mk
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index 7769866..e92cdc3 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -137,4 +137,6 @@ config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
>           barebox devfs format, stored in the images directory, with
>           the same name as the directory name given here.
>
> +source boot/barebox/barebox-2/Config.in
> +
>  endif
> diff --git a/boot/barebox/barebox-2/Config.in b/boot/barebox/barebox-2/Config.in
> new file mode 100644
> index 0000000..5bd8347
> --- /dev/null
> +++ b/boot/barebox/barebox-2/Config.in
> @@ -0,0 +1,79 @@
> +menuconfig BR2_TARGET_BAREBOX_2
> +       bool "Build barebox with a 2nd config"
> +       help
> +         Build barebox with a 2nd configuration.
> +
> +         Useful for building an SPL (Secondary Program Loader) in addition to
> +         the traditional TPL (Tertiary Program Loader), such as the X-Loader
> +         or MLO for Texas Instruments processors.
> +
> +if BR2_TARGET_BAREBOX_2
> +
> +choice
> +       prompt "Barebox configuration"
> +       default BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
> +
> +config BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
> +       bool "Using a defconfig"
> +
> +config BR2_TARGET_BAREBOX_2_USE_CUSTOM_CONFIG
> +       bool "Using a custom config file"
> +
> +endchoice
> +
> +config BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG
> +       string "board defconfig"
> +       depends on BR2_TARGET_BAREBOX_2_USE_DEFCONFIG
> +       help
> +         Name of the board for which Barebox should be built, without
> +         the _defconfig suffix.
> +
> +
> +config BR2_TARGET_BAREBOX_2_CUSTOM_CONFIG_FILE
> +       string "Configuration file path"
> +       depends on BR2_TARGET_BAREBOX_2_USE_CUSTOM_CONFIG
> +       help
> +         Path to the barebox configuration file
> +
> +config BR2_TARGET_BAREBOX_2_CONFIG_FRAGMENT_FILES
> +       string "Additional configuration fragment files"
> +       help
> +         A space-separated list of configuration fragment files,
> +         that will be merged to the main Barebox configuration file.
> +
> +config BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE
> +       string "Built image filename"
> +       default "barebox-flash-image"
> +       help
> +         Name of the built barebox image filename in the barebox build or
> +         build images directory.
> +
> +         Set to barebox.bin for barebox versions older than 2012.10.
> +
> +config BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE
> +       string "Output image filename"
> +       default "barebox-2.bin"
> +       help
> +         Name to use when copying the barebox image to the output/images
> +         directory.
> +
> +config BR2_TARGET_BAREBOX_2_CUSTOM_ENV
> +       bool "Generate an environment image"
> +       help
> +         Generate a custom environment image. This environment will
> +         contain the variables and scripts to be used at boot by
> +         barebox.
> +
> +config BR2_TARGET_BAREBOX_2_CUSTOM_ENV_PATH
> +       string "Environment path"
> +       depends on BR2_TARGET_BAREBOX_2_CUSTOM_ENV
> +       help
> +         Path to the directory containing the custom barebox
> +         environment. Depending on your setup, it will probably be
> +         based on either the content of the defaultenv or
> +         defaultenv-2 directories in the barebox source code, plus
> +         the additions needed. The output will be an image in the
> +         barebox devfs format, stored in the images directory, with
> +         the same name as the directory name given here.
> +
> +endif
> diff --git a/boot/barebox/barebox-2/barebox-2.hash b/boot/barebox/barebox-2/barebox-2.hash
> new file mode 120000
> index 0000000..b6462b8
> --- /dev/null
> +++ b/boot/barebox/barebox-2/barebox-2.hash
> @@ -0,0 +1 @@
> +../barebox.hash
> \ No newline at end of file
> diff --git a/boot/barebox/barebox-2/barebox-2.mk b/boot/barebox/barebox-2/barebox-2.mk
> new file mode 100644
> index 0000000..7a88f93
> --- /dev/null
> +++ b/boot/barebox/barebox-2/barebox-2.mk
> @@ -0,0 +1,9 @@
> +################################################################################
> +#
> +# barebox-2
> +#
> +################################################################################
> +
> +# Instantiate a 2nd barebox package, built from the same sources as the 1st,
> +# but with it's own configuration:
> +$(eval $(call barebox-package))
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 8892ab5..71eb33a 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -153,3 +153,6 @@ barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
>
>  # instantiate this barebox package
>  $(eval $(call barebox-package))
> +
> +# add the 2nd barebox package build
> +include boot/barebox/barebox-2/barebox-2.mk
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig Pieter Smith
@ 2016-03-31  6:21   ` Yegor Yefremov
  2016-04-04 23:37   ` Arnout Vandecappelle
  1 sibling, 0 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-03-31  6:21 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> * Builds the barebox MLO and bootloader.
> * Generates a barebox environment that boots from eMMC by default.
> * Barebox integrates a perfectly good device-tree for the bbb, so no dtb is
>   being generated with the kernel.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  board/beaglebone/barebox.env/boot/sd      |  6 +++++
>  board/beaglebone/barebox.env/config-board |  4 +++
>  configs/beaglebone_barebox_defconfig      | 41 +++++++++++++++++++++++++++++++
>  3 files changed, 51 insertions(+)
>  create mode 100644 board/beaglebone/barebox.env/boot/sd
>  create mode 100644 board/beaglebone/barebox.env/config-board
>  create mode 100644 configs/beaglebone_barebox_defconfig
>
> diff --git a/board/beaglebone/barebox.env/boot/sd b/board/beaglebone/barebox.env/boot/sd
> new file mode 100644
> index 0000000..7a80e29
> --- /dev/null
> +++ b/board/beaglebone/barebox.env/boot/sd
> @@ -0,0 +1,6 @@
> +#!/bin/sh
> +
> +global.bootm.image=/boot/zImage
> +#global.bootm.oftree=/boot/oftree
> +#global.bootm.initrd=<path to initrd>
> +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext2 rootwait"
> diff --git a/board/beaglebone/barebox.env/config-board b/board/beaglebone/barebox.env/config-board
> new file mode 100644
> index 0000000..cd7b26d
> --- /dev/null
> +++ b/board/beaglebone/barebox.env/config-board
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +
> +global.boot.default=sd
> +
> diff --git a/configs/beaglebone_barebox_defconfig b/configs/beaglebone_barebox_defconfig
> new file mode 100644
> index 0000000..6324dbf
> --- /dev/null
> +++ b/configs/beaglebone_barebox_defconfig
> @@ -0,0 +1,41 @@
> +# architecture
> +BR2_arm=y
> +BR2_cortex_a8=y
> +BR2_ARM_EABIHF=y
> +
> +# system
> +BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
> +# BR2_ROOTFS_POST_IMAGE_SCRIPT is not set
> +
> +# filesystem
> +BR2_PACKAGE_AM33X_CM3=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +# BR2_TARGET_ROOTFS_TAR is not set
> +
> +# Linux headers same as kernel, a 4.4 series
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
> +
> +# bootloader
> +BR2_TARGET_BAREBOX=y
> +BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
> +BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone.img"
> +BR2_TARGET_BAREBOX_CUSTOM_ENV=y
> +BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH="board/beaglebone/barebox.env"
> +BR2_TARGET_BAREBOX_2=y
> +BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
> +BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone-mlo.img"
> +BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE="MLO"
> +
> +# kernel
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"
> +BR2_LINUX_KERNEL_USE_DEFCONFIG=y
> +BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
> +BR2_LINUX_KERNEL_ZIMAGE=y
> +
> +# Use the barebox built-in dtb
> +# BR2_LINUX_KERNEL_DTS_SUPPORT is not set
> --
> 2.5.0
>

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
  2016-03-31  5:44   ` Yegor Yefremov
@ 2016-04-02 15:31   ` Thomas Petazzoni
  2016-04-04 22:08     ` Arnout Vandecappelle
  2016-04-04 22:16   ` Arnout Vandecappelle
  2 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-02 15:31 UTC (permalink / raw)
  To: buildroot

Hello,

First of all, thanks a lot for keeping up the work on this topic!

On Sun, 20 Mar 2016 23:35:45 +0100, Pieter Smith wrote:

>  define BAREBOX_INSTALL_IMAGES_CMDS
> -	if test -h $(@D)/barebox-flash-image ; then \
> -		cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
> +	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> +		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>  	else \
> -		cp $(@D)/barebox.bin $(BINARIES_DIR);\
> +		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>  	fi
>  	$(BAREBOX_INSTALL_CUSTOM_ENV)

I think I don't like two things here:

 1/ That it potentially breaks existing configurations, where
    barebox.bin was used.

 2/ That is automatically searches in images/, which this could be made
    explicit rather than implicit.

So, what about changing this to:

 1/ Have an option that defaults to empty, and if it's empty, preserves
    the current behavior.

 2/ Change the code in the .mk file to do:

BAREBOX_IMAGE_FILE = $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)

ifeq ($(BAREBOX_IMAGE_FILE),)
define BARBEOX_INSTALL_IMAGE
	# old code here, using barebox-flash-image, falling back to barebox.bin
endef
else
define BAREBOX_INSTALL_IMAGE
	# install BAREBOX_IMAGE_FILE
endef
endif

and that's it?

Alternatively, you could do that with shell conditionals only, testing
is BAREBOX_IMAGE_FILE is empty or not. This may be even easier to read:

	if test -n $(BAREBOX_IMAGE) ; then
		install $(BAREBOX_IMAGE)
	elif test -h $(@D)/barebox-flash-image ; then
		cp -L $(@D)/barebox-flash-image ...
	else
		cp $(@D)/barebox.bin ...
	fi

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-04-02 15:31   ` Thomas Petazzoni
@ 2016-04-04 22:08     ` Arnout Vandecappelle
  0 siblings, 0 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 22:08 UTC (permalink / raw)
  To: buildroot

On 04/02/16 17:31, Thomas Petazzoni wrote:
[snip]
> Alternatively, you could do that with shell conditionals only, testing
> is BAREBOX_IMAGE_FILE is empty or not. This may be even easier to read:
>
> 	if test -n $(BAREBOX_IMAGE) ; then
> 		install $(BAREBOX_IMAGE)
> 	elif test -h $(@D)/barebox-flash-image ; then
> 		cp -L $(@D)/barebox-flash-image ...
> 	else
> 		cp $(@D)/barebox.bin ...
> 	fi

  +1 to that.

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
  2016-03-31  5:44   ` Yegor Yefremov
  2016-04-02 15:31   ` Thomas Petazzoni
@ 2016-04-04 22:16   ` Arnout Vandecappelle
  2 siblings, 0 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 22:16 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> Support selection of the built image filename in a multi-image barebox build.
> This makes it possible to specify which image to pick in a in a multi-image
> barebox config such as the am335x_defconfig.
>
> The specified image can either be located in the barebox build directory or the
> barebox build images directory.
>
> For compatibility with contemporary barbox builds, a sane default has been
> chosen. For barebox versions older than 2012.10, the user will have to specify
> 'barebox.bin'.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>   boot/barebox/Config.in  | 9 +++++++++
>   boot/barebox/barebox.mk | 9 ++++++---
>   2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index bbe6ae2..4f6872c 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -97,6 +97,15 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
>   	  A space-separated list of configuration fragment files,
>   	  that will be merged to the main Barebox configuration file.
>
> +config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> +	string "Built image filename"

  I think the 'built' part is redundant. For example, the kernel just has 
BR2_LINUX_KERNEL_IMAGE_NAME with prompt "Kernel image name", so I'd go for 
BR2_TARGET_BAREBOX_IMAGE_NAME and "Barebox image name".

> +	default "barebox-flash-image"
> +	help
> +	  Name of the built barebox image filename in the barebox build or
> +	  build images directory.
> +
> +	  Set to barebox.bin for barebox versions older than 2012.10.

  With Thomas's suggestion, the help text could become

	  The filename of the built barebox image. For current barebox, this is
	  usually barebox-flash-image; for barebox versions older than 2012.10,
	  it is barebox.bin. Leave empty to try these two options. This option
	  only needs to be set for multi-image barebox configs.

	  This file will be copied to the images directory as 'barebox.bin'.

> +
>   config BR2_TARGET_BAREBOX_BAREBOXENV
>   	bool "bareboxenv tool in target"
>   	help
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index 7715daf..2a3b724 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -92,10 +92,10 @@ define BAREBOX_BUILD_CMDS
>   endef
>
>   define BAREBOX_INSTALL_IMAGES_CMDS
> -	if test -h $(@D)/barebox-flash-image ; then \
> -		cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
> +	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> +		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>   	else \
> -		cp $(@D)/barebox.bin $(BINARIES_DIR);\
> +		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
>   	fi
>   	$(BAREBOX_INSTALL_CUSTOM_ENV)
>   endef
> @@ -115,6 +115,9 @@ ifeq ($(BR2_TARGET_BAREBOX)$(BR_BUILDING),yy)
>   ifeq ($(or $(BAREBOX_KCONFIG_FILE),$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))),)
>   $(error No Barebox config. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
>   endif
> +ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> +$(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
> +endif

  With Thomas's suggestion, this check should be removed.

  Regards,
  Arnout

>   endif
>
>   $(eval $(kconfig-package))
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
  2016-03-31  6:03   ` Yegor Yefremov
@ 2016-04-04 22:31   ` Arnout Vandecappelle
  2016-04-04 23:20   ` Arnout Vandecappelle
  2 siblings, 0 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 22:31 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> In preparation for building a 2nd barebox config, a configuration option is
> added to allow customization of the image filename when the built image is
> copied to the output/images directory.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


  Regards,
  Arnout

> ---
>   boot/barebox/Config.in  | 7 +++++++
>   boot/barebox/barebox.mk | 9 +++++++--
>   2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index 4f6872c..7769866 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -106,6 +106,13 @@ config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>
>   	  Set to barebox.bin for barebox versions older than 2012.10.
>
> +config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +	string "Output image filename"
> +	default "barebox.bin"
> +	help
> +	  Name to use when copying the barebox image to the output/images
> +	  directory.
> +
>   config BR2_TARGET_BAREBOX_BAREBOXENV
>   	bool "bareboxenv tool in target"
>   	help
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index d0f28cf..4eea470 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -93,9 +93,11 @@ endef
>
>   define BAREBOX_INSTALL_IMAGES_CMDS
>   	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +		      $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>   	elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +		   $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>   	else \
>   		echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
>   		echo "       in: $(@D)/" >&2 ; \
> @@ -124,6 +126,9 @@ endif
>   ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>   $(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
>   endif
> +ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
> +endif
>   endif
>
>   $(eval $(kconfig-package))
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
  2016-03-31  6:12   ` Yegor Yefremov
@ 2016-04-04 22:59   ` Arnout Vandecappelle
  2016-04-04 23:23   ` Arnout Vandecappelle
  2 siblings, 0 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 22:59 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> No functional changes: Introduces a barebox-package function towards re-use by
> a 2nd config build.
>
> Because the function is meant to be called from within a $(eval), all instances
> of '$' has to be escaped. I.e. rename '$' -> '$$'.
>
> Signed-off-by: Pieter Smith<pieter@boesman.nl>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  Checked that it is exactly the same except for the '$' -> '$$' replacement.


  However, I wonder if it wouldn't be better to hoist the parts that are really 
common (or only for barebox-1) out of the function. In particular, I'm thinking of:

- everything concerning BR2_TARGET_BAREBOX_BAREBOXENV, because that option 
doesn't exist for barebox-2 and it can be cleanly separated;

- the definition of BAREBOX_APPLY_CUSTOM_PATCHES, because there is only a single 
BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR;

- the definition of BAREBOX_ARCH and BAREBOX_MAKE_FLAGS, because they are not 
used by kconfig-package but only internally.


  I'm not entirely sure if it is better that way. Pieter, I leave it up to you 
to decide.


  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 5/7] barebox: extract package name argument
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 5/7] barebox: extract package name argument Pieter Smith
  2016-03-31  6:16   ` Yegor Yefremov
@ 2016-04-04 23:01   ` Arnout Vandecappelle
  1 sibling, 0 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 23:01 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> No functional changes: Extracts an argument to the inner-barebox-package
> function to automatically determine the uppercase package name. This is needed
> to support a 2nd config build. This results in the following renaming:
>    'BAREBOX' -> '$(1)'
>
> All barebox packages are meant to be built from the same sources, so related
> KConfig variables (origin, version and patch directory) are not extracted.

  The first paragraph of the commit message makes it sound as if all BAREBOX 
instances are replaced with $(1), which is not true (as clarified by the second 
paragraph). But I don't see how to formulate it better, so:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
[snip]


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
  2016-03-31  6:03   ` Yegor Yefremov
  2016-04-04 22:31   ` Arnout Vandecappelle
@ 2016-04-04 23:20   ` Arnout Vandecappelle
  2016-04-06 14:53     ` Thomas Petazzoni
  2016-04-06 20:14     ` Pieter Smith
  2 siblings, 2 replies; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 23:20 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> In preparation for building a 2nd barebox config, a configuration option is
> added to allow customization of the image filename when the built image is
> copied to the output/images directory.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>   boot/barebox/Config.in  | 7 +++++++
>   boot/barebox/barebox.mk | 9 +++++++--
>   2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> index 4f6872c..7769866 100644
> --- a/boot/barebox/Config.in
> +++ b/boot/barebox/Config.in
> @@ -106,6 +106,13 @@ config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>
>   	  Set to barebox.bin for barebox versions older than 2012.10.
>
> +config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +	string "Output image filename"

  With my suggestion of  BR2_TARGET_BAREBOX_IMAGE_NAME, this should be changed 
to e.g. BR2_TARGET_BAREBOX_OUTPUT_IMAGE_NAME. The prompt looks OK though.


  However, on second thought I'm wondering if it is really needed. For u-boot or 
the kernel, we always copy the images with the same name as they were built. If 
that is not what the ROM boot loader expects, the name can be changed in the 
image generation script. For example, genimage.cfg could contain:

image boot.vfat {
         vfat {
                 file MLO {
			"barebox-am33xx-beaglebone-mlo.img"
		}
		file barebox.img {
			"barebox-am33xx-beaglebone.img"
                 }
         }
         size = 8M
}


  What do you think?

  Regards,
  Arnout

> +	default "barebox.bin"
> +	help
> +	  Name to use when copying the barebox image to the output/images
> +	  directory.
> +
>   config BR2_TARGET_BAREBOX_BAREBOXENV
>   	bool "bareboxenv tool in target"
>   	help
> diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
> index d0f28cf..4eea470 100644
> --- a/boot/barebox/barebox.mk
> +++ b/boot/barebox/barebox.mk
> @@ -93,9 +93,11 @@ endef
>
>   define BAREBOX_INSTALL_IMAGES_CMDS
>   	if test -e $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +		cp -L $(@D)/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +		      $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>   	elif test -e $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)); then \
> -		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) $(BINARIES_DIR)/barebox.bin ; \
> +		cp $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE)) \
> +		   $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE)) ; \
>   	else \
>   		echo "error: Specified built image file not found: $(call qstrip,$(BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE))" >&2 ; \
>   		echo "       in: $(@D)/" >&2 ; \
> @@ -124,6 +126,9 @@ endif
>   ifndef BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
>   $(error No barebox built image filename specified. Check your BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE setting)
>   endif
> +ifndef BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> +$(error No barebox output image filename specified. Check your BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE setting)
> +endif
>   endif
>
>   $(eval $(kconfig-package))
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
  2016-03-31  6:12   ` Yegor Yefremov
  2016-04-04 22:59   ` Arnout Vandecappelle
@ 2016-04-04 23:23   ` Arnout Vandecappelle
  2016-04-06 20:26     ` Pieter Smith
  2 siblings, 1 reply; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 23:23 UTC (permalink / raw)
  To: buildroot

  Oh, one thing I forgot...

On 03/20/16 23:35, Pieter Smith wrote:
> +# instantiate this barebox package
> +$(eval $(call barebox-package))

  The $(call ...) is not needed here. call is only needed if there are arguments.

  Regards,
  Arnout
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build Pieter Smith
  2016-03-31  6:17   ` Yegor Yefremov
@ 2016-04-04 23:25   ` Arnout Vandecappelle
  2016-04-24  7:53     ` Pieter Smith
  1 sibling, 1 reply; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 23:25 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> Adds support to build barebox with a 2nd config.
>
> This is useful for building an SPL (Secondary Program Loader) in addition to
> the traditional TPL (Tertiary Program Loader). The Beaglebone Black for example
> has two barebox configurations:
> - am335x_defconfig builds the full barebox bootloader with device tree, and
> - am335x_mlo_defconfig builds the smaller MLO bootloader that loads the full
>    barebox bootloader from the eMMC or SD card.
>
> Signed-off-by: Pieter Smith<pieter@boesman.nl>

  Looks good to me, except for the comments I made for barebox-1:

- BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE name+prompt;

- BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE name or maybe remove;

- Redundant $(call ...)


  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-03-20 22:35 ` [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig Pieter Smith
  2016-03-31  6:21   ` Yegor Yefremov
@ 2016-04-04 23:37   ` Arnout Vandecappelle
  2016-04-19 20:26     ` Pieter Smith
  1 sibling, 1 reply; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-04 23:37 UTC (permalink / raw)
  To: buildroot

On 03/20/16 23:35, Pieter Smith wrote:
> * Builds the barebox MLO and bootloader.
> * Generates a barebox environment that boots from eMMC by default.
> * Barebox integrates a perfectly good device-tree for the bbb, so no dtb is
>    being generated with the kernel.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>   board/beaglebone/barebox.env/boot/sd      |  6 +++++
>   board/beaglebone/barebox.env/config-board |  4 +++
>   configs/beaglebone_barebox_defconfig      | 41 +++++++++++++++++++++++++++++++
>   3 files changed, 51 insertions(+)
>   create mode 100644 board/beaglebone/barebox.env/boot/sd
>   create mode 100644 board/beaglebone/barebox.env/config-board
>   create mode 100644 configs/beaglebone_barebox_defconfig
>
> diff --git a/board/beaglebone/barebox.env/boot/sd b/board/beaglebone/barebox.env/boot/sd
> new file mode 100644
> index 0000000..7a80e29
> --- /dev/null
> +++ b/board/beaglebone/barebox.env/boot/sd
> @@ -0,0 +1,6 @@
> +#!/bin/sh

  Is that needed/useful?

> +
> +global.bootm.image=/boot/zImage
> +#global.bootm.oftree=/boot/oftree

  Maybe repeat here the comment about using the built-in DT.

> +#global.bootm.initrd=<path to initrd>

  I would remove this line, it's not very useful.

> +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext2 rootwait"
> diff --git a/board/beaglebone/barebox.env/config-board b/board/beaglebone/barebox.env/config-board
> new file mode 100644
> index 0000000..cd7b26d
> --- /dev/null
> +++ b/board/beaglebone/barebox.env/config-board
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +
> +global.boot.default=sd
> +
> diff --git a/configs/beaglebone_barebox_defconfig b/configs/beaglebone_barebox_defconfig
> new file mode 100644
> index 0000000..6324dbf
> --- /dev/null
> +++ b/configs/beaglebone_barebox_defconfig
> @@ -0,0 +1,41 @@
> +# architecture
> +BR2_arm=y
> +BR2_cortex_a8=y
> +BR2_ARM_EABIHF=y
> +
> +# system
> +BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"

  Does the default (console) not work well?

> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set

  Why?

> +# BR2_ROOTFS_POST_IMAGE_SCRIPT is not set

  This is the default. However, it would be nice if you could add a genimage 
script. Pandaboard should be a good basis.

> +
> +# filesystem
> +BR2_PACKAGE_AM33X_CM3=y
> +BR2_TARGET_ROOTFS_EXT2=y

  We tend to prefer ext4 nowadays.

> +# BR2_TARGET_ROOTFS_TAR is not set
> +
> +# Linux headers same as kernel, a 4.4 series
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y

  The version should be really locked down, i.e.:

BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"

> +
> +# bootloader
> +BR2_TARGET_BAREBOX=y
> +BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
> +BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone.img"
> +BR2_TARGET_BAREBOX_CUSTOM_ENV=y
> +BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH="board/beaglebone/barebox.env"
> +BR2_TARGET_BAREBOX_2=y
> +BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
> +BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE="barebox-am33xx-beaglebone-mlo.img"
> +BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE="MLO"
> +
> +# kernel
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"

  Maybe you can switch to 4.5 already?

> +BR2_LINUX_KERNEL_USE_DEFCONFIG=y
> +BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
> +BR2_LINUX_KERNEL_ZIMAGE=y
> +
> +# Use the barebox built-in dtb
> +# BR2_LINUX_KERNEL_DTS_SUPPORT is not set

  Good to put this here!

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-04-04 23:20   ` Arnout Vandecappelle
@ 2016-04-06 14:53     ` Thomas Petazzoni
  2016-04-06 20:14     ` Pieter Smith
  1 sibling, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-06 14:53 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 5 Apr 2016 01:20:13 +0200, Arnout Vandecappelle wrote:

> > +config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> > +	string "Output image filename"
> 
>   With my suggestion of  BR2_TARGET_BAREBOX_IMAGE_NAME, this should be changed 
> to e.g. BR2_TARGET_BAREBOX_OUTPUT_IMAGE_NAME. The prompt looks OK though.
> 
> 
>   However, on second thought I'm wondering if it is really needed. For u-boot or 
> the kernel, we always copy the images with the same name as they were built. If 
> that is not what the ROM boot loader expects, the name can be changed in the 
> image generation script. For example, genimage.cfg could contain:
> 
> image boot.vfat {
>          vfat {
>                  file MLO {
> 			"barebox-am33xx-beaglebone-mlo.img"
> 		}
> 		file barebox.img {
> 			"barebox-am33xx-beaglebone.img"
>                  }
>          }
>          size = 8M
> }
> 
> 
>   What do you think?

I agree, we don't do this for U-Boot/kernel or any other thing, so I
don't think we should be doing it for Barebox.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-04-04 23:20   ` Arnout Vandecappelle
  2016-04-06 14:53     ` Thomas Petazzoni
@ 2016-04-06 20:14     ` Pieter Smith
  2016-04-06 23:06       ` Arnout Vandecappelle
  1 sibling, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-06 20:14 UTC (permalink / raw)
  To: buildroot

Hi Arnout / Thomas,

On Tue, Apr 05, 2016 at 01:20:13AM +0200, Arnout Vandecappelle wrote:
> On 03/20/16 23:35, Pieter Smith wrote:
> >In preparation for building a 2nd barebox config, a configuration option is
> >added to allow customization of the image filename when the built image is
> >copied to the output/images directory.
> >
> >Signed-off-by: Pieter Smith <pieter@boesman.nl>
> >---
> >  boot/barebox/Config.in  | 7 +++++++
> >  boot/barebox/barebox.mk | 9 +++++++--
> >  2 files changed, 14 insertions(+), 2 deletions(-)
> >
> >diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
> >index 4f6872c..7769866 100644
> >--- a/boot/barebox/Config.in
> >+++ b/boot/barebox/Config.in
> >@@ -106,6 +106,13 @@ config BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE
> >
> >  	  Set to barebox.bin for barebox versions older than 2012.10.
> >
> >+config BR2_TARGET_BAREBOX_OUTPUT_IMAGE_FILE
> >+	string "Output image filename"
> 
>  With my suggestion of  BR2_TARGET_BAREBOX_IMAGE_NAME, this should be
> changed to e.g. BR2_TARGET_BAREBOX_OUTPUT_IMAGE_NAME. The prompt looks OK
> though.
> 
> 
>  However, on second thought I'm wondering if it is really needed. For u-boot
> or the kernel, we always copy the images with the same name as they were
> built. If that is not what the ROM boot loader expects, the name can be
> changed in the image generation script. For example, genimage.cfg could
> contain:
> 
> image boot.vfat {
>         vfat {
>                 file MLO {
> 			"barebox-am33xx-beaglebone-mlo.img"
> 		}
> 		file barebox.img {
> 			"barebox-am33xx-beaglebone.img"
>                 }
>         }
>         size = 8M
> }
> 
> 
>  What do you think?

I agree that this is cleaner from a buildroot perspective. But this would
require carrying a genimage.cfg patch for barebox as part of
beaglebone_barebox_defconfig. Is this what you are suggesting?

>  Regards,
>  Arnout

[snip]

- Pieter

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

* [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function
  2016-04-04 23:23   ` Arnout Vandecappelle
@ 2016-04-06 20:26     ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-06 20:26 UTC (permalink / raw)
  To: buildroot

On Tue, Apr 05, 2016 at 01:23:36AM +0200, Arnout Vandecappelle wrote:
>  Oh, one thing I forgot...
> 
> On 03/20/16 23:35, Pieter Smith wrote:
> >+# instantiate this barebox package
> >+$(eval $(call barebox-package))
> 
>  The $(call ...) is not needed here. call is only needed if there are arguments.

ACK. Already fixed for v5.

>  Regards,
>  Arnout
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

- Pieter

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

* [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection
  2016-03-31  5:44   ` Yegor Yefremov
@ 2016-04-06 20:28     ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-06 20:28 UTC (permalink / raw)
  To: buildroot

On Thu, Mar 31, 2016 at 07:44:26AM +0200, Yegor Yefremov wrote:
> On Sun, Mar 20, 2016 at 11:35 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > Support selection of the built image filename in a multi-image barebox build.
> > This makes it possible to specify which image to pick in a in a multi-image
> 
> you seem to have double "in a"

ACK. Will be fixed in v5.

[snip]

- Pieter

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-04-06 20:14     ` Pieter Smith
@ 2016-04-06 23:06       ` Arnout Vandecappelle
  2016-04-08  7:51         ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-06 23:06 UTC (permalink / raw)
  To: buildroot

On 04/06/16 22:14, Pieter Smith wrote:
> Hi Arnout / Thomas,
>
> On Tue, Apr 05, 2016 at 01:20:13AM +0200, Arnout Vandecappelle wrote:
[snip]
>>   However, on second thought I'm wondering if it is really needed. For u-boot
>> or the kernel, we always copy the images with the same name as they were
>> built. If that is not what the ROM boot loader expects, the name can be
>> changed in the image generation script. For example, genimage.cfg could
>> contain:
>>
>> image boot.vfat {
>>          vfat {
>>                  file MLO {
>> 			"barebox-am33xx-beaglebone-mlo.img"
>> 		}
>> 		file barebox.img {
>> 			"barebox-am33xx-beaglebone.img"
>>                  }
>>          }
>>          size = 8M
>> }
>>
>>
>>   What do you think?
>
> I agree that this is cleaner from a buildroot perspective. But this would
> require carrying a genimage.cfg patch for barebox as part of
> beaglebone_barebox_defconfig. Is this what you are suggesting?

  I don't really understand what you mean. As I suggested in that patch, it 
would be nice to add a genimage config as well. When you do that, you can use a 
fragment like above to make sure the files will have the correct name in the 
filesystem. (Like above, except I screwed up the indentation :-)

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name
  2016-04-06 23:06       ` Arnout Vandecappelle
@ 2016-04-08  7:51         ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-08  7:51 UTC (permalink / raw)
  To: buildroot

On Thu, Apr 07, 2016 at 01:06:49AM +0200, Arnout Vandecappelle wrote:
> On 04/06/16 22:14, Pieter Smith wrote:
> >Hi Arnout / Thomas,
> >
> >On Tue, Apr 05, 2016 at 01:20:13AM +0200, Arnout Vandecappelle wrote:
> [snip]
> >>  However, on second thought I'm wondering if it is really needed. For u-boot
> >>or the kernel, we always copy the images with the same name as they were
> >>built. If that is not what the ROM boot loader expects, the name can be
> >>changed in the image generation script. For example, genimage.cfg could
> >>contain:
> >>
> >>image boot.vfat {
> >>         vfat {
> >>                 file MLO {
> >>			"barebox-am33xx-beaglebone-mlo.img"
> >>		}
> >>		file barebox.img {
> >>			"barebox-am33xx-beaglebone.img"
> >>                 }
> >>         }
> >>         size = 8M
> >>}
> >>
> >>
> >>  What do you think?
> >
> >I agree that this is cleaner from a buildroot perspective. But this would
> >require carrying a genimage.cfg patch for barebox as part of
> >beaglebone_barebox_defconfig. Is this what you are suggesting?
> 
>  I don't really understand what you mean. As I suggested in that patch, it
> would be nice to add a genimage config as well. When you do that, you can
> use a fragment like above to make sure the files will have the correct name
> in the filesystem. (Like above, except I screwed up the indentation :-)

The vfat file attribute also expects an "image=" key, not just the image name.

Thanks! This will be in v5 of the patch-set.

[snip]

- Pieter Smith

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
                   ` (7 preceding siblings ...)
  2016-03-21 11:38 ` [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Yegor Yefremov
@ 2016-04-19 19:24 ` Thomas Petazzoni
  2016-04-19 20:17   ` Pieter Smith
  8 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-19 19:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:

> Pieter Smith (7):
>   barebox: support multi-image-build image selection
>   barebox: friendly error on missing built image
>   barebox: support custom barebox output image name
>   barebox: introduce barebox-package function
>   barebox: extract package name argument
>   barebox: support 2nd config build
>   beaglebone: adds barebox bootloader defconfig

Since there were some comments on this v4, I marked it as Changes
Requested in our patch tracking system. When you find some time, can
you send an updated v5 of this patch series?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-19 19:24 ` Thomas Petazzoni
@ 2016-04-19 20:17   ` Pieter Smith
  2016-04-20 14:42     ` Yegor Yefremov
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-19 20:17 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Tue, Apr 19, 2016 at 09:24:41PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:
> 
> > Pieter Smith (7):
> >   barebox: support multi-image-build image selection
> >   barebox: friendly error on missing built image
> >   barebox: support custom barebox output image name
> >   barebox: introduce barebox-package function
> >   barebox: extract package name argument
> >   barebox: support 2nd config build
> >   beaglebone: adds barebox bootloader defconfig
> 
> Since there were some comments on this v4, I marked it as Changes
> Requested in our patch tracking system. When you find some time, can
> you send an updated v5 of this patch series?

I have been a little short on time as of late. The patch is complete, but I
am having probably unrelated problems with my BBB set-up that I am trying to
troubleshoot. Nevertheless, I would like to make sure that everything works
before reposting. Maybe Yegor can help to test that everything works?

@Yegor: Do you have time to test the branch on your setup?
  URL:    https://github.com/smipi1/bbb_buildroot.git
  branch: barebox_2nd_config_build-v5

- Pieter

[snip]

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-04-04 23:37   ` Arnout Vandecappelle
@ 2016-04-19 20:26     ` Pieter Smith
  2016-04-19 22:13       ` Arnout Vandecappelle
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-19 20:26 UTC (permalink / raw)
  To: buildroot

On Tue, Apr 05, 2016 at 01:37:46AM +0200, Arnout Vandecappelle wrote:
> On 03/20/16 23:35, Pieter Smith wrote:
> >* Builds the barebox MLO and bootloader.
> >* Generates a barebox environment that boots from eMMC by default.
> >* Barebox integrates a perfectly good device-tree for the bbb, so no dtb is
> >   being generated with the kernel.
> >
> >Signed-off-by: Pieter Smith <pieter@boesman.nl>
> >---
> >  board/beaglebone/barebox.env/boot/sd      |  6 +++++
> >  board/beaglebone/barebox.env/config-board |  4 +++
> >  configs/beaglebone_barebox_defconfig      | 41 +++++++++++++++++++++++++++++++
> >  3 files changed, 51 insertions(+)
> >  create mode 100644 board/beaglebone/barebox.env/boot/sd
> >  create mode 100644 board/beaglebone/barebox.env/config-board
> >  create mode 100644 configs/beaglebone_barebox_defconfig
> >
> >diff --git a/board/beaglebone/barebox.env/boot/sd b/board/beaglebone/barebox.env/boot/sd
> >new file mode 100644
> >index 0000000..7a80e29
> >--- /dev/null
> >+++ b/board/beaglebone/barebox.env/boot/sd
> >@@ -0,0 +1,6 @@
> >+#!/bin/sh
> 
>  Is that needed/useful?

If you are referring to the interpreter specification: I suspect no, but all
barebox scripts in barebox specify the interpreter, so I would like not to
stray from the convention.

If you are referring to the presence of the sd script: Yes. The device name
needs to be changed from the default to work with the Beaglebone.

> >+
> >+global.bootm.image=/boot/zImage
> >+#global.bootm.oftree=/boot/oftree
> 
>  Maybe repeat here the comment about using the built-in DT.

ACK. Will be in v5 of the patch-set. I will not be removing the commented lines
though. The convention is to leave these in so that the user can tune them if
he wants something different.

> >+#global.bootm.initrd=<path to initrd>
> 
>  I would remove this line, it's not very useful.

These are kept in the scripts for a reason. These scripts are left as
placeholders for easy tuning by the user. I also decided to retain this because
it is present in the defaults included with barebox. If you feel strongly about
this, I can remove it, but I would prefer to keep it in.

[snip]

> >+# system
> >+BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
> >+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y
> >+BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
> 
>  Does the default (console) not work well?

I inherited this from the beaglebone_defconfig. I know that the beaglebone uses
a different serial port for the console than the Phytec am33xx modules (the
default for the BSP), so I am quite sure this is necessary.

> >+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
> 
>  Why?

Again... Inherited from beaglebone_defconfig. I see no need to stick to this.
Will be RW in v5 of the patch-set.

> >+# BR2_ROOTFS_POST_IMAGE_SCRIPT is not set
> 
>  This is the default. However, it would be nice if you could add a genimage
> script. Pandaboard should be a good basis.

ACK. Will be in v5 of the patch-set as per the discussion on "[PATCH v4 3/7]
barebox: support custom barebox output image name"

> >+
> >+# filesystem
> >+BR2_PACKAGE_AM33X_CM3=y
> >+BR2_TARGET_ROOTFS_EXT2=y
> 
>  We tend to prefer ext4 nowadays.

ACK. Will be ext4 in v5 of the patch-set.

> >+# BR2_TARGET_ROOTFS_TAR is not set
> >+
> >+# Linux headers same as kernel, a 4.4 series
> >+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
> 
>  The version should be really locked down, i.e.:
> 
> BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"

ACK. Will be locked down in v5 of the patch-set.

[snip]

> >+# kernel
> >+BR2_LINUX_KERNEL=y
> >+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> >+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.6"
> 
>  Maybe you can switch to 4.5 already?

ACK. Will verify and change if nothing breaks.

> >+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
> >+BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
> >+BR2_LINUX_KERNEL_ZIMAGE=y
> >+
> >+# Use the barebox built-in dtb
> >+# BR2_LINUX_KERNEL_DTS_SUPPORT is not set
> 
>  Good to put this here!

As per your recommendation on v4 of the patch-set.

[snip]

- Pieter

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-04-19 20:26     ` Pieter Smith
@ 2016-04-19 22:13       ` Arnout Vandecappelle
  2016-04-23 11:39         ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Arnout Vandecappelle @ 2016-04-19 22:13 UTC (permalink / raw)
  To: buildroot

On 04/19/16 22:26, Pieter Smith wrote:
> On Tue, Apr 05, 2016 at 01:37:46AM +0200, Arnout Vandecappelle wrote:
>> On 03/20/16 23:35, Pieter Smith wrote:
>>> * Builds the barebox MLO and bootloader.
>>> * Generates a barebox environment that boots from eMMC by default.
>>> * Barebox integrates a perfectly good device-tree for the bbb, so no dtb is
>>>    being generated with the kernel.
>>>
>>> Signed-off-by: Pieter Smith <pieter@boesman.nl>
>>> ---
>>>   board/beaglebone/barebox.env/boot/sd      |  6 +++++
>>>   board/beaglebone/barebox.env/config-board |  4 +++
>>>   configs/beaglebone_barebox_defconfig      | 41 +++++++++++++++++++++++++++++++
>>>   3 files changed, 51 insertions(+)
>>>   create mode 100644 board/beaglebone/barebox.env/boot/sd
>>>   create mode 100644 board/beaglebone/barebox.env/config-board
>>>   create mode 100644 configs/beaglebone_barebox_defconfig
>>>
>>> diff --git a/board/beaglebone/barebox.env/boot/sd b/board/beaglebone/barebox.env/boot/sd
>>> new file mode 100644
>>> index 0000000..7a80e29
>>> --- /dev/null
>>> +++ b/board/beaglebone/barebox.env/boot/sd
>>> @@ -0,0 +1,6 @@
>>> +#!/bin/sh
>>
>>   Is that needed/useful?
>
> If you are referring to the interpreter specification: I suspect no, but all
> barebox scripts in barebox specify the interpreter, so I would like not to
> stray from the convention.

  That's what I meant. So ok.

>
> If you are referring to the presence of the sd script: Yes. The device name
> needs to be changed from the default to work with the Beaglebone.
>
>>> +
>>> +global.bootm.image=/boot/zImage
>>> +#global.bootm.oftree=/boot/oftree
>>
>>   Maybe repeat here the comment about using the built-in DT.
>
> ACK. Will be in v5 of the patch-set. I will not be removing the commented lines
> though. The convention is to leave these in so that the user can tune them if
> he wants something different.

  ok.

>
>>> +#global.bootm.initrd=<path to initrd>
>>
>>   I would remove this line, it's not very useful.
>
> These are kept in the scripts for a reason. These scripts are left as
> placeholders for easy tuning by the user. I also decided to retain this because
> it is present in the defaults included with barebox. If you feel strongly about
> this, I can remove it, but I would prefer to keep it in.

  ok.

>
> [snip]
>
>>> +# system
>>> +BR2_TARGET_GENERIC_HOSTNAME="beaglebone"
>>> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y
>>> +BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
>>
>>   Does the default (console) not work well?
>
> I inherited this from the beaglebone_defconfig. I know that the beaglebone uses
> a different serial port for the console than the Phytec am33xx modules (the
> default for the BSP), so I am quite sure this is necessary.

  The serial port is already set in the barebox config, and is already passed on 
the kernel command line, so there shouldn't be a need to set it explicitly again 
in the buildroot config. The default getty port is 'console', which means to use 
the kernel console as getty port. In most cases that's what you want.

  The beaglebone defconfig still had an explicit getty port because it is still 
from the time that the default getty port was tty1.

  So, ideally, please test that it still works without this line. But since you 
don't have a working beaglebone at the moment that will be tough...

[snip]
>>> +# Use the barebox built-in dtb
>>> +# BR2_LINUX_KERNEL_DTS_SUPPORT is not set
>>
>>   Good to put this here!
>
> As per your recommendation on v4 of the patch-set.

  I'm so great :-)

  Regards,
  Arnout



-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-19 20:17   ` Pieter Smith
@ 2016-04-20 14:42     ` Yegor Yefremov
  2016-04-20 16:42       ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Yegor Yefremov @ 2016-04-20 14:42 UTC (permalink / raw)
  To: buildroot

On Tue, Apr 19, 2016 at 10:17 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Hi Thomas,
>
> On Tue, Apr 19, 2016 at 09:24:41PM +0200, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:
>>
>> > Pieter Smith (7):
>> >   barebox: support multi-image-build image selection
>> >   barebox: friendly error on missing built image
>> >   barebox: support custom barebox output image name
>> >   barebox: introduce barebox-package function
>> >   barebox: extract package name argument
>> >   barebox: support 2nd config build
>> >   beaglebone: adds barebox bootloader defconfig
>>
>> Since there were some comments on this v4, I marked it as Changes
>> Requested in our patch tracking system. When you find some time, can
>> you send an updated v5 of this patch series?
>
> I have been a little short on time as of late. The patch is complete, but I
> am having probably unrelated problems with my BBB set-up that I am trying to
> troubleshoot. Nevertheless, I would like to make sure that everything works
> before reposting. Maybe Yegor can help to test that everything works?
>
> @Yegor: Do you have time to test the branch on your setup?
>   URL:    https://github.com/smipi1/bbb_buildroot.git
>   branch: barebox_2nd_config_build-v5

Have made basic tests, i.e. changing configuration for barebox and
barebox-2 and running make to see, if proper barebox was compiled.
Everything is working the way it was in v4 from this point of view.

Yegor

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-20 14:42     ` Yegor Yefremov
@ 2016-04-20 16:42       ` Pieter Smith
  2016-04-21 10:55         ` Yegor Yefremov
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-20 16:42 UTC (permalink / raw)
  To: buildroot

Hi Yegor,

On Wed, Apr 20, 2016 at 04:42:20PM +0200, Yegor Yefremov wrote:
> On Tue, Apr 19, 2016 at 10:17 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > Hi Thomas,
> >
> > On Tue, Apr 19, 2016 at 09:24:41PM +0200, Thomas Petazzoni wrote:
> >> Hello,
> >>
> >> On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:
> >>
> >> > Pieter Smith (7):
> >> >   barebox: support multi-image-build image selection
> >> >   barebox: friendly error on missing built image
> >> >   barebox: support custom barebox output image name
> >> >   barebox: introduce barebox-package function
> >> >   barebox: extract package name argument
> >> >   barebox: support 2nd config build
> >> >   beaglebone: adds barebox bootloader defconfig
> >>
> >> Since there were some comments on this v4, I marked it as Changes
> >> Requested in our patch tracking system. When you find some time, can
> >> you send an updated v5 of this patch series?
> >
> > I have been a little short on time as of late. The patch is complete, but I
> > am having probably unrelated problems with my BBB set-up that I am trying to
> > troubleshoot. Nevertheless, I would like to make sure that everything works
> > before reposting. Maybe Yegor can help to test that everything works?
> >
> > @Yegor: Do you have time to test the branch on your setup?
> >   URL:    https://github.com/smipi1/bbb_buildroot.git
> >   branch: barebox_2nd_config_build-v5
> 
> Have made basic tests, i.e. changing configuration for barebox and
> barebox-2 and running make to see, if proper barebox was compiled.
> Everything is working the way it was in v4 from this point of view.

Thanks! Did you flash a bare SD card or the internal eMMC with boot.vfat and
rootfs.ext4 as part of the tests?

> 
> Yegor

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-20 16:42       ` Pieter Smith
@ 2016-04-21 10:55         ` Yegor Yefremov
  2016-04-21 11:29           ` Thomas Petazzoni
  2016-04-23 13:05           ` Pieter Smith
  0 siblings, 2 replies; 58+ messages in thread
From: Yegor Yefremov @ 2016-04-21 10:55 UTC (permalink / raw)
  To: buildroot

On Wed, Apr 20, 2016 at 6:42 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Hi Yegor,
>
> On Wed, Apr 20, 2016 at 04:42:20PM +0200, Yegor Yefremov wrote:
>> On Tue, Apr 19, 2016 at 10:17 PM, Pieter Smith <pieter@boesman.nl> wrote:
>> > Hi Thomas,
>> >
>> > On Tue, Apr 19, 2016 at 09:24:41PM +0200, Thomas Petazzoni wrote:
>> >> Hello,
>> >>
>> >> On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:
>> >>
>> >> > Pieter Smith (7):
>> >> >   barebox: support multi-image-build image selection
>> >> >   barebox: friendly error on missing built image
>> >> >   barebox: support custom barebox output image name
>> >> >   barebox: introduce barebox-package function
>> >> >   barebox: extract package name argument
>> >> >   barebox: support 2nd config build
>> >> >   beaglebone: adds barebox bootloader defconfig
>> >>
>> >> Since there were some comments on this v4, I marked it as Changes
>> >> Requested in our patch tracking system. When you find some time, can
>> >> you send an updated v5 of this patch series?
>> >
>> > I have been a little short on time as of late. The patch is complete, but I
>> > am having probably unrelated problems with my BBB set-up that I am trying to
>> > troubleshoot. Nevertheless, I would like to make sure that everything works
>> > before reposting. Maybe Yegor can help to test that everything works?
>> >
>> > @Yegor: Do you have time to test the branch on your setup?
>> >   URL:    https://github.com/smipi1/bbb_buildroot.git
>> >   branch: barebox_2nd_config_build-v5
>>
>> Have made basic tests, i.e. changing configuration for barebox and
>> barebox-2 and running make to see, if proper barebox was compiled.
>> Everything is working the way it was in v4 from this point of view.
>
> Thanks! Did you flash a bare SD card or the internal eMMC with boot.vfat and
> rootfs.ext4 as part of the tests?

If I copy your images (MLO, barebox.bin) directly to the FAT
partition, everything starts as expected. But I dd boot.vfat, the
system doesn't boot and shows only CCCCC, though I have no problems
mounting the first partition in Linux.

sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M

Yegor

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-21 10:55         ` Yegor Yefremov
@ 2016-04-21 11:29           ` Thomas Petazzoni
  2016-04-23 13:01             ` Pieter Smith
  2016-04-24 19:18             ` Peter Korsgaard
  2016-04-23 13:05           ` Pieter Smith
  1 sibling, 2 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-21 11:29 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 21 Apr 2016 12:55:12 +0200, Yegor Yefremov wrote:

> >> Have made basic tests, i.e. changing configuration for barebox and
> >> barebox-2 and running make to see, if proper barebox was compiled.
> >> Everything is working the way it was in v4 from this point of view.
> >
> > Thanks! Did you flash a bare SD card or the internal eMMC with boot.vfat and
> > rootfs.ext4 as part of the tests?
> 
> If I copy your images (MLO, barebox.bin) directly to the FAT
> partition, everything starts as expected. But I dd boot.vfat, the
> system doesn't boot and shows only CCCCC, though I have no problems
> mounting the first partition in Linux.
> 
> sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M

So this means that the Barebox build is OK, and only the genimage part
is causing problems. But this doesn't prevent from merging the barebox
aspects of the series (patches 1 to 6), which are really the important
part. The last patch is really more a defconfig proving that it works,
I am not even sure that in practice we want to merge a defconfig for
BeagleBone that is just different from beaglebone_defconfig in the fact
that it uses Barebox instead of U-Boot. Peter?

Peter, I think you looked at using genimage on AM335x, what were your
conclusion? On OMAP3, there were some very strict geometry restrictions
in the romcode, but I don't remember if your conclusion is that they
also apply to AM335x or not.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig
  2016-04-19 22:13       ` Arnout Vandecappelle
@ 2016-04-23 11:39         ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-23 11:39 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On Wed, Apr 20, 2016 at 12:13:07AM +0200, Arnout Vandecappelle wrote:
> On 04/19/16 22:26, Pieter Smith wrote:
> >On Tue, Apr 05, 2016 at 01:37:46AM +0200, Arnout Vandecappelle wrote:
> >>On 03/20/16 23:35, Pieter Smith wrote:

[snip]

> >>>+BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
> >>
> >>  Does the default (console) not work well?
> >
> >I inherited this from the beaglebone_defconfig. I know that the beaglebone uses
> >a different serial port for the console than the Phytec am33xx modules (the
> >default for the BSP), so I am quite sure this is necessary.
> 
>  The serial port is already set in the barebox config, and is already passed
> on the kernel command line, so there shouldn't be a need to set it
> explicitly again in the buildroot config. The default getty port is
> 'console', which means to use the kernel console as getty port. In most
> cases that's what you want.
> 
>  The beaglebone defconfig still had an explicit getty port because it is
> still from the time that the default getty port was tty1.
> 
>  So, ideally, please test that it still works without this line. But since
> you don't have a working beaglebone at the moment that will be tough...

Tested and it works. Will be gone in patch v5.

> [snip]
> >>>+# Use the barebox built-in dtb
> >>>+# BR2_LINUX_KERNEL_DTS_SUPPORT is not set
> >>
> >>  Good to put this here!
> >
> >As per your recommendation on v4 of the patch-set.
> 
>  I'm so great :-)

Smile once a while when you look down on us mere mortals ;-)

[snip]

- Pieter Smith

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-21 11:29           ` Thomas Petazzoni
@ 2016-04-23 13:01             ` Pieter Smith
  2016-04-23 13:11               ` Thomas Petazzoni
  2016-04-24 19:18             ` Peter Korsgaard
  1 sibling, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-23 13:01 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Thu, Apr 21, 2016 at 01:29:05PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Thu, 21 Apr 2016 12:55:12 +0200, Yegor Yefremov wrote:
> 
> > >> Have made basic tests, i.e. changing configuration for barebox and
> > >> barebox-2 and running make to see, if proper barebox was compiled.
> > >> Everything is working the way it was in v4 from this point of view.
> > >
> > > Thanks! Did you flash a bare SD card or the internal eMMC with boot.vfat and
> > > rootfs.ext4 as part of the tests?
> > 
> > If I copy your images (MLO, barebox.bin) directly to the FAT
> > partition, everything starts as expected. But I dd boot.vfat, the
> > system doesn't boot and shows only CCCCC, though I have no problems
> > mounting the first partition in Linux.
> > 
> > sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M
> 
> So this means that the Barebox build is OK, and only the genimage part
> is causing problems. But this doesn't prevent from merging the barebox
> aspects of the series (patches 1 to 6), which are really the important
> part. The last patch is really more a defconfig proving that it works,
> I am not even sure that in practice we want to merge a defconfig for
> BeagleBone that is just different from beaglebone_defconfig in the fact
> that it uses Barebox instead of U-Boot. Peter?

I agree that the barebox aspects are more important. I would however like to
have the defconfig merged as the first example of how to apply this. It
provides a consistent set targeting a readily available board. With the help of
Yegor I have managed to work the kinks out of the defconfig. The patch has also
been reworked it based on Arnouts valuable input. So there is no need to delay
the series.

All that is left is the suggested BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE ->
BR2_TARGET_BAREBOX_IMAGE_FILE rename and a final master rebase, then I can
post.

> Peter, I think you looked at using genimage on AM335x, what were your
> conclusion? On OMAP3, there were some very strict geometry restrictions
> in the romcode, but I don't remember if your conclusion is that they
> also apply to AM335x or not.

Flashing the boot.vfat separately seems to run afoul of such geometry
restrictions. Using genimage to generate a full sdcard.img however works well
on the BBB. I therefore did not spend more time on the issue because it works
now. Do you see any need to dig deeper, or can the patch be merged based on a
working sdcard.img?

> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-21 10:55         ` Yegor Yefremov
  2016-04-21 11:29           ` Thomas Petazzoni
@ 2016-04-23 13:05           ` Pieter Smith
  1 sibling, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-23 13:05 UTC (permalink / raw)
  To: buildroot

Hi Yegor,

On Thu, Apr 21, 2016 at 12:55:12PM +0200, Yegor Yefremov wrote:
> On Wed, Apr 20, 2016 at 6:42 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > Hi Yegor,
> >
> > On Wed, Apr 20, 2016 at 04:42:20PM +0200, Yegor Yefremov wrote:
> >> On Tue, Apr 19, 2016 at 10:17 PM, Pieter Smith <pieter@boesman.nl> wrote:
> >> > Hi Thomas,
> >> >
> >> > On Tue, Apr 19, 2016 at 09:24:41PM +0200, Thomas Petazzoni wrote:
> >> >> Hello,
> >> >>
> >> >> On Sun, 20 Mar 2016 23:35:44 +0100, Pieter Smith wrote:
> >> >>
> >> >> > Pieter Smith (7):
> >> >> >   barebox: support multi-image-build image selection
> >> >> >   barebox: friendly error on missing built image
> >> >> >   barebox: support custom barebox output image name
> >> >> >   barebox: introduce barebox-package function
> >> >> >   barebox: extract package name argument
> >> >> >   barebox: support 2nd config build
> >> >> >   beaglebone: adds barebox bootloader defconfig
> >> >>
> >> >> Since there were some comments on this v4, I marked it as Changes
> >> >> Requested in our patch tracking system. When you find some time, can
> >> >> you send an updated v5 of this patch series?
> >> >
> >> > I have been a little short on time as of late. The patch is complete, but I
> >> > am having probably unrelated problems with my BBB set-up that I am trying to
> >> > troubleshoot. Nevertheless, I would like to make sure that everything works
> >> > before reposting. Maybe Yegor can help to test that everything works?
> >> >
> >> > @Yegor: Do you have time to test the branch on your setup?
> >> >   URL:    https://github.com/smipi1/bbb_buildroot.git
> >> >   branch: barebox_2nd_config_build-v5
> >>
> >> Have made basic tests, i.e. changing configuration for barebox and
> >> barebox-2 and running make to see, if proper barebox was compiled.
> >> Everything is working the way it was in v4 from this point of view.
> >
> > Thanks! Did you flash a bare SD card or the internal eMMC with boot.vfat and
> > rootfs.ext4 as part of the tests?
> 
> If I copy your images (MLO, barebox.bin) directly to the FAT
> partition, everything starts as expected. But I dd boot.vfat, the
> system doesn't boot and shows only CCCCC, though I have no problems
> mounting the first partition in Linux.
> 
> sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M

As Thomas mentioned in a later mail, there appears to be some tight geometry
restrictions in the ROM. I updated the genimage script to generate a full
sdcard.img. This seems to work without a hitch. Please give it another twirl.

> Yegor

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 13:01             ` Pieter Smith
@ 2016-04-23 13:11               ` Thomas Petazzoni
  2016-04-23 14:35                 ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-23 13:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Apr 2016 15:01:41 +0200, Pieter Smith wrote:

> All that is left is the suggested BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE ->
> BR2_TARGET_BAREBOX_IMAGE_FILE rename and a final master rebase, then I can
> post.

Good.

> Flashing the boot.vfat separately seems to run afoul of such geometry
> restrictions. Using genimage to generate a full sdcard.img however works well
> on the BBB. I therefore did not spend more time on the issue because it works
> now. Do you see any need to dig deeper, or can the patch be merged based on a
> working sdcard.img?

As long as the sdcard.img is working, that's fine.

However, I'm still unsure we will want to merge a defconfig whose only
difference compared to the other beablebone defconfig is that it uses
Barebox. I certainly want to merge the rest of your series, since we do
want to support the use case of people using Barebox on AM335x
platforms, or other platforms that have a two-stage boot process. But
I'm not sure about the defconfig.

Peter, what's your opinion on this?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 13:11               ` Thomas Petazzoni
@ 2016-04-23 14:35                 ` Pieter Smith
  2016-04-23 14:50                   ` Thomas Petazzoni
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-23 14:35 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, 23 Apr 2016, 15:11 Thomas Petazzoni, <
thomas.petazzoni@free-electrons.com> wrote:

> Hello,
>
> On Sat, 23 Apr 2016 15:01:41 +0200, Pieter Smith wrote:
>
> > All that is left is the suggested BR2_TARGET_BAREBOX_BUILT_IMAGE_FILE ->
> > BR2_TARGET_BAREBOX_IMAGE_FILE rename and a final master rebase, then I
> can
> > post.
>
> Good.
>
> > Flashing the boot.vfat separately seems to run afoul of such geometry
> > restrictions. Using genimage to generate a full sdcard.img however works
> well
> > on the BBB. I therefore did not spend more time on the issue because it
> works
> > now. Do you see any need to dig deeper, or can the patch be merged based
> on a
> > working sdcard.img?
>
> As long as the sdcard.img is working, that's fine.
>
> However, I'm still unsure we will want to merge a defconfig whose only
> difference compared to the other beablebone defconfig is that it uses
> Barebox. I certainly want to merge the rest of your series, since we do
> want to support the use case of people using Barebox on AM335x
> platforms, or other platforms that have a two-stage boot process. But
> I'm not sure about the defconfig.
>
> Peter, what's your opinion on this?
>

As I already voiced, I would like to have the defconfig in as a
usage example. An example dramatically cuts the amount
of time required to understand how to use the features.

I also find the BBB with barebox much easier to play with. It
boots faster and is much easier to script.

Do you have another board you would have me target to
Illustrate the features?


> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com


- Pieter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160423/876be975/attachment.html>

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 14:35                 ` Pieter Smith
@ 2016-04-23 14:50                   ` Thomas Petazzoni
  2016-04-23 16:18                     ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-23 14:50 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Apr 2016 14:35:22 +0000, Pieter Smith wrote:

> As I already voiced, I would like to have the defconfig in as a
> usage example.

Well, what you want and what the Buildroot maintainer/core developers
want may be different :-)

My opinion is that there is no point is having gazillions of different
defconfigs for the same board. Your focus is on Barebox, but then the
next developer will want a defconfig for BeagleBone+Qt5, the next one
for BeagleBone+Wayland, the next one for BeagleBone+Kodi, the next one
for BeagleBone as a toaster controller, etc, etc. As you can see, it's
going to be an endless list of unmaintainable defconfigs, so we have to
cut the line somewhere.

And IMO, having a defconfig whose only difference from the
beaglebone_defconfig is to use Barebox instead of U-Boot is not a
useful defconfig.

It would however be useful in a "testing" framework so that we can
validate automatically that the dual Barebox functionality continues to
work over time.

> I also find the BBB with barebox much easier to play with. It
> boots faster and is much easier to script.

That's very subjective, and the default/defacto standard on BeagleBone
remains U-Boot (no matter how much I would prefer Barebox to become
more popular).

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 14:50                   ` Thomas Petazzoni
@ 2016-04-23 16:18                     ` Pieter Smith
  2016-04-23 19:26                       ` Thomas Petazzoni
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-23 16:18 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Apr 23, 2016 at 04:50:13PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sat, 23 Apr 2016 14:35:22 +0000, Pieter Smith wrote:
> 
> > As I already voiced, I would like to have the defconfig in as a
> > usage example.
> 
> Well, what you want and what the Buildroot maintainer/core developers
> want may be different :-)

Yup... If all the world was of one mind, it surely would be a boring place ;-)

I do not want to try to force the beaglebone_barebox_defconfig. Everybody knows
that it doesn't work that way. Is there no value in having SOME FORM of
defconfig to illustrate feature use in buildroot?

> My opinion is that there is no point is having gazillions of different
> defconfigs for the same board. Your focus is on Barebox, but then the
> next developer will want a defconfig for BeagleBone+Qt5, the next one
> for BeagleBone+Wayland, the next one for BeagleBone+Kodi, the next one
> for BeagleBone as a toaster controller, etc, etc. As you can see, it's
> going to be an endless list of unmaintainable defconfigs, so we have to
> cut the line somewhere.

What? No beaglebone_epilator_defconfig? Pity... ;-)

> And IMO, having a defconfig whose only difference from the
> beaglebone_defconfig is to use Barebox instead of U-Boot is not a
> useful defconfig.

I can't find fault with your logic. I am all too aware of how painful the
maintenance burden can become if you don't say no often enough.

> It would however be useful in a "testing" framework so that we can
> validate automatically that the dual Barebox functionality continues to
> work over time.

Agreed. Where can I stall my shiny BBB barebox "regression test" roadster then?

> > I also find the BBB with barebox much easier to play with. It
> > boots faster and is much easier to script.
> 
> That's very subjective, and the default/defacto standard on BeagleBone
> remains U-Boot (no matter how much I would prefer Barebox to become
> more popular).

Oh, if I could change the world... ;-)

Regards,
Pieter

[snip]

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 16:18                     ` Pieter Smith
@ 2016-04-23 19:26                       ` Thomas Petazzoni
  2016-04-24  8:04                         ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-23 19:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Apr 2016 18:18:44 +0200, Pieter Smith wrote:

> > Well, what you want and what the Buildroot maintainer/core developers
> > want may be different :-)
> 
> Yup... If all the world was of one mind, it surely would be a boring place ;-)

Indeed :)

> I do not want to try to force the beaglebone_barebox_defconfig. Everybody knows
> that it doesn't work that way. Is there no value in having SOME FORM of
> defconfig to illustrate feature use in buildroot?

There is a value, but not as a defconfig in configs/ IMO.
Unfortunately, the place/infrastructure where it would have a value
doesn't really exist today.

> > My opinion is that there is no point is having gazillions of different
> > defconfigs for the same board. Your focus is on Barebox, but then the
> > next developer will want a defconfig for BeagleBone+Qt5, the next one
> > for BeagleBone+Wayland, the next one for BeagleBone+Kodi, the next one
> > for BeagleBone as a toaster controller, etc, etc. As you can see, it's
> > going to be an endless list of unmaintainable defconfigs, so we have to
> > cut the line somewhere.
> 
> What? No beaglebone_epilator_defconfig? Pity... ;-)

beaglebone_toothbrush_defconfig :-)

> > It would however be useful in a "testing" framework so that we can
> > validate automatically that the dual Barebox functionality continues to
> > work over time.
> 
> Agreed. Where can I stall my shiny BBB barebox "regression test" roadster then?

My grand plan is to promote something like
https://github.com/tpetazzoni/buildroot-runtime-test in order to
collect test cases (both build-time tests and runtime tests).

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build
  2016-04-04 23:25   ` Arnout Vandecappelle
@ 2016-04-24  7:53     ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-24  7:53 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On Tue, Apr 05, 2016 at 01:25:20AM +0200, Arnout Vandecappelle wrote:
> On 03/20/16 23:35, Pieter Smith wrote:
> >Adds support to build barebox with a 2nd config.
> >
> >This is useful for building an SPL (Secondary Program Loader) in addition to
> >the traditional TPL (Tertiary Program Loader). The Beaglebone Black for example
> >has two barebox configurations:
> >- am335x_defconfig builds the full barebox bootloader with device tree, and
> >- am335x_mlo_defconfig builds the smaller MLO bootloader that loads the full
> >   barebox bootloader from the eMMC or SD card.
> >
> >Signed-off-by: Pieter Smith<pieter@boesman.nl>
> 
>  Looks good to me, except for the comments I made for barebox-1:
> 
> - BR2_TARGET_BAREBOX_2_BUILT_IMAGE_FILE name+prompt;
> 
> - BR2_TARGET_BAREBOX_2_OUTPUT_IMAGE_FILE name or maybe remove;
> 
> - Redundant $(call ...)

All three are resolved in patch v5.

[snip]

Regards,
Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-23 19:26                       ` Thomas Petazzoni
@ 2016-04-24  8:04                         ` Pieter Smith
  2016-04-24  8:16                           ` Thomas Petazzoni
  0 siblings, 1 reply; 58+ messages in thread
From: Pieter Smith @ 2016-04-24  8:04 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Apr 23, 2016 at 09:26:46PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sat, 23 Apr 2016 18:18:44 +0200, Pieter Smith wrote:
> 
> > > Well, what you want and what the Buildroot maintainer/core developers
> > > want may be different :-)
> > 
> > Yup... If all the world was of one mind, it surely would be a boring place ;-)
> 
> Indeed :)
> 
> > I do not want to try to force the beaglebone_barebox_defconfig. Everybody knows
> > that it doesn't work that way. Is there no value in having SOME FORM of
> > defconfig to illustrate feature use in buildroot?
> 
> There is a value, but not as a defconfig in configs/ IMO.
> Unfortunately, the place/infrastructure where it would have a value
> doesn't really exist today.

I will post the patch series including the beaglebone_barebox_defconfig. This
will at least illustrate usage, even if it only lives in the mailing archives.
Should it be required: The buildroot maintainers have my permission to merge
only a sub-set of the patch-series. I do not object to this, and I will make it
clear in the summary.

> > > My opinion is that there is no point is having gazillions of different
> > > defconfigs for the same board. Your focus is on Barebox, but then the
> > > next developer will want a defconfig for BeagleBone+Qt5, the next one
> > > for BeagleBone+Wayland, the next one for BeagleBone+Kodi, the next one
> > > for BeagleBone as a toaster controller, etc, etc. As you can see, it's
> > > going to be an endless list of unmaintainable defconfigs, so we have to
> > > cut the line somewhere.
> > 
> > What? No beaglebone_epilator_defconfig? Pity... ;-)
> 
> beaglebone_toothbrush_defconfig :-)

beaglebone_commodore64_emulator_defconfig?

> > > It would however be useful in a "testing" framework so that we can
> > > validate automatically that the dual Barebox functionality continues to
> > > work over time.
> > 
> > Agreed. Where can I stall my shiny BBB barebox "regression test" roadster then?
> 
> My grand plan is to promote something like
> https://github.com/tpetazzoni/buildroot-runtime-test in order to
> collect test cases (both build-time tests and runtime tests).

Promising. I will remember to have a look at it in a few weeks.

> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24  8:04                         ` Pieter Smith
@ 2016-04-24  8:16                           ` Thomas Petazzoni
  2016-04-24  8:32                             ` Pieter Smith
  0 siblings, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-24  8:16 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 10:04:07 +0200, Pieter Smith wrote:

> I will post the patch series including the beaglebone_barebox_defconfig. This
> will at least illustrate usage, even if it only lives in the mailing archives.
> Should it be required: The buildroot maintainers have my permission to merge
> only a sub-set of the patch-series. I do not object to this, and I will make it
> clear in the summary.

It is in any case very useful to include a defconfig in the series to
ease testing. Another possibility is to include the defconfig used for
testing inside one of the commit log, so that it remains part of the
Git history, and easily available if one looks at the Git commits
touching the barebox package.

> > My grand plan is to promote something like
> > https://github.com/tpetazzoni/buildroot-runtime-test in order to
> > collect test cases (both build-time tests and runtime tests).
> 
> Promising. I will remember to have a look at it in a few weeks.

Well, don't hold your breath: I haven't touched it for months :/

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24  8:16                           ` Thomas Petazzoni
@ 2016-04-24  8:32                             ` Pieter Smith
  2016-04-24  8:47                               ` Thomas Petazzoni
  2016-04-24  8:47                               ` Pieter Smith
  0 siblings, 2 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-24  8:32 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, Apr 24, 2016 at 10:16:53AM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 10:04:07 +0200, Pieter Smith wrote:
> 
> > I will post the patch series including the beaglebone_barebox_defconfig. This
> > will at least illustrate usage, even if it only lives in the mailing archives.
> > Should it be required: The buildroot maintainers have my permission to merge
> > only a sub-set of the patch-series. I do not object to this, and I will make it
> > clear in the summary.
> 
> It is in any case very useful to include a defconfig in the series to
> ease testing. Another possibility is to include the defconfig used for
> testing inside one of the commit log, so that it remains part of the
> Git history, and easily available if one looks at the Git commits
> touching the barebox package.

Augment the last message in the series with the defconfig? Easy enough. Will be
in v5. Or would you like something fancy (E.g. empty commit)?

> > > My grand plan is to promote something like
> > > https://github.com/tpetazzoni/buildroot-runtime-test in order to
> > > collect test cases (both build-time tests and runtime tests).
> > 
> > Promising. I will remember to have a look at it in a few weeks.
> 
> Well, don't hold your breath: I haven't touched it for months :/
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24  8:32                             ` Pieter Smith
@ 2016-04-24  8:47                               ` Thomas Petazzoni
  2016-04-24  8:50                                 ` Pieter Smith
  2016-04-24  8:47                               ` Pieter Smith
  1 sibling, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2016-04-24  8:47 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 10:32:11 +0200, Pieter Smith wrote:

> Augment the last message in the series with the defconfig? Easy enough. Will be
> in v5. Or would you like something fancy (E.g. empty commit)?

Yes, just add it in the message of the last commit, something like:

Tested with the following defconfig:

...

But then it should be a minimal defconfig, not one that includes the
kernel and all.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24  8:32                             ` Pieter Smith
  2016-04-24  8:47                               ` Thomas Petazzoni
@ 2016-04-24  8:47                               ` Pieter Smith
  1 sibling, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-24  8:47 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, Apr 24, 2016 at 10:32:11AM +0200, Pieter Smith wrote:
> Hi Thomas,
> 
> On Sun, Apr 24, 2016 at 10:16:53AM +0200, Thomas Petazzoni wrote:
> > Hello,
> > 
> > On Sun, 24 Apr 2016 10:04:07 +0200, Pieter Smith wrote:
> > 
> > > I will post the patch series including the beaglebone_barebox_defconfig. This
> > > will at least illustrate usage, even if it only lives in the mailing archives.
> > > Should it be required: The buildroot maintainers have my permission to merge
> > > only a sub-set of the patch-series. I do not object to this, and I will make it
> > > clear in the summary.
> > 
> > It is in any case very useful to include a defconfig in the series to
> > ease testing. Another possibility is to include the defconfig used for
> > testing inside one of the commit log, so that it remains part of the
> > Git history, and easily available if one looks at the Git commits
> > touching the barebox package.
> 
> Augment the last message in the series with the defconfig? Easy enough. Will be
> in v5. Or would you like something fancy (E.g. empty commit)?

The largest part of the barebox defconfig is the post-image scripting and
barebox environment tuning totalling 4 additional files. Should I add these to
the commit-log as well?

[snip]

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24  8:47                               ` Thomas Petazzoni
@ 2016-04-24  8:50                                 ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-24  8:50 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, Apr 24, 2016 at 10:47:01AM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 10:32:11 +0200, Pieter Smith wrote:
> 
> > Augment the last message in the series with the defconfig? Easy enough. Will be
> > in v5. Or would you like something fancy (E.g. empty commit)?
> 
> Yes, just add it in the message of the last commit, something like:
> 
> Tested with the following defconfig:
> 
> ...
> 
> But then it should be a minimal defconfig, not one that includes the
> kernel and all.

Understood. I will also omit all the genimage and barebox env tuning scripts.

[snip]

- Pieter

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-21 11:29           ` Thomas Petazzoni
  2016-04-23 13:01             ` Pieter Smith
@ 2016-04-24 19:18             ` Peter Korsgaard
  2016-04-24 21:26               ` Pieter Smith
  1 sibling, 1 reply; 58+ messages in thread
From: Peter Korsgaard @ 2016-04-24 19:18 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

>> If I copy your images (MLO, barebox.bin) directly to the FAT
 >> partition, everything starts as expected. But I dd boot.vfat, the
 >> system doesn't boot and shows only CCCCC, though I have no problems
 >> mounting the first partition in Linux.
 >> 
 >> sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M

 > So this means that the Barebox build is OK, and only the genimage part
 > is causing problems. But this doesn't prevent from merging the barebox
 > aspects of the series (patches 1 to 6), which are really the important
 > part. The last patch is really more a defconfig proving that it works,
 > I am not even sure that in practice we want to merge a defconfig for
 > BeagleBone that is just different from beaglebone_defconfig in the fact
 > that it uses Barebox instead of U-Boot. Peter?

 > Peter, I think you looked at using genimage on AM335x, what were your
 > conclusion? On OMAP3, there were some very strict geometry restrictions
 > in the romcode, but I don't remember if your conclusion is that they
 > also apply to AM335x or not.

The rom code afaik checks that the partition size matches exactly with
the size of the fat file system, so just dd'ing a fat fs image to an
existing partition is unlikely to work:

https://groups.google.com/forum/#!topic/beagleboard/ro5k5r4Cuq4

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB)
  2016-04-24 19:18             ` Peter Korsgaard
@ 2016-04-24 21:26               ` Pieter Smith
  0 siblings, 0 replies; 58+ messages in thread
From: Pieter Smith @ 2016-04-24 21:26 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Sun, Apr 24, 2016 at 09:18:44PM +0200, Peter Korsgaard wrote:
> >>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> 
> Hi,
> 
> >> If I copy your images (MLO, barebox.bin) directly to the FAT
>  >> partition, everything starts as expected. But I dd boot.vfat, the
>  >> system doesn't boot and shows only CCCCC, though I have no problems
>  >> mounting the first partition in Linux.
>  >> 
>  >> sudo dd if=/tmp/boot.vfat of=/dev/sdd1 bs=1M
> 
>  > So this means that the Barebox build is OK, and only the genimage part
>  > is causing problems. But this doesn't prevent from merging the barebox
>  > aspects of the series (patches 1 to 6), which are really the important
>  > part. The last patch is really more a defconfig proving that it works,
>  > I am not even sure that in practice we want to merge a defconfig for
>  > BeagleBone that is just different from beaglebone_defconfig in the fact
>  > that it uses Barebox instead of U-Boot. Peter?
> 
>  > Peter, I think you looked at using genimage on AM335x, what were your
>  > conclusion? On OMAP3, there were some very strict geometry restrictions
>  > in the romcode, but I don't remember if your conclusion is that they
>  > also apply to AM335x or not.
> 
> The rom code afaik checks that the partition size matches exactly with
> the size of the fat file system, so just dd'ing a fat fs image to an
> existing partition is unlikely to work:

Thanks! That explains what I have been observing. Everything works well if you
have genimage generate a full SD card image, MBR and all.

[snip]

- Pieter

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

end of thread, other threads:[~2016-04-24 21:26 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-20 22:35 [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Pieter Smith
2016-03-20 22:35 ` [Buildroot] [PATCH v4 1/7] barebox: support multi-image-build image selection Pieter Smith
2016-03-31  5:44   ` Yegor Yefremov
2016-04-06 20:28     ` Pieter Smith
2016-04-02 15:31   ` Thomas Petazzoni
2016-04-04 22:08     ` Arnout Vandecappelle
2016-04-04 22:16   ` Arnout Vandecappelle
2016-03-20 22:35 ` [Buildroot] [PATCH v4 2/7] barebox: friendly error on missing built image Pieter Smith
2016-03-31  6:01   ` Yegor Yefremov
2016-03-20 22:35 ` [Buildroot] [PATCH v4 3/7] barebox: support custom barebox output image name Pieter Smith
2016-03-31  6:03   ` Yegor Yefremov
2016-04-04 22:31   ` Arnout Vandecappelle
2016-04-04 23:20   ` Arnout Vandecappelle
2016-04-06 14:53     ` Thomas Petazzoni
2016-04-06 20:14     ` Pieter Smith
2016-04-06 23:06       ` Arnout Vandecappelle
2016-04-08  7:51         ` Pieter Smith
2016-03-20 22:35 ` [Buildroot] [PATCH v4 4/7] barebox: introduce barebox-package function Pieter Smith
2016-03-31  6:12   ` Yegor Yefremov
2016-04-04 22:59   ` Arnout Vandecappelle
2016-04-04 23:23   ` Arnout Vandecappelle
2016-04-06 20:26     ` Pieter Smith
2016-03-20 22:35 ` [Buildroot] [PATCH v4 5/7] barebox: extract package name argument Pieter Smith
2016-03-31  6:16   ` Yegor Yefremov
2016-04-04 23:01   ` Arnout Vandecappelle
2016-03-20 22:35 ` [Buildroot] [PATCH v4 6/7] barebox: support 2nd config build Pieter Smith
2016-03-31  6:17   ` Yegor Yefremov
2016-04-04 23:25   ` Arnout Vandecappelle
2016-04-24  7:53     ` Pieter Smith
2016-03-20 22:35 ` [Buildroot] [PATCH v4 7/7] beaglebone: adds barebox bootloader defconfig Pieter Smith
2016-03-31  6:21   ` Yegor Yefremov
2016-04-04 23:37   ` Arnout Vandecappelle
2016-04-19 20:26     ` Pieter Smith
2016-04-19 22:13       ` Arnout Vandecappelle
2016-04-23 11:39         ` Pieter Smith
2016-03-21 11:38 ` [Buildroot] [PATCH v4 0/7] Support building a second Barebox config (incl. BBB) Yegor Yefremov
2016-03-21 11:56   ` Pieter Smith
2016-04-19 19:24 ` Thomas Petazzoni
2016-04-19 20:17   ` Pieter Smith
2016-04-20 14:42     ` Yegor Yefremov
2016-04-20 16:42       ` Pieter Smith
2016-04-21 10:55         ` Yegor Yefremov
2016-04-21 11:29           ` Thomas Petazzoni
2016-04-23 13:01             ` Pieter Smith
2016-04-23 13:11               ` Thomas Petazzoni
2016-04-23 14:35                 ` Pieter Smith
2016-04-23 14:50                   ` Thomas Petazzoni
2016-04-23 16:18                     ` Pieter Smith
2016-04-23 19:26                       ` Thomas Petazzoni
2016-04-24  8:04                         ` Pieter Smith
2016-04-24  8:16                           ` Thomas Petazzoni
2016-04-24  8:32                             ` Pieter Smith
2016-04-24  8:47                               ` Thomas Petazzoni
2016-04-24  8:50                                 ` Pieter Smith
2016-04-24  8:47                               ` Pieter Smith
2016-04-24 19:18             ` Peter Korsgaard
2016-04-24 21:26               ` Pieter Smith
2016-04-23 13:05           ` Pieter Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.