Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [v2, 0/4] Supporting building a second Barebox config
@ 2015-11-04 21:20 Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 1/4] barebox: prepare for secondary config build Pieter Smith
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Pieter Smith @ 2015-11-04 21:20 UTC (permalink / raw)
  To: buildroot

This patch-set in 4 parts 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:
1. Have boot/barebox/ containing the common stuff.
2. Add two separate packages boot/barebox-1/ and boot/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 black that makes use of the added functionality.

Pieter Smith (4):
  barebox: prepare for secondary config build
  barebox: adds option to build secondary config
  barebox: user selection of build output images
  beaglebone: adds barebox bootloader defconfig

 boot/barebox/Config.in                | 155 +++++++++++++++++++++++++++++-----
 boot/barebox/barebox-1/barebox-1.hash |   1 +
 boot/barebox/barebox-1/barebox-1.mk   |  89 +++++++++++++++++++
 boot/barebox/barebox-2/barebox-2.hash |   1 +
 boot/barebox/barebox-2/barebox-2.mk   |  51 +++++++++++
 boot/barebox/barebox.mk               |  60 +------------
 configs/beaglebone_barebox_defconfig  |  39 +++++++++
 7 files changed, 317 insertions(+), 79 deletions(-)
 create mode 120000 boot/barebox/barebox-1/barebox-1.hash
 create mode 100644 boot/barebox/barebox-1/barebox-1.mk
 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.1.4

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

* [Buildroot] [v2, 1/4] barebox: prepare for secondary config build
  2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
