* [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config
@ 2016-04-24 9:18 Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection Pieter Smith
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 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:
v5: Review rework based on feedback from Arnout Vandecappelle, Yegor Yefremov
and Thomas Petazzoni:
- Dropped support to rename output/images (same can be achieved with
genimage)
- Simplified barebox INSTALL_IMAGE_CMDS
- Simplified KConfig option naming
- Appends test defconfig to last commit message
Improvements to the BBB barebox test config:
- Latest kernel and headers
- Tunes barebox.env to boot from eMMC/SD
- Use genimage to generate a full sdcard.img
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 (5):
barebox: support multi-image-build image selection
barebox: introduce barebox-package function
barebox: extract package name argument
barebox: support 2nd config build
beaglebone: adds barebox bootloader defconfig
board/beaglebone/barebox/barebox.env/boot/sd | 11 ++
board/beaglebone/barebox/barebox.env/config-board | 4 +
board/beaglebone/barebox/genimage.cfg | 32 ++++
board/beaglebone/barebox/post-image.sh | 17 +++
boot/barebox/Config.in | 12 ++
boot/barebox/barebox-2/Config.in | 72 +++++++++
boot/barebox/barebox-2/barebox-2.hash | 1 +
boot/barebox/barebox-2/barebox-2.mk | 9 ++
boot/barebox/barebox.mk | 169 +++++++++++++---------
configs/beaglebone_barebox_defconfig | 43 ++++++
10 files changed, 300 insertions(+), 70 deletions(-)
create mode 100644 board/beaglebone/barebox/barebox.env/boot/sd
create mode 100644 board/beaglebone/barebox/barebox.env/config-board
create mode 100644 board/beaglebone/barebox/genimage.cfg
create mode 100755 board/beaglebone/barebox/post-image.sh
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] 14+ messages in thread
* [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
@ 2016-04-24 9:18 ` Pieter Smith
2016-04-24 15:43 ` Thomas Petazzoni
2016-04-24 9:18 ` [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function Pieter Smith
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 UTC (permalink / raw)
To: buildroot
Support optional selection of the built image filename in a multi-image barebox
build. This makes it possible to specify which image to pick in a multi-image
barebox config such as the am335x_defconfig.
Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
boot/barebox/Config.in | 10 ++++++++++
boot/barebox/barebox.mk | 6 +++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index a2d800e..db538b3 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -97,6 +97,16 @@ 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_IMAGE_FILE
+ string "Barebox image filename"
+ default ""
+ help
+ Name of the built barebox image filename
+
+ If left empty, defaults to:
+ - barebox.bin for barebox versions older than 2012.10.
+ - barebox-flash-image for later versions.
+
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..dbda9a1 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -91,8 +91,12 @@ define BAREBOX_BUILD_CMDS
$(BAREBOX_BUILD_CUSTOM_ENV)
endef
+BAREBOX_IMAGE_FILE = $(call qstrip,$(BR2_TARGET_BAREBOX_IMAGE_FILE))
+
define BAREBOX_INSTALL_IMAGES_CMDS
- if test -h $(@D)/barebox-flash-image ; then \
+ if test -n "$(BAREBOX_IMAGE_FILE)"; then \
+ cp -L $(@D)/$(BAREBOX_IMAGE_FILE) $(BINARIES_DIR) ; \
+ elif test -h $(@D)/barebox-flash-image ; then \
cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
else \
cp $(@D)/barebox.bin $(BINARIES_DIR);\
--
2.5.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection Pieter Smith
@ 2016-04-24 9:18 ` Pieter Smith
2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 9:18 ` [Buildroot] [PATCH v5 3/5] barebox: extract package name argument Pieter Smith
` (2 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 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 | 125 ++++++++++++++++++++++++++++--------------------
1 file changed, 72 insertions(+), 53 deletions(-)
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index dbda9a1..883d083 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,97 +36,108 @@ 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
-BAREBOX_IMAGE_FILE = $(call qstrip,$(BR2_TARGET_BAREBOX_IMAGE_FILE))
+BAREBOX_IMAGE_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_IMAGE_FILE))
define BAREBOX_INSTALL_IMAGES_CMDS
- if test -n "$(BAREBOX_IMAGE_FILE)"; then \
- cp -L $(@D)/$(BAREBOX_IMAGE_FILE) $(BINARIES_DIR) ; \
- elif test -h $(@D)/barebox-flash-image ; then \
- cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
+ if test -n "$$(BAREBOX_IMAGE_FILE)"; then \
+ cp -L $$(@D)/$$(BAREBOX_IMAGE_FILE) $$(BINARIES_DIR) ; \
+ elif test -h $$(@D)/barebox-flash-image ; then \
+ cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
else \
- cp $(@D)/barebox.bin $(BINARIES_DIR);\
+ cp $$(@D)/barebox.bin $$(BINARIES_DIR);\
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
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 $(barebox-package))
--
2.5.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 3/5] barebox: extract package name argument
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function Pieter Smith
@ 2016-04-24 9:18 ` Pieter Smith
2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 9:18 ` [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 5/5] beaglebone: adds barebox bootloader defconfig Pieter Smith
4 siblings, 1 reply; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 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 | 121 +++++++++++++++++++++++++-----------------------
1 file changed, 62 insertions(+), 59 deletions(-)
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 883d083..a5b1b1e 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -7,125 +7,128 @@
################################################################################
# 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
-BAREBOX_IMAGE_FILE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_IMAGE_FILE))
+$(1)_IMAGE_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
-define BAREBOX_INSTALL_IMAGES_CMDS
- if test -n "$$(BAREBOX_IMAGE_FILE)"; then \
- cp -L $$(@D)/$$(BAREBOX_IMAGE_FILE) $$(BINARIES_DIR) ; \
+define $(1)_INSTALL_IMAGES_CMDS
+ if test -n "$$($(1)_IMAGE_FILE)"; then \
+ cp -L $$(@D)/$$($(1)_IMAGE_FILE) $$(BINARIES_DIR) ; \
elif test -h $$(@D)/barebox-flash-image ; then \
cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
else \
cp $$(@D)/barebox.bin $$(BINARIES_DIR);\
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
endif
@@ -137,7 +140,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 $(barebox-package))
--
2.5.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
` (2 preceding siblings ...)
2016-04-24 9:18 ` [Buildroot] [PATCH v5 3/5] barebox: extract package name argument Pieter Smith
@ 2016-04-24 9:18 ` Pieter Smith
2016-04-24 15:58 ` Thomas Petazzoni
2016-04-24 9:18 ` [Buildroot] [PATCH v5 5/5] beaglebone: adds barebox bootloader defconfig Pieter Smith
4 siblings, 1 reply; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 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.
Tested with the following defconfig:
# 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_REMOUNT_ROOTFS_RW=y
# filesystem
BR2_PACKAGE_AM33X_CM3=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# bootloader
BR2_TARGET_BAREBOX=y
BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
BR2_TARGET_BAREBOX_IMAGE_FILE="images/barebox-am33xx-beaglebone.img"
BR2_TARGET_BAREBOX_CUSTOM_ENV=y
BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH="board/beaglebone/barebox/barebox.env"
BR2_TARGET_BAREBOX_2=y
BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
BR2_TARGET_BAREBOX_2_IMAGE_FILE="images/barebox-am33xx-beaglebone-mlo.img"
# kernel
BR2_LINUX_KERNEL=y
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
Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
boot/barebox/Config.in | 2 +
boot/barebox/barebox-2/Config.in | 72 +++++++++++++++++++++++++++++++++++
boot/barebox/barebox-2/barebox-2.hash | 1 +
boot/barebox/barebox-2/barebox-2.mk | 9 +++++
boot/barebox/barebox.mk | 3 ++
5 files changed, 87 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 db538b3..5f0274c 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -131,4 +131,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..fa78711
--- /dev/null
+++ b/boot/barebox/barebox-2/Config.in
@@ -0,0 +1,72 @@
+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_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_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..68a9d70
--- /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 $(barebox-package))
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index a5b1b1e..e7d15e2 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -144,3 +144,6 @@ barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
# instantiate this barebox package
$(eval $(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] 14+ messages in thread
* [Buildroot] [PATCH v5 5/5] beaglebone: adds barebox bootloader defconfig
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
` (3 preceding siblings ...)
2016-04-24 9:18 ` [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build Pieter Smith
@ 2016-04-24 9:18 ` Pieter Smith
4 siblings, 0 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 9:18 UTC (permalink / raw)
To: buildroot
* Builds the barebox MLO and bootloader.
* Generates a bootable SD card image with boot and rootfs partitions.
* 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/barebox.env/boot/sd | 11 ++++++
board/beaglebone/barebox/barebox.env/config-board | 4 +++
board/beaglebone/barebox/genimage.cfg | 32 +++++++++++++++++
board/beaglebone/barebox/post-image.sh | 17 +++++++++
configs/beaglebone_barebox_defconfig | 43 +++++++++++++++++++++++
5 files changed, 107 insertions(+)
create mode 100644 board/beaglebone/barebox/barebox.env/boot/sd
create mode 100644 board/beaglebone/barebox/barebox.env/config-board
create mode 100644 board/beaglebone/barebox/genimage.cfg
create mode 100755 board/beaglebone/barebox/post-image.sh
create mode 100644 configs/beaglebone_barebox_defconfig
diff --git a/board/beaglebone/barebox/barebox.env/boot/sd b/board/beaglebone/barebox/barebox.env/boot/sd
new file mode 100644
index 0000000..0cd1be6
--- /dev/null
+++ b/board/beaglebone/barebox/barebox.env/boot/sd
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+global.bootm.image=/boot/zImage
+
+# Default to using the barebox built-in dtb
+# global.bootm.oftree=/boot/oftree
+
+# No initrd
+# global.bootm.initrd=<path to initrd>
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
diff --git a/board/beaglebone/barebox/barebox.env/config-board b/board/beaglebone/barebox/barebox.env/config-board
new file mode 100644
index 0000000..cd7b26d
--- /dev/null
+++ b/board/beaglebone/barebox/barebox.env/config-board
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+global.boot.default=sd
+
diff --git a/board/beaglebone/barebox/genimage.cfg b/board/beaglebone/barebox/genimage.cfg
new file mode 100644
index 0000000..a058ce9
--- /dev/null
+++ b/board/beaglebone/barebox/genimage.cfg
@@ -0,0 +1,32 @@
+image boot.vfat {
+ vfat {
+ file MLO {
+ image = "barebox-am33xx-beaglebone-mlo.img"
+ }
+ file barebox.bin {
+ image = "barebox-am33xx-beaglebone.img"
+ }
+ files = {
+ "barebox.env",
+ "zImage"
+ }
+ }
+ size = 32M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition boot {
+ partition-type = 0xC
+ in-partition-table = "yes"
+ bootable = "true"
+ image = "boot.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ }
+}
diff --git a/board/beaglebone/barebox/post-image.sh b/board/beaglebone/barebox/post-image.sh
new file mode 100755
index 0000000..149ffb1
--- /dev/null
+++ b/board/beaglebone/barebox/post-image.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+exit $?
+
diff --git a/configs/beaglebone_barebox_defconfig b/configs/beaglebone_barebox_defconfig
new file mode 100644
index 0000000..ef86e89
--- /dev/null
+++ b/configs/beaglebone_barebox_defconfig
@@ -0,0 +1,43 @@
+# 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_REMOUNT_ROOTFS_RW=y
+
+# filesystem
+BR2_PACKAGE_AM33X_CM3=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Linux headers same as kernel, a 4.5 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
+
+# bootloader
+BR2_TARGET_BAREBOX=y
+BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
+BR2_TARGET_BAREBOX_IMAGE_FILE="images/barebox-am33xx-beaglebone.img"
+BR2_TARGET_BAREBOX_CUSTOM_ENV=y
+BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH="board/beaglebone/barebox/barebox.env"
+BR2_TARGET_BAREBOX_2=y
+BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
+BR2_TARGET_BAREBOX_2_IMAGE_FILE="images/barebox-am33xx-beaglebone-mlo.img"
+
+# use board/beaglebone/genimage.cfg to generate boot.vfat and sdcard.img
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/barebox/post-image.sh"
+BR2_PACKAGE_HOST_GENIMAGE=y
+
+# kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.5.2"
+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] 14+ messages in thread
* [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection
2016-04-24 9:18 ` [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection Pieter Smith
@ 2016-04-24 15:43 ` Thomas Petazzoni
2016-04-24 21:20 ` Pieter Smith
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2016-04-24 15:43 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Apr 2016 11:18:43 +0200, Pieter Smith wrote:
> Support optional selection of the built image filename in a multi-image barebox
> build. This makes it possible to specify which image to pick in a multi-image
> barebox config such as the am335x_defconfig.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
> boot/barebox/Config.in | 10 ++++++++++
> boot/barebox/barebox.mk | 6 +++++-
> 2 files changed, 15 insertions(+), 1 deletion(-)
Applied to master, after doing a few minor changes:
[Thomas:
- remove default "", since this is the default for string options
- rename the prompt from "Barebox image filename" to "Image filename"
- slightly improve the Config.in help text.]
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function
2016-04-24 9:18 ` [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function Pieter Smith
@ 2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 21:21 ` Pieter Smith
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2016-04-24 15:54 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Apr 2016 11:18:44 +0200, 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>
> ---
> boot/barebox/barebox.mk | 125 ++++++++++++++++++++++++++++--------------------
> 1 file changed, 72 insertions(+), 53 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 3/5] barebox: extract package name argument
2016-04-24 9:18 ` [Buildroot] [PATCH v5 3/5] barebox: extract package name argument Pieter Smith
@ 2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 21:21 ` Pieter Smith
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2016-04-24 15:54 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Apr 2016 11:18:45 +0200, 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.
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
> boot/barebox/barebox.mk | 121 +++++++++++++++++++++++++-----------------------
> 1 file changed, 62 insertions(+), 59 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build
2016-04-24 9:18 ` [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build Pieter Smith
@ 2016-04-24 15:58 ` Thomas Petazzoni
2016-04-24 16:52 ` Pieter Smith
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2016-04-24 15:58 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Apr 2016 11:18:46 +0200, Pieter Smith wrote:
> boot/barebox/Config.in | 2 +
> boot/barebox/barebox-2/Config.in | 72 +++++++++++++++++++++++++++++++++++
> boot/barebox/barebox-2/barebox-2.hash | 1 +
> boot/barebox/barebox-2/barebox-2.mk | 9 +++++
> boot/barebox/barebox.mk | 3 ++
Regarding this one, I am not sure, there are two things that bother me
a bit:
- The name "barebox-2", which I find a bit weird. What about
"barebox-aux" or something like that, as opposed to "barebox-main" ?
- The organization of the folders. Having the barebox "infra" + the
main barebox package both defined in boot/barebox/barebox.mk seems
weird. Ideally, I would have preferred something like:
boot/barebox/barebox.mk <-- common infrastructure
boot/barebox/barebox-main/ <-- the main Barebox
boot/barebox/barebox-aux/ <-- the auxiliary Barebox
Of course, some tricks will be needed to make the barebox-main/
package behave properly when its options will still be named
BR2_TARGET_BAREBOX_<foo> and not BR2_TARGET_BAREBOX_MAIN_<foo>.
Alternatively, if that really doesn't work, what about:
boot/barebox/barebox.mk <-- common infrastructure
boot/barebox/barebox/ <-- the main Barebox
boot/barebox/barebox-aux/ <-- the auxiliary Barebox
I've applied the first three patches of the series to ease your work,
but I'd like to see if we can get something a bit better for this
patch. I know Arnout has done a lot of review, so don't hesitate to let
me know if all this has already been discussed and why the current
organization has been chosen compared to something more similar to my
proposal.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build
2016-04-24 15:58 ` Thomas Petazzoni
@ 2016-04-24 16:52 ` Pieter Smith
0 siblings, 0 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 16:52 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sun, Apr 24, 2016 at 05:58:03PM +0200, Thomas Petazzoni wrote:
> Hello,
>
> On Sun, 24 Apr 2016 11:18:46 +0200, Pieter Smith wrote:
>
> > boot/barebox/Config.in | 2 +
> > boot/barebox/barebox-2/Config.in | 72 +++++++++++++++++++++++++++++++++++
> > boot/barebox/barebox-2/barebox-2.hash | 1 +
> > boot/barebox/barebox-2/barebox-2.mk | 9 +++++
> > boot/barebox/barebox.mk | 3 ++
>
> Regarding this one, I am not sure, there are two things that bother me
> a bit:
>
> - The name "barebox-2", which I find a bit weird. What about
> "barebox-aux" or something like that, as opposed to "barebox-main" ?
>
> - The organization of the folders. Having the barebox "infra" + the
> main barebox package both defined in boot/barebox/barebox.mk seems
> weird. Ideally, I would have preferred something like:
>
> boot/barebox/barebox.mk <-- common infrastructure
> boot/barebox/barebox-main/ <-- the main Barebox
> boot/barebox/barebox-aux/ <-- the auxiliary Barebox
I had it set up this way, but changed it due to some of the review feedback
that Arnout provided.
> Of course, some tricks will be needed to make the barebox-main/
> package behave properly when its options will still be named
> BR2_TARGET_BAREBOX_<foo> and not BR2_TARGET_BAREBOX_MAIN_<foo>.
> Alternatively, if that really doesn't work, what about:
>
> boot/barebox/barebox.mk <-- common infrastructure
> boot/barebox/barebox/ <-- the main Barebox
> boot/barebox/barebox-aux/ <-- the auxiliary Barebox
This approach seems reasonable. I will set it up this way. I will also rename
all BAREBOX_2 KConfig options to BAREBOX_AUX. Is this acceptable?
> I've applied the first three patches of the series to ease your work,
> but I'd like to see if we can get something a bit better for this
> patch. I know Arnout has done a lot of review, so don't hesitate to let
> me know if all this has already been discussed and why the current
> organization has been chosen compared to something more similar to my
> proposal.
I don't think the organization was changed based on concrete arguments. Arnout
just liked it more this way. I do however like your 2nd proposed organization
more.
[snip]
- Pieter
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection
2016-04-24 15:43 ` Thomas Petazzoni
@ 2016-04-24 21:20 ` Pieter Smith
0 siblings, 0 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 21:20 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sun, Apr 24, 2016 at 05:43:29PM +0200, Thomas Petazzoni wrote:
> Hello,
>
> On Sun, 24 Apr 2016 11:18:43 +0200, Pieter Smith wrote:
> > Support optional selection of the built image filename in a multi-image barebox
> > build. This makes it possible to specify which image to pick in a multi-image
> > barebox config such as the am335x_defconfig.
> >
> > Signed-off-by: Pieter Smith <pieter@boesman.nl>
> > ---
> > boot/barebox/Config.in | 10 ++++++++++
> > boot/barebox/barebox.mk | 6 +++++-
> > 2 files changed, 15 insertions(+), 1 deletion(-)
>
> Applied to master, after doing a few minor changes:
>
> [Thomas:
> - remove default "", since this is the default for string options
> - rename the prompt from "Barebox image filename" to "Image filename"
> - slightly improve the Config.in help text.]
>
> Thanks!
A pleasure!
[snip]
- Pieter
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function
2016-04-24 15:54 ` Thomas Petazzoni
@ 2016-04-24 21:21 ` Pieter Smith
0 siblings, 0 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 21:21 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sun, Apr 24, 2016 at 05:54:43PM +0200, Thomas Petazzoni wrote:
> Hello,
>
> On Sun, 24 Apr 2016 11:18:44 +0200, 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>
> > ---
> > boot/barebox/barebox.mk | 125 ++++++++++++++++++++++++++++--------------------
> > 1 file changed, 72 insertions(+), 53 deletions(-)
>
> Applied to master, thanks.
A pleasure!
[snip]
- Pieter
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v5 3/5] barebox: extract package name argument
2016-04-24 15:54 ` Thomas Petazzoni
@ 2016-04-24 21:21 ` Pieter Smith
0 siblings, 0 replies; 14+ messages in thread
From: Pieter Smith @ 2016-04-24 21:21 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sun, Apr 24, 2016 at 05:54:45PM +0200, Thomas Petazzoni wrote:
> Hello,
>
> On Sun, 24 Apr 2016 11:18:45 +0200, 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.
> >
> > Signed-off-by: Pieter Smith <pieter@boesman.nl>
> > ---
> > boot/barebox/barebox.mk | 121 +++++++++++++++++++++++++-----------------------
> > 1 file changed, 62 insertions(+), 59 deletions(-)
>
> Applied to master, thanks.
A pleasure!
[snip]
- Pieter
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-04-24 21:21 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-24 9:18 [Buildroot] [PATCH v5 0/5] Support building a 2nd Barebox config Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 1/5] barebox: support multi-image-build image selection Pieter Smith
2016-04-24 15:43 ` Thomas Petazzoni
2016-04-24 21:20 ` Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 2/5] barebox: introduce barebox-package function Pieter Smith
2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 21:21 ` Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 3/5] barebox: extract package name argument Pieter Smith
2016-04-24 15:54 ` Thomas Petazzoni
2016-04-24 21:21 ` Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 4/5] barebox: support 2nd config build Pieter Smith
2016-04-24 15:58 ` Thomas Petazzoni
2016-04-24 16:52 ` Pieter Smith
2016-04-24 9:18 ` [Buildroot] [PATCH v5 5/5] beaglebone: adds barebox bootloader defconfig Pieter Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox