Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config
@ 2016-04-24 21:15 Pieter Smith
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build Pieter Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Pieter Smith @ 2016-04-24 21:15 UTC (permalink / raw)
  To: buildroot

This patch-set adds support for building barebox with an auxiliary config.
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 contain the common stuff.
2. Move the non-shared parts to boot/barebox/barebox and duplicate it in
   boot/barebox/barebox-aux.
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:
v6: Review rework based on feedback from Thomas Pettazoni:
    - Second config build renamed to auxiliary build.
    - Primary package build moved to boot/barebox/barebox to keep things symmetric.
    - Dropped already merged parts of series.
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 (3):
  barebox: prepare for auxiliarry build
  barebox: support auxiliary 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                            | 70 ++++-------------------
 boot/barebox/barebox-aux/Config.in                | 60 +++++++++++++++++++
 boot/barebox/barebox-aux/barebox-aux.hash         |  1 +
 boot/barebox/barebox-aux/barebox-aux.mk           |  8 +++
 boot/barebox/barebox.mk                           |  4 +-
 boot/barebox/barebox/Config.in                    | 65 +++++++++++++++++++++
 boot/barebox/barebox/barebox.hash                 |  1 +
 boot/barebox/barebox/barebox.mk                   |  8 +++
 configs/beaglebone_barebox_defconfig              | 43 ++++++++++++++
 13 files changed, 262 insertions(+), 62 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-aux/Config.in
 create mode 120000 boot/barebox/barebox-aux/barebox-aux.hash
 create mode 100644 boot/barebox/barebox-aux/barebox-aux.mk
 create mode 100644 boot/barebox/barebox/Config.in
 create mode 120000 boot/barebox/barebox/barebox.hash
 create mode 100644 boot/barebox/barebox/barebox.mk
 create mode 100644 configs/beaglebone_barebox_defconfig

-- 
2.5.0

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

* [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build
  2016-04-24 21:15 [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Pieter Smith
@ 2016-04-24 21:15 ` Pieter Smith
  2016-05-01 12:34   ` Thomas Petazzoni
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build Pieter Smith
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Pieter Smith @ 2016-04-24 21:15 UTC (permalink / raw)
  To: buildroot

No functional changes. In preparation for the auxiliary barebox build,
boot/barebox is split into two parts:
1. boot/barebox:
   - The source and patch specification which are to be shared between the
     barebox and barebox-aux packages.
   - The barebox-package function and build logic.
2. boot/barebox/barebox:
   - The package configuration, fragments, barebox env, etc.
   - The actual barebox package make instantiation.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 boot/barebox/Config.in            | 67 +--------------------------------------
 boot/barebox/barebox.mk           |  3 +-
 boot/barebox/barebox/Config.in    | 65 +++++++++++++++++++++++++++++++++++++
 boot/barebox/barebox/barebox.hash |  1 +
 boot/barebox/barebox/barebox.mk   |  8 +++++
 5 files changed, 76 insertions(+), 68 deletions(-)
 create mode 100644 boot/barebox/barebox/Config.in
 create mode 120000 boot/barebox/barebox/barebox.hash
 create mode 100644 boot/barebox/barebox/barebox.mk

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index 0729586..e25b14b 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -64,71 +64,6 @@ config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION
 
 endif
 
-
-choice
-	prompt "Barebox configuration"
-	default BR2_TARGET_BAREBOX_USE_DEFCONFIG
-
-config BR2_TARGET_BAREBOX_USE_DEFCONFIG
-	bool "Using a defconfig"
-
-config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
-	bool "Using a custom config file"
-
-endchoice
-
-config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
-	string "board defconfig"
-	depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG
-	help
-	  Name of the board for which Barebox should be built, without
-	  the _defconfig suffix.
-
-
-config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
-	string "Configuration file path"
-	depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
-	help
-	  Path to the barebox configuration file
-
-config BR2_TARGET_BAREBOX_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_IMAGE_FILE
-	string "Image filename"
-	help
-	  Name of the generated barebox image, which will be copied to
-	  the images directory.
-
-	  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
-	  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.
+source boot/barebox/barebox/Config.in
 
 endif
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index a5b1b1e..8b83bf2 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -142,5 +142,4 @@ endef
 
 barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
 
-# instantiate this barebox package
-$(eval $(barebox-package))
+include boot/barebox/barebox/barebox.mk
diff --git a/boot/barebox/barebox/Config.in b/boot/barebox/barebox/Config.in
new file mode 100644
index 0000000..bf13ea5
--- /dev/null
+++ b/boot/barebox/barebox/Config.in
@@ -0,0 +1,65 @@
+choice
+	prompt "Barebox configuration"
+	default BR2_TARGET_BAREBOX_USE_DEFCONFIG
+
+config BR2_TARGET_BAREBOX_USE_DEFCONFIG
+	bool "Using a defconfig"
+
+config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
+	bool "Using a custom config file"
+
+endchoice
+
+config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
+	string "board defconfig"
+	depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG
+	help
+	  Name of the board for which Barebox should be built, without
+	  the _defconfig suffix.
+
+
+config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
+	string "Configuration file path"
+	depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
+	help
+	  Path to the barebox configuration file
+
+config BR2_TARGET_BAREBOX_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_IMAGE_FILE
+	string "Image filename"
+	help
+	  Name of the generated barebox image, which will be copied to
+	  the images directory.
+
+	  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
+	  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.
diff --git a/boot/barebox/barebox/barebox.hash b/boot/barebox/barebox/barebox.hash
new file mode 120000
index 0000000..b6462b8
--- /dev/null
+++ b/boot/barebox/barebox/barebox.hash
@@ -0,0 +1 @@
+../barebox.hash
\ No newline at end of file
diff --git a/boot/barebox/barebox/barebox.mk b/boot/barebox/barebox/barebox.mk
new file mode 100644
index 0000000..6a5a80d
--- /dev/null
+++ b/boot/barebox/barebox/barebox.mk
@@ -0,0 +1,8 @@
+################################################################################
+#
+# barebox
+#
+################################################################################
+
+# Instantiate the barebox package
+$(eval $(barebox-package))
-- 
2.5.0

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

* [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build
  2016-04-24 21:15 [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Pieter Smith
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build Pieter Smith
@ 2016-04-24 21:15 ` Pieter Smith
  2016-05-01 12:34   ` Thomas Petazzoni
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig Pieter Smith
  2016-04-24 21:21 ` [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Thomas Petazzoni
  3 siblings, 1 reply; 12+ messages in thread
From: Pieter Smith @ 2016-04-24 21:15 UTC (permalink / raw)
  To: buildroot

Adds support to build barebox with an auxiliary 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_AUX=y
  BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG="am335x_mlo"
  BR2_TARGET_BAREBOX_AUX_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                    | 15 ++++++++
 boot/barebox/barebox-aux/Config.in        | 60 +++++++++++++++++++++++++++++++
 boot/barebox/barebox-aux/barebox-aux.hash |  1 +
 boot/barebox/barebox-aux/barebox-aux.mk   |  8 +++++
 boot/barebox/barebox.mk                   |  1 +
 5 files changed, 85 insertions(+)
 create mode 100644 boot/barebox/barebox-aux/Config.in
 create mode 120000 boot/barebox/barebox-aux/barebox-aux.hash
 create mode 100644 boot/barebox/barebox-aux/barebox-aux.mk

diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in
index e25b14b..b430a54 100644
--- a/boot/barebox/Config.in
+++ b/boot/barebox/Config.in
@@ -66,4 +66,19 @@ endif
 
 source boot/barebox/barebox/Config.in
 
+menuconfig BR2_TARGET_BAREBOX_AUX
+	bool "Build barebox with an auxiliary config"
+	help
+	  Build barebox with an auxiliary 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_AUX
+
+source boot/barebox/barebox-aux/Config.in
+
+endif
+
 endif
diff --git a/boot/barebox/barebox-aux/Config.in b/boot/barebox/barebox-aux/Config.in
new file mode 100644
index 0000000..745c4ec
--- /dev/null
+++ b/boot/barebox/barebox-aux/Config.in
@@ -0,0 +1,60 @@
+choice
+	prompt "Barebox configuration"
+	default BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
+
+config BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
+	bool "Using a defconfig"
+
+config BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
+	bool "Using a custom config file"
+
+endchoice
+
+config BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG
+	string "board defconfig"
+	depends on BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
+	help
+	  Name of the board for which Barebox should be built, without
+	  the _defconfig suffix.
+
+
+config BR2_TARGET_BAREBOX_AUX_CUSTOM_CONFIG_FILE
+	string "Configuration file path"
+	depends on BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
+	help
+	  Path to the barebox configuration file
+
+config BR2_TARGET_BAREBOX_AUX_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_AUX_IMAGE_FILE
+	string "Image filename"
+	help
+	  Name of the generated barebox image, which will be copied to
+	  the images directory.
+
+	  If left empty, defaults to:
+	  - barebox.bin for barebox versions older than 2012.10.
+	  - barebox-flash-image for later versions.
+
+config BR2_TARGET_BAREBOX_AUX_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_AUX_CUSTOM_ENV_PATH
+	string "Environment path"
+	depends on BR2_TARGET_BAREBOX_AUX_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.
diff --git a/boot/barebox/barebox-aux/barebox-aux.hash b/boot/barebox/barebox-aux/barebox-aux.hash
new file mode 120000
index 0000000..b6462b8
--- /dev/null
+++ b/boot/barebox/barebox-aux/barebox-aux.hash
@@ -0,0 +1 @@
+../barebox.hash
\ No newline at end of file
diff --git a/boot/barebox/barebox-aux/barebox-aux.mk b/boot/barebox/barebox-aux/barebox-aux.mk
new file mode 100644
index 0000000..fb287d3
--- /dev/null
+++ b/boot/barebox/barebox-aux/barebox-aux.mk
@@ -0,0 +1,8 @@
+################################################################################
+#
+# barebox-aux
+#
+################################################################################
+
+# Instantiate the auxiliary barebox package
+$(eval $(barebox-package))
diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 8b83bf2..949fb9f 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -143,3 +143,4 @@ endef
 barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
 
 include boot/barebox/barebox/barebox.mk
+include boot/barebox/barebox-aux/barebox-aux.mk
-- 
2.5.0

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

* [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig
  2016-04-24 21:15 [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Pieter Smith
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build Pieter Smith
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build Pieter Smith
@ 2016-04-24 21:15 ` Pieter Smith
  2016-05-01 12:35   ` Thomas Petazzoni
  2016-04-24 21:21 ` [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Thomas Petazzoni
  3 siblings, 1 reply; 12+ messages in thread
From: Pieter Smith @ 2016-04-24 21:15 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..5982c6d
--- /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_AUX=y
+BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG="am335x_mlo"
+BR2_TARGET_BAREBOX_AUX_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] 12+ messages in thread

* [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config
  2016-04-24 21:15 [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Pieter Smith
                   ` (2 preceding siblings ...)
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig Pieter Smith
@ 2016-04-24 21:21 ` Thomas Petazzoni
  2016-04-24 21:24   ` Pieter Smith
  3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-04-24 21:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 23:15:22 +0200, Pieter Smith wrote:

> Revision history:
> v6: Review rework based on feedback from Thomas Pettazoni:
>     - Second config build renamed to auxiliary build.
>     - Primary package build moved to boot/barebox/barebox to keep things symmetric.
>     - Dropped already merged parts of series.

Thanks for this new version, looks good to me! I'll wait for Arnout to
comment and see if he has objections to this way of doing things.

Best regards,

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

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

* [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config
  2016-04-24 21:21 ` [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Thomas Petazzoni
@ 2016-04-24 21:24   ` Pieter Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Pieter Smith @ 2016-04-24 21:24 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, Apr 24, 2016 at 11:21:52PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 23:15:22 +0200, Pieter Smith wrote:
> 
> > Revision history:
> > v6: Review rework based on feedback from Thomas Pettazoni:
> >     - Second config build renamed to auxiliary build.
> >     - Primary package build moved to boot/barebox/barebox to keep things symmetric.
> >     - Dropped already merged parts of series.
> 
> Thanks for this new version, looks good to me! I'll wait for Arnout to
> comment and see if he has objections to this way of doing things.

A pleasure! I hope it holds up. I will be a little short on time the coming month.

[snip]

- Pieter

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

* [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build Pieter Smith
@ 2016-05-01 12:34   ` Thomas Petazzoni
  2016-05-01 20:49     ` Pieter Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-05-01 12:34 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 23:15:23 +0200, Pieter Smith wrote:
> No functional changes. In preparation for the auxiliary barebox build,
> boot/barebox is split into two parts:
> 1. boot/barebox:
>    - The source and patch specification which are to be shared between the
>      barebox and barebox-aux packages.
>    - The barebox-package function and build logic.
> 2. boot/barebox/barebox:
>    - The package configuration, fragments, barebox env, etc.
>    - The actual barebox package make instantiation.
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>  boot/barebox/Config.in            | 67 +--------------------------------------
>  boot/barebox/barebox.mk           |  3 +-
>  boot/barebox/barebox/Config.in    | 65 +++++++++++++++++++++++++++++++++++++
>  boot/barebox/barebox/barebox.hash |  1 +
>  boot/barebox/barebox/barebox.mk   |  8 +++++
>  5 files changed, 76 insertions(+), 68 deletions(-)
>  create mode 100644 boot/barebox/barebox/Config.in
>  create mode 120000 boot/barebox/barebox/barebox.hash
>  create mode 100644 boot/barebox/barebox/barebox.mk

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] 12+ messages in thread

* [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build Pieter Smith
@ 2016-05-01 12:34   ` Thomas Petazzoni
  2016-05-01 20:48     ` Pieter Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-05-01 12:34 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 23:15:24 +0200, Pieter Smith wrote:
> Adds support to build barebox with an auxiliary 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_AUX=y
>   BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG="am335x_mlo"
>   BR2_TARGET_BAREBOX_AUX_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                    | 15 ++++++++
>  boot/barebox/barebox-aux/Config.in        | 60 +++++++++++++++++++++++++++++++
>  boot/barebox/barebox-aux/barebox-aux.hash |  1 +
>  boot/barebox/barebox-aux/barebox-aux.mk   |  8 +++++
>  boot/barebox/barebox.mk                   |  1 +
>  5 files changed, 85 insertions(+)
>  create mode 100644 boot/barebox/barebox-aux/Config.in
>  create mode 120000 boot/barebox/barebox-aux/barebox-aux.hash
>  create mode 100644 boot/barebox/barebox-aux/barebox-aux.mk

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] 12+ messages in thread

* [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig
  2016-04-24 21:15 ` [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig Pieter Smith
@ 2016-05-01 12:35   ` Thomas Petazzoni
  2016-05-01 20:46     ` Pieter Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-05-01 12:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Apr 2016 23:15:25 +0200, Pieter Smith wrote:
> * 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>

As we discussed, I've marked this one as rejected in patchwork. I don't
think it's worth hacving a separate defconfig for the BeagleBone, whose
only difference is to use Barebox instead of U-Boot.

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

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

* [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig
  2016-05-01 12:35   ` Thomas Petazzoni
@ 2016-05-01 20:46     ` Pieter Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Pieter Smith @ 2016-05-01 20:46 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, May 01, 2016 at 02:35:18PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 23:15:25 +0200, Pieter Smith wrote:
> > * 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>
> 
> As we discussed, I've marked this one as rejected in patchwork. I don't
> think it's worth hacving a separate defconfig for the BeagleBone, whose
> only difference is to use Barebox instead of U-Boot.

Understood. Hopefully people can find it back in the mail archives. ;-)

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

- Pieter

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

* [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build
  2016-05-01 12:34   ` Thomas Petazzoni
@ 2016-05-01 20:48     ` Pieter Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Pieter Smith @ 2016-05-01 20:48 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, May 01, 2016 at 02:34:40PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 23:15:24 +0200, Pieter Smith wrote:
> > Adds support to build barebox with an auxiliary 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.
> > 

[snip]

> Applied to master, thanks.

Thanks as well.

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

- Pieter

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

* [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build
  2016-05-01 12:34   ` Thomas Petazzoni
@ 2016-05-01 20:49     ` Pieter Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Pieter Smith @ 2016-05-01 20:49 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, May 01, 2016 at 02:34:35PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sun, 24 Apr 2016 23:15:23 +0200, Pieter Smith wrote:
> > No functional changes. In preparation for the auxiliary barebox build,
> > boot/barebox is split into two parts:
> > 1. boot/barebox:
> >    - The source and patch specification which are to be shared between the
> >      barebox and barebox-aux packages.
> >    - The barebox-package function and build logic.
> > 2. boot/barebox/barebox:
> >    - The package configuration, fragments, barebox env, etc.
> >    - The actual barebox package make instantiation.
> > 
> > Signed-off-by: Pieter Smith <pieter@boesman.nl>
> > ---
> >  boot/barebox/Config.in            | 67 +--------------------------------------
> >  boot/barebox/barebox.mk           |  3 +-
> >  boot/barebox/barebox/Config.in    | 65 +++++++++++++++++++++++++++++++++++++
> >  boot/barebox/barebox/barebox.hash |  1 +
> >  boot/barebox/barebox/barebox.mk   |  8 +++++
> >  5 files changed, 76 insertions(+), 68 deletions(-)
> >  create mode 100644 boot/barebox/barebox/Config.in
> >  create mode 120000 boot/barebox/barebox/barebox.hash
> >  create mode 100644 boot/barebox/barebox/barebox.mk
> 
> Applied to master, thanks.

Thanks as well.

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

Regards,
Pieter

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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-24 21:15 [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Pieter Smith
2016-04-24 21:15 ` [Buildroot] [PATCH v6 1/3] barebox: prepare for auxiliarry build Pieter Smith
2016-05-01 12:34   ` Thomas Petazzoni
2016-05-01 20:49     ` Pieter Smith
2016-04-24 21:15 ` [Buildroot] [PATCH v6 2/3] barebox: support auxiliary config build Pieter Smith
2016-05-01 12:34   ` Thomas Petazzoni
2016-05-01 20:48     ` Pieter Smith
2016-04-24 21:15 ` [Buildroot] [PATCH v6 3/3] beaglebone: adds barebox bootloader defconfig Pieter Smith
2016-05-01 12:35   ` Thomas Petazzoni
2016-05-01 20:46     ` Pieter Smith
2016-04-24 21:21 ` [Buildroot] [PATCH v6 0/5] Support building barebox with an auxiliary config Thomas Petazzoni
2016-04-24 21:24   ` Pieter Smith

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