@ 2015-11-04 21:20 ` Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 2/4] barebox: adds option to build secondary config Pieter Smith
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Pieter Smith @ 2015-11-04 21:20 UTC (permalink / raw)
  To: buildroot

No functional changes, but prepares barebox for building with two
configurations (similar to package/gcc).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in                | 71 ++++++++++++++++++++-----------
 boot/barebox/barebox-1/barebox-1.hash |  1 +
 boot/barebox/barebox-1/barebox-1.mk   | 80 +++++++++++++++++++++++++++++++++++
 boot/barebox/barebox.mk               | 60 +-------------------------
 4 files changed, 128 insertions(+), 84 deletions(-)
 create mode 120000 boot/barebox/barebox-1/barebox-1.hash
 create mode 100644 boot/barebox/barebox-1/barebox-1.mk

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 7e81181..d278e93 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -64,9 +64,52 @@ config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION
 
 endif
 
+config BR2_TARGET_BAREBOX_BAREBOXENV
+	bool "bareboxenv tool in target"
+	help
+	  Install bareboxenv tool in target.
+
+config BR2_TARGET_BAREBOX_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_CUSTOM_ENV_PATH
+	string "Environment path"
+	depends on BR2_TARGET_BAREBOX_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.
 
 choice
-	prompt "Barebox configuration"
+	prompt "Number of Barebox configurations"
+	default BR2_TARGET_BAREBOX_SINGLE_CONFIG
+
+config BR2_TARGET_BAREBOX_ONE_CONFIG
+	select BR2_TARGET_BAREBOX_1
+	bool "Build 1 config"
+	help
+	  Build only one barebox config.
+	  Useful for building the traditional TPL (Tertiary Program
+	  Loader).
+
+endchoice
+
+config BR2_TARGET_BAREBOX_1
+	bool "Barebox configuration 1"
+	default y
+
+if BR2_TARGET_BAREBOX_1
+
+choice
+	prompt "Type of configuration"
 	default BR2_TARGET_BAREBOX_USE_DEFCONFIG
 
 config BR2_TARGET_BAREBOX_USE_DEFCONFIG
@@ -78,7 +121,7 @@ config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
 endchoice
 
 config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
-	string "board defconfig"
+	string "Board defconfig"
 	depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG
 	help
 	  Name of the board for which Barebox should be built, without
@@ -97,28 +140,6 @@ 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_BAREBOXENV
-	bool "bareboxenv tool in target"
-	help
-	  Install bareboxenv tool in target.
-
-config BR2_TARGET_BAREBOX_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_CUSTOM_ENV_PATH
-	string "Environment path"
-	depends on BR2_TARGET_BAREBOX_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
 
 endif
diff --git a/boot/barebox/barebox-1/barebox-1.hash b/boot/barebox/barebox-1/barebox-1.hash
new file mode 120000
index 0000000..b6462b8
--- /dev/null
+++ b/boot/barebox/barebox-1/barebox-1.hash
@@ -0,0 +1 @@
+../barebox.hash
\ No newline at end of file
diff --git a/boot/barebox/barebox-1/barebox-1.mk b/boot/barebox/barebox-1/barebox-1.mk
new file mode 100644
index 0000000..f71069b
--- /dev/null
+++ b/boot/barebox/barebox-1/barebox-1.mk
@@ -0,0 +1,80 @@
+################################################################################
+#
+# barebox-1
+#
+################################################################################
+
+BAREBOX_1_VERSION = $(BAREBOX_VERSION)
+BAREBOX_1_SITE = $(BAREBOX_SITE)
+BAREBOX_1_SITE_METHOD = $(BAREBOX_SITE_METHOD)
+BAREBOX_1_SOURCE = $(BAREBOX_SOURCE)
+BAREBOX_1_DEPENDENCIES = $(BAREBOX_DEPENDENCIES)
+BAREBOX_1_LICENSE = $(BAREBOX_LICENSE)
+BAREBOX_1_LICENSE_FILES = $(BAREBOX_LICENSE_FILES)
+BAREBOX_1_POST_PATCH_HOOKS += $(BAREBOX_POST_PATCH_HOOKS)
+BAREBOX_1_MAKE_FLAGS = $(BAREBOX_MAKE_FLAGS)
+BAREBOX_1_MAKE_ENV = $(BAREBOX_MAKE_ENV)
+BAREBOX_1_INSTALL_IMAGES = $(BAREBOX_INSTALL_IMAGES)
+
+ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
+BAREBOX_1_SOURCE_CONFIG = $(BAREBOX_1_DIR)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
+	$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
+else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
+BAREBOX_1_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
+endif
+
+BAREBOX_1_KCONFIG_FILE = $(BAREBOX_1_SOURCE_CONFIG)
+BAREBOX_1_KCONFIG_FRAGMENT_FILES = $(BAREBOX_KCONFIG_FRAGMENT_FILES)
+BAREBOX_1_KCONFIG_EDITORS = $(BAREBOX_KCONFIG_EDITORS)
+BAREBOX_1_KCONFIG_OPTS = $(BAREBOX_MAKE_FLAGS)
+
+ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
+define BAREBOX_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_1_ENV_NAME = $(notdir $(call qstrip,\
+	$(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)))
+define BAREBOX_1_BUILD_CUSTOM_ENV
+	$(@D)/scripts/bareboxenv -s \
+		$(call qstrip, $(BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH)) \
+		$(@D)/$(BAREBOX_1_ENV_NAME)
+endef
+define BAREBOX_1_INSTALL_CUSTOM_ENV
+	cp $(@D)/$(BAREBOX_1_ENV_NAME) $(BINARIES_DIR)
+endef
+endif
+
+define BAREBOX_1_BUILD_CMDS
+	$(BAREBOX_1_BUILD_BAREBOXENV_CMDS)
+	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_1_MAKE_FLAGS) -C $(@D)
+	$(BAREBOX_1_BUILD_CUSTOM_ENV)
+endef
+
+define BAREBOX_1_INSTALL_IMAGES_CMDS
+	if 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_1_INSTALL_CUSTOM_ENV)
+endef
+
+ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
+define BAREBOX_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 ($(BAREBOX_1_SOURCE_CONFIG),)
+$(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
+endif
+endif
+
+$(eval $(kconfig-package))
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 00e1537..55bd187 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -55,65 +55,7 @@ endif
 BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(TARGET_CROSS)"
 BAREBOX_MAKE_ENV = $(TARGET_MAKE_ENV)
 
-ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
-BAREBOX_SOURCE_CONFIG = $(BAREBOX_DIR)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
-	$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
-else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
-BAREBOX_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
-endif
-
-BAREBOX_KCONFIG_FILE = $(BAREBOX_SOURCE_CONFIG)
 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)
-
-ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
-define BAREBOX_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
-	$(@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)
-endef
-endif
-
-define BAREBOX_BUILD_CMDS
-	$(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 -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)
-endef
-
-ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
-define BAREBOX_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 ($(BAREBOX_SOURCE_CONFIG),)
-$(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
-endif
-endif
 
-$(eval $(kconfig-package))
+include $(sort $(wildcard boot/barebox/*/*.mk))
-- 
2.1.4

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

* [Buildroot] [v2, 2/4] barebox: adds option to build secondary config
  2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 1/4] barebox: prepare for secondary config build Pieter Smith
@ 2015-11-04 21:20 ` Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 3/4] barebox: user selection of build output images Pieter Smith
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Pieter Smith @ 2015-11-04 21:20 UTC (permalink / raw)
  To: buildroot

Support selection of secondary config, but version, source URL and patches are
shared with barebox bootloader build.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in                | 60 ++++++++++++++++++++++++++++++++++-
 boot/barebox/barebox-2/barebox-2.hash |  1 +
 boot/barebox/barebox-2/barebox-2.mk   | 44 +++++++++++++++++++++++++
 3 files changed, 104 insertions(+), 1 deletion(-)
 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 d278e93..81c07fb 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -100,11 +100,20 @@ config BR2_TARGET_BAREBOX_ONE_CONFIG
 	  Useful for building the traditional TPL (Tertiary Program
 	  Loader).
 
+config BR2_TARGET_BAREBOX_TWO_CONFIGS
+	select BR2_TARGET_BAREBOX_1
+	select BR2_TARGET_BAREBOX_2
+	bool "Build 2 configs"
+	help
+	  Build two barebox configurations.
+	  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.
+
 endchoice
 
 config BR2_TARGET_BAREBOX_1
 	bool "Barebox configuration 1"
-	default y
 
 if BR2_TARGET_BAREBOX_1
 
@@ -142,4 +151,53 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
 
 endif
 
+if BR2_TARGET_BAREBOX_TWO_CONFIGS
+
+config BR2_TARGET_BAREBOX_2
+	bool "Barebox configuration 2"
+
+if BR2_TARGET_BAREBOX_2
+
+choice
+	prompt "Type of 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_INSTALL_FILENAME
+	string "Destination image filename in output/images"
+	default "MLO"
+	help
+	  Name to give the image in the output/images directory.
+
+endif
+
+endif
+
 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..dd70cc7
--- /dev/null
+++ b/boot/barebox/barebox-2/barebox-2.mk
@@ -0,0 +1,44 @@
+################################################################################
+#
+# barebox-2
+#
+################################################################################
+
+BAREBOX_2_VERSION = $(BAREBOX_VERSION)
+BAREBOX_2_SITE = $(BAREBOX_SITE)
+BAREBOX_2_SITE_METHOD = $(BAREBOX_SITE_METHOD)
+BAREBOX_2_SOURCE = $(BAREBOX_SOURCE)
+BAREBOX_2_DEPENDENCIES = $(BAREBOX_DEPENDENCIES)
+BAREBOX_2_LICENSE = $(BAREBOX_LICENSE)
+BAREBOX_2_LICENSE_FILES = $(BAREBOX_LICENSE_FILES)
+BAREBOX_2_POST_PATCH_HOOKS += $(BAREBOX_POST_PATCH_HOOKS)
+BAREBOX_2_MAKE_FLAGS = $(BAREBOX_MAKE_FLAGS)
+BAREBOX_2_MAKE_ENV = $(BAREBOX_MAKE_ENV)
+BAREBOX_2_INSTALL_IMAGES = $(BAREBOX_INSTALL_IMAGES)
+BAREBOX_2_INSTALL_DEST = $(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_BAREBOX_2_INSTALL_FILENAME))
+
+ifeq ($(BR2_TARGET_BAREBOX_2_USE_DEFCONFIG),y)
+BAREBOX_2_SOURCE_CONFIG = $(BAREBOX_2_DIR)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
+	$(BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG))_defconfig
+else ifeq ($(BR2_TARGET_BAREBOX_2_USE_CUSTOM_CONFIG),y)
+BAREBOX_2_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_2_CUSTOM_CONFIG_FILE))
+endif
+
+BAREBOX_2_KCONFIG_FILE = $(BAREBOX_2_SOURCE_CONFIG)
+BAREBOX_2_KCONFIG_FRAGMENT_FILES = $(BAREBOX_KCONFIG_FRAGMENT_FILES)
+BAREBOX_2_KCONFIG_EDITORS = $(BAREBOX_KCONFIG_EDITORS)
+BAREBOX_2_KCONFIG_OPTS = $(BAREBOX_MAKE_FLAGS)
+
+define BAREBOX_2_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_2_MAKE_FLAGS) -C $(@D)
+endef
+
+define BAREBOX_2_INSTALL_IMAGES_CMDS
+	if test -h $(@D)/barebox-flash-image ; then \
+		cp -L $(@D)/barebox-flash-image $(BAREBOX_2_INSTALL_DEST) ; \
+	else \
+		cp $(@D)/barebox.bin $(BAREBOX_2_INSTALL_DEST);\
+	fi
+endef
+
+$(eval $(kconfig-package))
-- 
2.1.4

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

* [Buildroot] [v2, 3/4] barebox: user selection of build output images
  2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 1/4] barebox: prepare for secondary config build Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 2/4] barebox: adds option to build secondary config Pieter Smith
@ 2015-11-04 21:20 ` Pieter Smith
  2015-11-04 21:20 ` [Buildroot] [v2, 4/4] beaglebone: adds barebox bootloader defconfig Pieter Smith
  2016-01-19 10:11 ` [Buildroot] [v2, 0/4] Supporting building a second Barebox config Yegor Yefremov
  4 siblings, 0 replies; 7+ messages in thread
From: Pieter Smith @ 2015-11-04 21:20 UTC (permalink / raw)
  To: buildroot

A non-default image can be selected as the barebox build output in the images/
directory. This typically is needed to select the appropriate image generated
by multi-platform support defconfigs (E.g. am335x).

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

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 81c07fb..19b4e0f 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -149,6 +149,24 @@ 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.
 
+choice
+	prompt "Barebox image file"
+	default BR2_TARGET_BAREBOX_USE_DEFAULT_IMAGE
+
+config BR2_TARGET_BAREBOX_USE_DEFAULT_IMAGE
+	bool "Using the default image file"
+
+config BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE
+	bool "Using a specific image file"
+
+endchoice
+
+config BR2_TARGET_BAREBOX_IMAGE_FILE
+	string "Image file path"
+	depends on BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE
+	help
+	  Name of the built barebox image file in the barebox images directory
+
 endif
 
 if BR2_TARGET_BAREBOX_TWO_CONFIGS
@@ -190,6 +208,24 @@ config BR2_TARGET_BAREBOX_2_CONFIG_FRAGMENT_FILES
 	  A space-separated list of configuration fragment files,
 	  that will be merged to the main Barebox configuration file.
 
+choice
+	prompt "Barebox image file"
+	default BR2_TARGET_BAREBOX_2_USE_DEFAULT_IMAGE
+
+config BR2_TARGET_BAREBOX_2_USE_DEFAULT_IMAGE
+	bool "Using the default image file"
+
+config BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE
+	bool "Using a specific image file"
+
+endchoice
+
+config BR2_TARGET_BAREBOX_2_IMAGE_FILE
+	string "Image file path"
+	depends on BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE
+	help
+	  Name of the built barebox image file in the barebox images directory
+
 config BR2_TARGET_BAREBOX_2_INSTALL_FILENAME
 	string "Destination image filename in output/images"
 	default "MLO"
diff --git a/boot/barebox/barebox-1/barebox-1.mk b/boot/barebox/barebox-1/barebox-1.mk
index f71069b..b28248d 100644
--- a/boot/barebox/barebox-1/barebox-1.mk
+++ b/boot/barebox/barebox-1/barebox-1.mk
@@ -15,6 +15,7 @@ BAREBOX_1_POST_PATCH_HOOKS += $(BAREBOX_POST_PATCH_HOOKS)
 BAREBOX_1_MAKE_FLAGS = $(BAREBOX_MAKE_FLAGS)
 BAREBOX_1_MAKE_ENV = $(BAREBOX_MAKE_ENV)
 BAREBOX_1_INSTALL_IMAGES = $(BAREBOX_INSTALL_IMAGES)
+BAREBOX_1_INSTALL_DEST = $(BINARIES_DIR)/barebox.bin
 
 ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
 BAREBOX_1_SOURCE_CONFIG = $(BAREBOX_1_DIR)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
@@ -54,14 +55,22 @@ define BAREBOX_1_BUILD_CMDS
 	$(BAREBOX_1_BUILD_CUSTOM_ENV)
 endef
 
+ifdef BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE
+define BAREBOX_1_INSTALL_IMAGES_CMDS
+	cp -L $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_IMAGE_FILE)) \
+		$(BAREBOX_1_INSTALL_DEST)
+	$(BAREBOX_1_INSTALL_CUSTOM_ENV)
+endef
+else
 define BAREBOX_1_INSTALL_IMAGES_CMDS
 	if test -h $(@D)/barebox-flash-image ; then \
-		cp -L $(@D)/barebox-flash-image $(BINARIES_DIR)/barebox.bin ; \
+		cp -L $(@D)/barebox-flash-image $(BAREBOX_1_INSTALL_DEST) ; \
 	else \
-		cp $(@D)/barebox.bin $(BINARIES_DIR);\
+		cp $(@D)/barebox.bin $(BAREBOX_1_INSTALL_DEST);\
 	fi
 	$(BAREBOX_1_INSTALL_CUSTOM_ENV)
 endef
+endif
 
 ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
 define BAREBOX_1_INSTALL_TARGET_CMDS
diff --git a/boot/barebox/barebox-2/barebox-2.mk b/boot/barebox/barebox-2/barebox-2.mk
index dd70cc7..b50fc7b 100644
--- a/boot/barebox/barebox-2/barebox-2.mk
+++ b/boot/barebox/barebox-2/barebox-2.mk
@@ -33,6 +33,12 @@ define BAREBOX_2_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_2_MAKE_FLAGS) -C $(@D)
 endef
 
+ifdef BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE
+define BAREBOX_2_INSTALL_IMAGES_CMDS
+	cp -L $(@D)/images/$(call qstrip,$(BR2_TARGET_BAREBOX_2_IMAGE_FILE)) \
+		$(BAREBOX_2_INSTALL_DEST)
+endef
+else
 define BAREBOX_2_INSTALL_IMAGES_CMDS
 	if test -h $(@D)/barebox-flash-image ; then \
 		cp -L $(@D)/barebox-flash-image $(BAREBOX_2_INSTALL_DEST) ; \
@@ -40,5 +46,6 @@ define BAREBOX_2_INSTALL_IMAGES_CMDS
 		cp $(@D)/barebox.bin $(BAREBOX_2_INSTALL_DEST);\
 	fi
 endef
+endif
 
 $(eval $(kconfig-package))
-- 
2.1.4

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

* [Buildroot] [v2, 4/4] beaglebone: adds barebox bootloader defconfig
  2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
                   ` (2 preceding siblings ...)
  2015-11-04 21:20 ` [Buildroot] [v2, 3/4] barebox: user selection of build output images Pieter Smith
@ 2015-11-04 21:20 ` Pieter Smith
  2016-01-19 10:11 ` [Buildroot] [v2, 0/4] Supporting building a second Barebox config Yegor Yefremov
  4 siblings, 0 replies; 7+ messages in thread
From: Pieter Smith @ 2015-11-04 21:20 UTC (permalink / raw)
  To: buildroot

* Builds barebox MLO and the barebox bootloader.
* 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>
---
 configs/beaglebone_barebox_defconfig | 39 ++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 configs/beaglebone_barebox_defconfig

diff --git a/configs/beaglebone_barebox_defconfig b/configs/beaglebone_barebox_defconfig
new file mode 100644
index 0000000..b4fd67b
--- /dev/null
+++ b/configs/beaglebone_barebox_defconfig
@@ -0,0 +1,39 @@
+# 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="board/beaglebone/post-image.sh"
+
+# filesystem
+BR2_PACKAGE_AM33X_CM3=y
+BR2_TARGET_ROOTFS_EXT2=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# lock down headers to avoid breaking with new defaults
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="3.12.10"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_12=y
+
+# bootloader
+BR2_TARGET_BAREBOX_TWO_CONFIGS=y
+BR2_TARGET_BAREBOX=y
+BR2_TARGET_BAREBOX_BOARD_DEFCONFIG="am335x"
+BR2_TARGET_BAREBOX_USE_SPECIFIC_IMAGE=y
+BR2_TARGET_BAREBOX_IMAGE_FILE="barebox-am33xx-beaglebone.img"
+BR2_TARGET_BAREBOX_2=y
+BR2_TARGET_BAREBOX_2_BOARD_DEFCONFIG="am335x_mlo"
+BR2_TARGET_BAREBOX_2_USE_SPECIFIC_IMAGE=y
+BR2_TARGET_BAREBOX_2_IMAGE_FILE="barebox-am33xx-beaglebone-mlo.img"
+
+# kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_LATEST_VERSION=y
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
+BR2_LINUX_KERNEL_ZIMAGE=y
-- 
2.1.4

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

* [Buildroot] [v2, 0/4] Supporting building a second Barebox config
  2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
                   ` (3 preceding siblings ...)
  2015-11-04 21:20 ` [Buildroot] [v2, 4/4] beaglebone: adds barebox bootloader defconfig Pieter Smith
@ 2016-01-19 10:11 ` Yegor Yefremov
  2016-01-20 22:47   ` Pieter Smith
  4 siblings, 1 reply; 7+ messages in thread
From: Yegor Yefremov @ 2016-01-19 10:11 UTC (permalink / raw)
  To: buildroot

Hi Pieter,

On Wed, Nov 4, 2015 at 10:20 PM, Pieter Smith <pieter@boesman.nl> wrote:
> This patch-set in 4 parts 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:
> 1. Have boot/barebox/ containing the common stuff.
> 2. Add two separate packages boot/barebox-1/ and boot/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 black that makes use of the added functionality.
>
> Pieter Smith (4):
>   barebox: prepare for secondary config build
>   barebox: adds option to build secondary config
>   barebox: user selection of build output images
>   beaglebone: adds barebox bootloader defconfig
>
>  boot/barebox/Config.in                | 155 +++++++++++++++++++++++++++++-----
>  boot/barebox/barebox-1/barebox-1.hash |   1 +
>  boot/barebox/barebox-1/barebox-1.mk   |  89 +++++++++++++++++++
>  boot/barebox/barebox-2/barebox-2.hash |   1 +
>  boot/barebox/barebox-2/barebox-2.mk   |  51 +++++++++++
>  boot/barebox/barebox.mk               |  60 +------------
>  configs/beaglebone_barebox_defconfig  |  39 +++++++++
>  7 files changed, 317 insertions(+), 79 deletions(-)
>  create mode 120000 boot/barebox/barebox-1/barebox-1.hash
>  create mode 100644 boot/barebox/barebox-1/barebox-1.mk
>  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

Thanks for the patches. Just wanted to review/test them. They don't
apply cleanly.
Could you please rebase your patches on top of the master branch?

Thanks.

Yegor

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

* [Buildroot] [v2, 0/4] Supporting building a second Barebox config
  2016-01-19 10:11 ` [Buildroot] [v2, 0/4] Supporting building a second Barebox config Yegor Yefremov
@ 2016-01-20 22:47   ` Pieter Smith
  0 siblings, 0 replies; 7+ messages in thread
From: Pieter Smith @ 2016-01-20 22:47 UTC (permalink / raw)
  To: buildroot

Hi Yegor,

On Tue, Jan 19, 2016 at 11:11:44AM +0100, Yegor Yefremov wrote:
> Hi Pieter,
> 
> On Wed, Nov 4, 2015 at 10:20 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > This patch-set in 4 parts 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:
> > 1. Have boot/barebox/ containing the common stuff.
> > 2. Add two separate packages boot/barebox-1/ and boot/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 black that makes use of the added functionality.
> >
> > Pieter Smith (4):
> >   barebox: prepare for secondary config build
> >   barebox: adds option to build secondary config
> >   barebox: user selection of build output images
> >   beaglebone: adds barebox bootloader defconfig
> >
> >  boot/barebox/Config.in                | 155 +++++++++++++++++++++++++++++-----
> >  boot/barebox/barebox-1/barebox-1.hash |   1 +
> >  boot/barebox/barebox-1/barebox-1.mk   |  89 +++++++++++++++++++
> >  boot/barebox/barebox-2/barebox-2.hash |   1 +
> >  boot/barebox/barebox-2/barebox-2.mk   |  51 +++++++++++
> >  boot/barebox/barebox.mk               |  60 +------------
> >  configs/beaglebone_barebox_defconfig  |  39 +++++++++
> >  7 files changed, 317 insertions(+), 79 deletions(-)
> >  create mode 120000 boot/barebox/barebox-1/barebox-1.hash
> >  create mode 100644 boot/barebox/barebox-1/barebox-1.mk
> >  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
> 
> Thanks for the patches. Just wanted to review/test them. They don't
> apply cleanly.
> Could you please rebase your patches on top of the master branch?
> 
> Thanks.
> 
> Yegor

As requested, I rebased the patches onto the latest master and reposted bumping
to v3. I look forward to your feedback.

Regards,
Pieter

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

end of thread, other threads:[~2016-01-20 22:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04 21:20 [Buildroot] [v2, 0/4] Supporting building a second Barebox config Pieter Smith
2015-11-04 21:20 ` [Buildroot] [v2, 1/4] barebox: prepare for secondary config build Pieter Smith
2015-11-04 21:20 ` [Buildroot] [v2, 2/4] barebox: adds option to build secondary config Pieter Smith
2015-11-04 21:20 ` [Buildroot] [v2, 3/4] barebox: user selection of build output images Pieter Smith
2015-11-04 21:20 ` [Buildroot] [v2, 4/4] beaglebone: adds barebox bootloader defconfig Pieter Smith
2016-01-19 10:11 ` [Buildroot] [v2, 0/4] Supporting building a second Barebox config Yegor Yefremov
2016-01-20 22:47   ` Pieter Smith

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