Skip to contentSkip to conversation

Add support for a project directory

PATCH New Arnout Vandecappelle (Essensium/Mind) 7 participants 38 messages Oct 13, 2012 – Dec 3, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add support for a project directory

Many buildroot users prefer to keep their project's customizations
separate from buildroot itself. This makes it easier to go to a new buildroot version, and to identify which parts are project- specific. Although it was already possible to keep the project's customization separate, this patch set simplifies it.

It introduces a new config option, BR2_PROJECT_DIR (patch 1).
This symbol is used to set defaults for many other config options (patches 2-7). The buildroot config itself can also be stored in the project directory by setting a default BR2_DEFCONFIG (patch 8).

Patch 9 does a 'make defconfig' and 'make world' in a single run
when a project directory is available.

Patch 10 makes it possible to update all config files (buildroot,
linux, busybox, ...) in a single shot.

Patch 11 adds a 'make projectdir' target to initialize a project
directory. It also creates a Makefile in the project directory:
it downloads buildroot itself, so the project directory is self-sufficient.

Patch 12 adds the thing that everybody has to put in their
post-build script as a configuration option: a rootfs overlay. This patch could also be applied independent of the series (except for the one line that sets a default based on PROJECT_DIR).

Patch 13, finally, adds the PROJECT_DIR concept to the manual.

What is still missing is a way to add custom packages and custom
patches in the project directory. Either can already be done with the BR2_PACKAGE_OVERRIDE_FILE, but I'm considering specific additions:

- For custom packages, including $(PROJECT_DIR)/package/*/*.mk and automatically setting these packages to 'y'. I don't think it's useful to include custom packages in the menuconfig - you just want them to be always enabled.

- For custom patches, add $(PROJECT_DIR)/patches/<pkg>/<pkg>-*.patch to the list of patches that generic-package looks for. The custom patches would come in addition to and after the buildroot patches.

Comments on these last two ideas are welcome.

Two weeks from now (Oct. 28) I'm giving a presentation about buildroot
at T-Dose in Eindhoven. I'll use the project directory concept in that presentation. So if there's any major feedback I'd like to hear it before that time :-)

Regards,
Arnout

---

Arnout Vandecappelle (Essensium/Mind) (13):
Add BR2_PROJECT_DIR config option
Set default BR2_PACKAGE_OVERRIDE_FILE based on BR2_PROJECT_DIR
linux: get default paths from BR2_PROJECT_DIR
busybox: get default paths from BR2_PROJECT_DIR target/generic: get default paths from BR2_PROJECT_DIR
toolchain-crosstool-ng: get default paths from BR2_PROJECT_DIR
uClibc: get default paths from BR2_PROJECT_DIR
Store BR2_DEFCONFIG in .config, and use it to update the original input Skip menuconfig if BR2_DEFCONFIG or BR2_PROJECT_DIR is given. Add update-all-config target
Add target to create a project directory
target/generic: add filesystem overlay option
Document BR2_PROJECT_DIR in the manual

 Config.in                                        |   27 +++++++
 Makefile                                         |   86 +++++++++++++++++++--
 Makefile.project.tmpl                            |   40 ++++++++++
 docs/manual/customize-project.txt                |   37 +++++++++
 docs/manual/customize-rootfs.txt                 |   21 ++---
 docs/manual/customize.txt                        |    2 
 fs/common.mk                                     |    7 +-
 linux/Config.in                                  |    2 
 linux/linux.mk                                   |    2 
 package/busybox/Config.in                        |    1 
 package/busybox/busybox-1.20.x.config            |   26 +++---
 package/busybox/busybox.mk                       |    4 +
 target/generic/Config.in                         |   16 ++++
 toolchain/toolchain-crosstool-ng/Config.in       |    1 
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk |    7 ++
 toolchain/uClibc/Config.in                       |    1 
 toolchain/uClibc/uClibc-0.9.33.config            |   91 +++++++++-------------
 toolchain/uClibc/uclibc.mk                       |    4 +
 18 files changed, 286 insertions(+), 89 deletions(-)
 create mode 100644 Makefile.project.tmpl
 create mode 100644 docs/manual/customize-project.txt
Signature · 1 line
Signature
#1 lore raw

PATCH 1/13 Add BR2_PROJECT_DIR config option

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

This option will be used by subsequent patches to set default values for paths.

---
 Config.in |   13 +++++++++++++
 Makefile  |    3 +++
 2 files changed, 16 insertions(+)
Config.in +13 -0
index dab7787..438964a 100644
@@ -16,6 +16,19 @@ config BR2_HOSTARCH
 
 source "target/Config.in.arch"
 
+# BR2_DEFCONFIG must be set through two configs, because 'option env='
+# removes it from the .config.
+config BR2_PROJECT_DIR_FROM_ENV
+	string
+	option env="BR2_PROJECT_DIR"
+
+config BR2_PROJECT_DIR
+	string "Project directory"
+	default BR2_PROJECT_DIR_FROM_ENV
+	help
+	  This option is used to set defaults for many other configuration
+	  variables.  Each one of those can still be overridden individually.
+
 menu "Build options"
 
 menu "Commands"
Makefile +3 -0
index 0128839..d6136ed 100644
@@ -96,6 +96,8 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 -include $(CONFIG_DIR)/.config
 endif
 
+PROJECT_DIR = $(realpath $(call qstrip,$(BR2_PROJECT_DIR)))
+
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
 ifdef V
@@ -557,6 +559,7 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
+	BR2_PROJECT_DIR=$(PROJECT_DIR) \
 	BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
#2 lore raw

PATCH 2/13 Set default BR2_PACKAGE_OVERRIDE_FILE based on BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 Config.in |    1 +
 1 file changed, 1 insertion(+)
Config.in +1 -0
index 438964a..8cefcc6 100644
@@ -420,6 +420,7 @@ config BR2_HAVE_DEVFILES
 
 config BR2_PACKAGE_OVERRIDE_FILE
 	string "location of a package override file"
+	default "$(PROJECT_DIR)/project.mk" if BR2_PROJECT_DIR != ""
 	default "$(TOPDIR)/local.mk"
 	help
 	  A package override file is a short makefile that contains
#3 lore raw

PATCH 3/13 linux: get default paths from BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
I'm not very happy with the default name 'linux.dts' for the device tree. However, I haven't got a reasonable alternative.

---
 linux/Config.in |    2 ++
 1 file changed, 2 insertions(+)
linux/Config.in +2 -0
index 257f934..cf8352d 100644
@@ -121,6 +121,7 @@ config BR2_LINUX_KERNEL_DEFCONFIG
 config BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
 	string "Configuration file path"
 	depends on BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG
+	default "$(PROJECT_DIR)/linux.config" if BR2_PROJECT_DIR != ""
 	help
 	  Path to the kernel configuration file
 
@@ -269,6 +270,7 @@ config BR2_LINUX_KERNEL_INTREE_DTS_NAME
 config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
 	string "Device Tree Source file path"
 	depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS
+	default "$(PROJECT_DIR)/linux.dts" if BR2_PROJECT_DIR != ""
 	help
 	  Path to the device tree source file
 
#4 lore raw

PATCH 4/13 busybox: get default paths from BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 package/busybox/Config.in |    1 +
 1 file changed, 1 insertion(+)
package/busybox/Config.in +1 -0
index dedcf18..020e5c2 100644
@@ -40,6 +40,7 @@ config BR2_BUSYBOX_VERSION
 
 config BR2_PACKAGE_BUSYBOX_CONFIG
 	string "BusyBox configuration file to use?"
+	default "$(PROJECT_DIR)/busybox.config" if BR2_PROJECT_DIR != ""
 	default "package/busybox/busybox-1.20.x.config" if BR2_PACKAGE_BUSYBOX_SNAPSHOT
 	default "package/busybox/busybox-1.18.x.config" if BR2_BUSYBOX_VERSION_1_18_X
 	default "package/busybox/busybox-1.19.x.config" if BR2_BUSYBOX_VERSION_1_19_X
#5 lore raw

PATCH 5/13 target/generic: get default paths from BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 fs/common.mk             |    7 +++++--
 target/generic/Config.in |    3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
fs/common.mk +5 -2
index 0f0eae9..bec0921 100644
@@ -33,8 +33,11 @@
 
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
-ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
-	$(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
+# The default device tables in $(PROJECT_DIR) may not exist, so
+# verify that.
+ROOTFS_DEVICE_TABLES = \
+	$(wildcard $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
+	           $(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE)))
 
 define ROOTFS_TARGET_INTERNAL
 
target/generic/Config.in +3 -0
index b8472f4..76137b7 100644
@@ -71,6 +71,7 @@ endchoice
 
 config BR2_ROOTFS_DEVICE_TABLE
 	string "Path to the permission tables"
+	default "$(PROJECT_DIR)/device_table.txt target/generic/device_table.txt" if BR2_PROJECT_DIR != ""
 	default "target/generic/device_table.txt"
 	help
 	  Specify a space-separated list of permission table locations,
@@ -83,6 +84,7 @@ config BR2_ROOTFS_DEVICE_TABLE
 
 config BR2_ROOTFS_STATIC_DEVICE_TABLE
 	string "Path to the device tables"
+	default "$(PROJECT_DIR)/device_table_dev.txt target/generic/device_table_dev.txt" if BR2_PROJECT_DIR != ""
 	default "target/generic/device_table_dev.txt"
 	depends on BR2_ROOTFS_DEVICE_CREATION_STATIC
 	help
@@ -168,6 +170,7 @@ endif # BR2_ROOTFS_SKELETON_DEFAULT
 
 config BR2_ROOTFS_POST_BUILD_SCRIPT
 	string "Custom script to run before creating filesystem images"
+	default "$(PROJECT_DIR)/post-build.sh" if BR2_PROJECT_DIR != ""
 	default ""
 	help
 	  Specify a script to be run after the build has finished and before
#6 lore raw

PATCH 6/13 toolchain-crosstool-ng: get default paths from BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 toolchain/toolchain-crosstool-ng/Config.in |    1 +
 1 file changed, 1 insertion(+)
toolchain/toolchain-crosstool-ng/Config.in +1 -0
index 35ea2b1..9a08768 100644
@@ -36,6 +36,7 @@ config BR2_TOOLCHAIN_CTNG_LIBC
 
 config BR2_TOOLCHAIN_CTNG_CONFIG
 	string "crosstool-NG configuration file to use"
+	default "$(PROJECT_DIR)/crosstool-ng.config" if BR2_PROJECT_DIR != ""
 	default "toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc" if BR2_TOOLCHAIN_CTNG_uClibc
 	default "toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc" if BR2_TOOLCHAIN_CTNG_eglibc
 	default "toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc"  if BR2_TOOLCHAIN_CTNG_glibc
#7 lore raw

PATCH 7/13 uClibc: get default paths from BR2_PROJECT_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 toolchain/uClibc/Config.in |    1 +
 1 file changed, 1 insertion(+)
toolchain/uClibc/Config.in +1 -0
index f46a415..9db0cfc 100644
@@ -42,6 +42,7 @@ config BR2_UCLIBC_VERSION_STRING
 
 config BR2_UCLIBC_CONFIG
 	string "uClibc configuration file to use?"
+	default "$(PROJECT_DIR)/uClibc.config" if BR2_PROJECT_DIR != ""
 	default "toolchain/uClibc/uClibc-0.9.31.config" if BR2_UCLIBC_VERSION_0_9_31
 	default "toolchain/uClibc/uClibc-0.9.32.config" if BR2_UCLIBC_VERSION_0_9_32
 	default "toolchain/uClibc/uClibc-0.9.33.config" if BR2_UCLIBC_VERSION_0_9_33
#8 lore raw

PATCH 8/13 Store BR2_DEFCONFIG in .config, and use it to update the original input

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

defconfig file after updating the configuration.

Also use $(PROJECT_DIR) by default.

As a side-effect of this change, the *config options have been moved out of the BR2_HAVE_DOT_CONFIG condition. Also, the defconfig and savedefconfig targets do need to include .config now, which makes them slightly slower.

---
 Config.in |   13 +++++++++++++
 Makefile  |   22 +++++++++++++---------
 2 files changed, 26 insertions(+), 9 deletions(-)
Config.in +13 -0
index 8cefcc6..4111409 100644
@@ -29,6 +29,19 @@ config BR2_PROJECT_DIR
 	  This option is used to set defaults for many other configuration
 	  variables.  Each one of those can still be overridden individually.
 
+config BR2_DEFCONFIG_FROM_ENV
+	string
+	option env="BR2_DEFCONFIG"
+
+config BR2_DEFCONFIG
+	string "Location to save buildroot config"
+	default "$(PROJECT_DIR)/buildroot.config" if BR2_PROJECT_DIR != ""
+	default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
+	default "defconfig"
+	help
+	  When running 'make savedefconfig', the defconfig file will be saved
+	  in this location.
+
 menu "Build options"
 
 menu "Commands"
Makefile +13 -9
index d6136ed..cbaa0c4 100644
@@ -56,7 +56,7 @@ DATE:=$(shell date +%Y%m%d)
 export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
 
 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
-	defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \
+	%_defconfig allyesconfig allnoconfig silentoldconfig release \
 	randpackageconfig allyespackageconfig allnopackageconfig \
 	source-check print-version
 
@@ -97,6 +97,7 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 endif
 
 PROJECT_DIR = $(realpath $(call qstrip,$(BR2_PROJECT_DIR)))
+DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
@@ -545,6 +546,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+
 # configuration
 # ---------------------------------------------------------------------------
 
@@ -560,6 +563,7 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
 	BR2_PROJECT_DIR=$(PROJECT_DIR) \
+	BR2_DEFCONFIG=$(DEFCONFIG) \
 	BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
@@ -626,24 +630,24 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	$(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
 
-defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
-	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN)
-
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
+defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
+	@mkdir -p $(BUILD_DIR)/buildroot-config
+	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
+
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< \
+		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
+		$(CONFIG_CONFIG_IN)
 
 # check if download URLs are outdated
 source-check:
 	$(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
 
-endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
-
 #############################################################
 #
 # Cleanup and misc junk
@@ -757,5 +761,5 @@ print-version:
 
 include docs/manual/manual.mk
 
-.PHONY: $(noconfig_targets)
+.PHONY: $(noconfig_targets) defconfig savedefconfig
 
#9 lore raw

PATCH 8/13 Store BR2_DEFCONFIG in .config, and use it to update the original input

Hi,

Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

defconfig file after updating the configuration.

The patch title+description are awkwardly split.

Quoted 109 lines

Also use $(PROJECT_DIR) by default.

As a side-effect of this change, the *config options have been moved out of the BR2_HAVE_DOT_CONFIG condition. Also, the defconfig and savedefconfig targets do need to include .config now, which makes them slightly slower.

---
 Config.in |   13 +++++++++++++
 Makefile  |   22 +++++++++++++---------
 2 files changed, 26 insertions(+), 9 deletions(-)
Config.in +13 -0
index 8cefcc6..4111409 100644
@@ -29,6 +29,19 @@ config BR2_PROJECT_DIR
          This option is used to set defaults for many other configuration
          variables.  Each one of those can still be overridden individually.
 
+config BR2_DEFCONFIG_FROM_ENV
+       string
+       option env="BR2_DEFCONFIG"
+
+config BR2_DEFCONFIG
+       string "Location to save buildroot config"
+       default "$(PROJECT_DIR)/buildroot.config" if BR2_PROJECT_DIR != ""
+       default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
+       default "defconfig"
+       help
+         When running 'make savedefconfig', the defconfig file will be saved
+         in this location.
+
 menu "Build options"
 
 menu "Commands"
Makefile +12 -8
index d6136ed..cbaa0c4 100644
@@ -56,7 +56,7 @@ DATE:=$(shell date +%Y%m%d)
 export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
 
 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
-       defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \
+       %_defconfig allyesconfig allnoconfig silentoldconfig release \
        randpackageconfig allyespackageconfig allnopackageconfig \
        source-check print-version
 
@@ -97,6 +97,7 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 endif
 
 PROJECT_DIR = $(realpath $(call qstrip,$(BR2_PROJECT_DIR)))
+DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
@@ -545,6 +546,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+
 # configuration
 # ---------------------------------------------------------------------------
 
@@ -560,6 +563,7 @@ COMMON_CONFIG_ENV = \
        KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
        KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
        BR2_PROJECT_DIR=$(PROJECT_DIR) \
+       BR2_DEFCONFIG=$(DEFCONFIG) \
        BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
@@ -626,24 +630,24 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
        $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
 
-defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
-       @mkdir -p $(BUILD_DIR)/buildroot-config
-       @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN)
-
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
        @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
+defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
+       @mkdir -p $(BUILD_DIR)/buildroot-config
+       @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
+
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @mkdir -p $(BUILD_DIR)/buildroot-config
-       @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN)
+       @$(COMMON_CONFIG_ENV) $< \
+               --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
+               $(CONFIG_CONFIG_IN)
 
 # check if download URLs are outdated
 source-check:
        $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
 
-endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
-
 #############################################################
 #
 # Cleanup and misc junk

Makefile print-version: · line 765

Quoted 6 lines
Makefile +1 -1
@@ -757,5 +761,5 @@ print-version:
 
 include docs/manual/manual.mk
 
-.PHONY: $(noconfig_targets)
+.PHONY: $(noconfig_targets) defconfig savedefconfig
 

Regardless of whether the PROJECT_DIR is accepted or not, I like some of the patches of the set.
I have proposed a patch similar to this one in the past, so obviously I'm in favor of this idea of being able to easily save also the buildroot config directly in the right location.

For busybox, uclibc, etc. it was already possible in one step (make update-busybox-config) while for buildroot .config it was in two
steps: make savedefconfig && mv defconfig configs/....

Best regards,
Thomas

#10 lore raw

PATCH 9/13 Skip menuconfig if BR2_DEFCONFIG or BR2_PROJECT_DIR is given.

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

If BR2_DEFCONFIG or BR2_PROJECT_DIR is given on the command line and it exists, there is no need to go through menuconfig and we can build immediately.

---
 Makefile |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Makefile +16 -0
index cbaa0c4..1f42141 100644
@@ -544,8 +544,24 @@ show-targets:
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
+ifneq ($(PROJECT_DIR),)
+ifeq ($(DEFCONFIG),)
+DEFCONFIG = $(wildcard $(PROJECT_DIR)/buildroot.config)
+endif
+endif
+
+ifeq ($(DEFCONFIG),)
+
 all: menuconfig
 
+else # ifeq ($(DEFCONFIG),)
+
+# Re-run make if necessary
+all world: defconfig
+	$(MAKE) $(EXTRAMAKEARGS) $@
+
+endif # ifeq ($(DEFCONFIG),)
+
 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 # configuration
#11 lore raw

PATCH 10/13 Add update-all-config target

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The update-all-config target updates all the external configuration file with their current values. This includes:
- buildroot
- busybox
- linux
- crosstool-ng
- uClibc

---
Barebox is missing because there is no BR2_TARGET_BAREBOX_CONFIG option.

---
 Makefile                                         |    6 ++++++
 linux/linux.mk                                   |    2 ++
 package/busybox/busybox.mk                       |    4 ++++
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk |    7 +++++++
 toolchain/uClibc/uclibc.mk                       |    4 ++++
 5 files changed, 23 insertions(+)
Makefile +6 -0
index 1f42141..0e5b28e 100644
@@ -660,6 +660,10 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
 
+# UPDATE_ALL_CONFIG_TARGETS is set by the individual packages that have a
+# save*config target.
+update-all-config: savedefconfig $(UPDATE_ALL_CONFIG_TARGETS)
+
 # check if download URLs are outdated
 source-check:
 	$(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
@@ -714,6 +718,8 @@ help:
 	@echo '  defconfig              - New config with default answer to all options'
 	@echo '                             BR2_DEFCONFIG, if set, is used as input'
 	@echo '  savedefconfig          - Save current config as ./defconfig (minimal config)'
+	@echo '  update-all-config      - Update all configuration targets that have an input:'
+	@echo '                           buildroot, busybox, linux, crosstool-ng, uClibc'
 	@echo '  allyesconfig           - New config where all options are accepted with yes'
 	@echo '  allnoconfig            - New config where all options are answered with no'
 	@echo '  randpackageconfig      - New config with random answer to package options'
linux/linux.mk +2 -0
index c4bdf90..98ffe44 100644
@@ -151,6 +151,8 @@ ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
 else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
+# savedefconfig requires a kernel >= 2.6.33
+UPDATE_ALL_CONFIG_TARGETS += linux-update-defconfig
 endif
 
 define LINUX_CONFIGURE_CMDS
package/busybox/busybox.mk +4 -0
index 33f8633..5063a8b 100644
@@ -217,3 +217,7 @@ busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
 
 busybox-update-config:
 	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
+
+ifneq ($(BUSYBOX_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += busybox-update-config
+endif
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +7 -0
index d18f5d5..688bcfe 100644
@@ -397,3 +397,10 @@ ctng-menuconfig: $(CTNG_DIR)/.config
 	$(call ctng-oldconfig,$<)
 	$(call ctng-check-config-changed,$<,$<.timestamp)
 	$(Q)rm -f $<.timestamp
+
+ctng-update-config: $(CTNG_DIR)/.config
+	$(Q)cp $< $(CTNG_CONFIG_FILE)
+
+ifneq ($(CTNG_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += ctng-update-config
+endif
toolchain/uClibc/uclibc.mk +4 -0
index d1cd718..0faaf18 100644
@@ -508,6 +508,10 @@ uclibc-oldconfig: $(UCLIBC_DIR)/.oldconfig
 uclibc-update-config: uclibc-config
 	cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
+ifneq ($(UCLIBC_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += uclibc-update-config
+endif
+
 uclibc-configured: gcc_initial kernel-headers $(UCLIBC_DIR)/.configured
 
 uclibc-configured-source: uclibc-source
#12 lore raw

PATCH 10/13 Add update-all-config target

Hi,

Quoted 11 lines · Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The update-all-config target updates all the external configuration file with their current values. This includes:
- buildroot
- busybox
- linux
- crosstool-ng
- uClibc

I like this idea, and would propose to go through with this regardless of the outcome of the series.
See below for some comments though.

Quoted 64 lines

---
Barebox is missing because there is no BR2_TARGET_BAREBOX_CONFIG option.

---
 Makefile                                         |    6 ++++++
 linux/linux.mk                                   |    2 ++
 package/busybox/busybox.mk                       |    4 ++++
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk |    7 +++++++
 toolchain/uClibc/uclibc.mk                       |    4 ++++
 5 files changed, 23 insertions(+)
Makefile +6 -0
index 1f42141..0e5b28e 100644
@@ -660,6 +660,10 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
                --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
                $(CONFIG_CONFIG_IN)
 
+# UPDATE_ALL_CONFIG_TARGETS is set by the individual packages that have a
+# save*config target.
+update-all-config: savedefconfig $(UPDATE_ALL_CONFIG_TARGETS)
+
 # check if download URLs are outdated
 source-check:
        $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
@@ -714,6 +718,8 @@ help:
        @echo '  defconfig              - New config with default answer to all options'
        @echo '                             BR2_DEFCONFIG, if set, is used as input'
        @echo '  savedefconfig          - Save current config as ./defconfig (minimal config)'
+       @echo '  update-all-config      - Update all configuration targets that have an input:'
+       @echo '                           buildroot, busybox, linux, crosstool-ng, uClibc'
        @echo '  allyesconfig           - New config where all options are accepted with yes'
        @echo '  allnoconfig            - New config where all options are answered with no'
        @echo '  randpackageconfig      - New config with random answer to package options'
linux/linux.mk +2 -0
index c4bdf90..98ffe44 100644
@@ -151,6 +151,8 @@ ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
 else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
+# savedefconfig requires a kernel >= 2.6.33
+UPDATE_ALL_CONFIG_TARGETS += linux-update-defconfig
 endif
 
 define LINUX_CONFIGURE_CMDS
package/busybox/busybox.mk +4 -0
index 33f8633..5063a8b 100644
@@ -217,3 +217,7 @@ busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
 
 busybox-update-config:
        cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
+
+ifneq ($(BUSYBOX_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += busybox-update-config
+endif
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +0 -0
index d18f5d5..688bcfe 100644

toolchain/toolchain-crosstool-ng/crosstool-ng.mk ctng-menuconfig: $(CTNG_DIR)/.config · line 406

Quoted 10 lines
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +7 -0
@@ -397,3 +397,10 @@ ctng-menuconfig: $(CTNG_DIR)/.config
        $(call ctng-oldconfig,$<)
        $(call ctng-check-config-changed,$<,$<.timestamp)
        $(Q)rm -f $<.timestamp
+
+ctng-update-config: $(CTNG_DIR)/.config
+       $(Q)cp $< $(CTNG_CONFIG_FILE)
+
+ifneq ($(CTNG_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += ctng-update-config
+endif

I would personally have split the addition of an update-config feature for crosstool-ng from this patch that wraps the different update-config targets in one update-all-config.

I wonder why ctng-update-config uses a different type of recipe than their counterparts in busybox, uclibc, ...

For busybox it is:

Quoted 2 lines

busybox-update-config:

        cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)

while for ctng, as proposed above:

toolchain/toolchain-crosstool-ng/crosstool-ng.mk ctng-menuconfig: $(CTNG_DIR)/.config · line 402

Quoted 2 lines
toolchain/toolchain-crosstool-ng/crosstool-ng.mk +2 -0
+ctng-update-config: $(CTNG_DIR)/.config
+       $(Q)cp $< $(CTNG_CONFIG_FILE)

Differences:

- target dependency
- $(Q)
- forced copy

I would say that since all these packages are using the same kind of config system, the way to save their config files should also line up. It's possible that the new ctng-update-config is better in some ways, but in this case I think the other ones should be updated as well

Quoted 6 lines
toolchain/uClibc/uclibc.mk +0 -0
index d1cd718..0faaf18 100644

toolchain/uClibc/uclibc.mk uclibc-oldconfig: $(UCLIBC_DIR)/.oldconfig · line 517

Quoted 10 lines
toolchain/uClibc/uclibc.mk +4 -0
@@ -508,6 +508,10 @@ uclibc-oldconfig: $(UCLIBC_DIR)/.oldconfig
 uclibc-update-config: uclibc-config
        cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
+ifneq ($(UCLIBC_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += uclibc-update-config
+endif
+
 uclibc-configured: gcc_initial kernel-headers $(UCLIBC_DIR)/.configured
 
 uclibc-configured-source: uclibc-source

Best regards,
Thomas

#13 lore raw

PATCH 10/13 Add update-all-config target

Quoted 10 lines · Thomas De Schampheleire
Quoted 7 lines

+

Quoted 6 lines

+ctng-update-config: $(CTNG_DIR)/.config
+ $(Q)cp $< $(CTNG_CONFIG_FILE)
+
+ifneq ($(CTNG_CONFIG_FILE),)
+UPDATE_ALL_CONFIG_TARGETS += ctng-update-config
+endif

I would personally have split the addition of an update-config feature for crosstool-ng from this patch that wraps the different update-config targets in one update-all-config.

Good point.

Quoted 4 lines

I wonder why ctng-update-config uses a different type of recipe than their counterparts in busybox, uclibc, ...

For busybox it is:

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
   busybox-update-config:
          cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)

while for ctng, as proposed above:

Quoted 2 lines
Quoted 2 lines

+ctng-update-config: $(CTNG_DIR)/.config
+ $(Q)cp $< $(CTNG_CONFIG_FILE)

Differences:

- target dependency

linux and uclibc have it, only busybox is missing it.

Quoted 1 line

- $(Q)

My bad.

Quoted 1 line

- forced copy

Ah, except that cp -f doesn't mean forced copy; it means: remove an
already existing file before the copy. That means that permissions are lost and if it's a symlink, it's not the file it points to that gets updated. So I think cp -f is _not_ what we want here...

Quoted 4 lines

I would say that since all these packages are using the same kind of config system, the way to save their config files should also line up. It's possible that the new ctng-update-config is better in some ways, but in this case I think the other ones should be updated as well

True, so I'll fix the use of -f in a separate patch. And add the
dependency for busybox as well.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#14 lore raw

PATCH 10/13 Add update-all-config target

Quoted 6 lines · Arnout Vandecappelle
Quoted 1 line

- forced copy

Ah, except that cp -f doesn't mean forced copy; it means: remove an
already existing file before the copy. That means that permissions are lost and if it's a symlink, it's not the file it points to that gets updated. So I think cp -f is _not_ what we want here...

Wrong again, Arnout :-( The -f only removes the symlink it the file
couldn't be written to in the first place, so it's OK to have it.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#15 lore raw

PATCH 10/13 Add update-all-config target

In reply to Thomas De Schampheleire

Am 14.10.2012 20:45, schrieb Thomas De Schampheleire:

Quoted 14 lines

Hi,

Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)
Quoted 10 lines

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The update-all-config target updates all the external configuration file with their current values. This includes:
- buildroot
- busybox
- linux
- crosstool-ng
- uClibc

Quoted 4 lines
Quoted 1 line
Quoted 1 line

I like this idea, and would propose to go through with this regardless of the outcome of the series.
See below for some comments though

Hi,

I also like this idea much.

I'd like to go one step further and put buildroot's default config files in the board/company/product hierarchy, too. Then everything would be in one place.

This approach would be similar to that used by uClinux where all relevant board specific files are in vendors/company/product.

Kind regards

Stephan

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#16 lore raw

PATCH 10/13 Add update-all-config target

Dear Stephan Hoffmann,

Quoted 3 lines · Stephan Hoffmann

I'd like to go one step further and put buildroot's default config files in the board/company/product hierarchy, too. Then everything would be in one place.

This is what we had a long time ago, but it was changed for the current approach.

See the discussion at
http://lists.busybox.net/pipermail/buildroot/2009-October/029556.html
(note: the discussion starts on October 2009, but continues on November 2009, and the mailing list archive doesn't show it as one single thread).

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#17 lore raw

PATCH 11/13 Add target to create a project directory

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 Makefile                              |   30 +++++++++++
 Makefile.project.tmpl                 |   40 +++++++++++++++
 package/busybox/busybox-1.20.x.config |   26 +++++----
 toolchain/uClibc/uClibc-0.9.33.config |   91 ++++++++++++++-------------------
 4 files changed, 121 insertions(+), 66 deletions(-)
 create mode 100644 Makefile.project.tmpl
Makefile +30 -0
index 0e5b28e..a3b88f7 100644
@@ -698,6 +698,33 @@ endif
 
 cross: $(BASE_TARGETS)
 
+ifneq ($(PROJECT_DIR),)
+ifeq ($(findstring -git,$(BR2_VERSION)),)
+BUILDROOT_VERSION = $(BR2_VERSION)
+else
+BUILDROOT_VERSION = snapshot
+endif
+
+# Write a buildroot config in the project dir, then use that defconfig to
+# re-generate the .config.  This replaces the config file paths with paths
+# pointing into PROJECT_DIR (unless they have been changed from their
+# default values).  The subsequent update-all-config writes all the config
+# files into the PROJECT_DIR.  That last step doesn't need to set PROJECT_DIR
+# or DEFCONFIG anymore, because they're already set in the new .config.
+projectdir:
+	mkdir -p $(PROJECT_DIR)
+	sed s/@BUILDROOT_VERSION@/$(BUILDROOT_VERSION)/g \
+		Makefile.project.tmpl > $(PROJECT_DIR)/Makefile
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		savedefconfig
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		PROJECT_DIR=$(PROJECT_DIR) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		defconfig
+	$(MAKE1) $(EXTRAMAKEARGS) update-all-config
+endif
+
 help:
 	@echo 'Cleaning:'
 	@echo '  clean                  - delete all files created by build'
@@ -756,6 +783,9 @@ endif
 	@echo '  source-check           - check selected packages for valid download URLs'
 	@echo '  external-deps          - list external packages used'
 	@echo '  legal-info             - generate info about license compliance'
+ifneq ($(PROJECT_DIR),)
+	@echo '  projectdir             - Prepare project directory with a Makefile.'
+endif
 	@echo
 	@echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
 	@echo '  make O=dir             - Locate all output files in "dir", including .config'
Makefile.project.tmpl new file +40 -0
new file mode 100644
index 0000000..b41180a
@@ -0,0 +1,40 @@
+# This Makefile creates a build environment using the directory containing
+# this Makefile as the project directory.
+# If called from a different directory using 'make -f ...', the current
+# directory is used as the output directory.
+
+lastword = $(word $(words $(1)),$(1))
+makedir  = $(dir $(call lastword,$(MAKEFILE_LIST)))
+
+BR2_PROJECT_DIR = $(realpath $(makedir))
+BUILDROOT_DIR   = $(BR2_PROJECT_DIR)/buildroot
+BUILDROOT_VERSION = @BUILDROOT_VERSION@
+BUILDROOT_SITE    = http://buildroot.net/downloads
+BUILDROOT_SOURCE  = buildroot-$(BUILDROOT_VERSION).tar.bz2
+
+ifeq ($(O),)
+ifeq ($(makedir),./)
+# Building in project dir => create output dir
+O = $(CURDIR)/output
+else
+# Building from some other dir => use this dir as output dir
+O = $(CURDIR)
+endif
+endif
+
+.PHONY: all $(MAKECMDGOALS)
+
+all: $(BUILDROOT_DIR)
+	@$(MAKE) -C buildroot O=$(O) BR2_PROJECT_DIR=$(BR2_PROJECT_DIR) $(all)
+
+all     := $(filter-out all,$(MAKECMDGOALS))
+$(all): all
+        @:
+
+$(BUILDROOT_DIR):
+	mkdir -p $@
+	wget -O - $(BUILDROOT_SITE)/$(BUILDROOT_SOURCE) | \
+		tar -xjf - -C $@ --strip-components=1
+	for p in `ls $(makedir)/patches/buildroot/buildroot-* 2>/dev/null`; do \
+		patch -d $@ -p1 -i $$p; \
+	done
package/busybox/busybox-1.20.x.config +13 -13
index 5525434..84ae428 100644
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Busybox version: 1.20.0
-# Sun Apr 22 10:09:56 2012
+# Busybox version: 1.20.2
+# Wed Sep 26 02:12:42 2012
 #
 CONFIG_HAVE_DOT_CONFIG=y
 
@@ -49,7 +49,7 @@ CONFIG_FEATURE_SUID=y
 # CONFIG_FEATURE_PREFER_APPLETS is not set
 CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
 CONFIG_FEATURE_SYSLOG=y
-# CONFIG_FEATURE_HAVE_RPC is not set
+CONFIG_FEATURE_HAVE_RPC=y
 
 #
 # Build Options
@@ -60,7 +60,7 @@ CONFIG_FEATURE_SYSLOG=y
 # CONFIG_BUILD_LIBBUSYBOX is not set
 # CONFIG_FEATURE_INDIVIDUAL is not set
 # CONFIG_FEATURE_SHARED_BUSYBOX is not set
-# CONFIG_LFS is not set
+CONFIG_LFS=y
 CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
 CONFIG_EXTRA_CFLAGS=""
@@ -583,7 +583,7 @@ CONFIG_MOUNT=y
 # CONFIG_FEATURE_MOUNT_VERBOSE is not set
 # CONFIG_FEATURE_MOUNT_HELPERS is not set
 # CONFIG_FEATURE_MOUNT_LABEL is not set
-# CONFIG_FEATURE_MOUNT_NFS is not set
+CONFIG_FEATURE_MOUNT_NFS=y
 CONFIG_FEATURE_MOUNT_CIFS=y
 CONFIG_FEATURE_MOUNT_FLAGS=y
 CONFIG_FEATURE_MOUNT_FSTAB=y
@@ -737,7 +737,7 @@ CONFIG_PING=y
 # CONFIG_PING6 is not set
 CONFIG_FEATURE_FANCY_PING=y
 # CONFIG_WHOIS is not set
-# CONFIG_FEATURE_IPV6 is not set
+CONFIG_FEATURE_IPV6=y
 # CONFIG_FEATURE_UNIX_LOCAL is not set
 # CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
 # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
@@ -783,15 +783,15 @@ CONFIG_FEATURE_IFUPDOWN_IP=y
 # CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
 # CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
 CONFIG_FEATURE_IFUPDOWN_IPV4=y
-# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
 CONFIG_FEATURE_IFUPDOWN_MAPPING=y
 # CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
-CONFIG_INETD=y
-CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y
-CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y
-CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y
-CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y
-CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
 # CONFIG_FEATURE_INETD_RPC is not set
 CONFIG_IP=y
 CONFIG_FEATURE_IP_ADDRESS=y
toolchain/uClibc/uClibc-0.9.33.config +38 -53

180 lines not on this page · raw message

#18 lore raw

PATCH v2 1/1 Add target to create a project directory

---
v2: Removed accidental changes to busybox.config and uClibc.config

---
 Makefile              |   30 ++++++++++++++++++++++++++++++
 Makefile.project.tmpl |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 Makefile.project.tmpl
Makefile +30 -0
index 0e5b28e..a3b88f7 100644
@@ -698,6 +698,33 @@ endif
 
 cross: $(BASE_TARGETS)
 
+ifneq ($(PROJECT_DIR),)
+ifeq ($(findstring -git,$(BR2_VERSION)),)
+BUILDROOT_VERSION = $(BR2_VERSION)
+else
+BUILDROOT_VERSION = snapshot
+endif
+
+# Write a buildroot config in the project dir, then use that defconfig to
+# re-generate the .config.  This replaces the config file paths with paths
+# pointing into PROJECT_DIR (unless they have been changed from their
+# default values).  The subsequent update-all-config writes all the config
+# files into the PROJECT_DIR.  That last step doesn't need to set PROJECT_DIR
+# or DEFCONFIG anymore, because they're already set in the new .config.
+projectdir:
+	mkdir -p $(PROJECT_DIR)
+	sed s/@BUILDROOT_VERSION@/$(BUILDROOT_VERSION)/g \
+		Makefile.project.tmpl > $(PROJECT_DIR)/Makefile
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		savedefconfig
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		PROJECT_DIR=$(PROJECT_DIR) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		defconfig
+	$(MAKE1) $(EXTRAMAKEARGS) update-all-config
+endif
+
 help:
 	@echo 'Cleaning:'
 	@echo '  clean                  - delete all files created by build'
@@ -756,6 +783,9 @@ endif
 	@echo '  source-check           - check selected packages for valid download URLs'
 	@echo '  external-deps          - list external packages used'
 	@echo '  legal-info             - generate info about license compliance'
+ifneq ($(PROJECT_DIR),)
+	@echo '  projectdir             - Prepare project directory with a Makefile.'
+endif
 	@echo
 	@echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
 	@echo '  make O=dir             - Locate all output files in "dir", including .config'
Makefile.project.tmpl new file +40 -0
new file mode 100644
index 0000000..b41180a
@@ -0,0 +1,40 @@
+# This Makefile creates a build environment using the directory containing
+# this Makefile as the project directory.
+# If called from a different directory using 'make -f ...', the current
+# directory is used as the output directory.
+
+lastword = $(word $(words $(1)),$(1))
+makedir  = $(dir $(call lastword,$(MAKEFILE_LIST)))
+
+BR2_PROJECT_DIR = $(realpath $(makedir))
+BUILDROOT_DIR   = $(BR2_PROJECT_DIR)/buildroot
+BUILDROOT_VERSION = @BUILDROOT_VERSION@
+BUILDROOT_SITE    = http://buildroot.net/downloads
+BUILDROOT_SOURCE  = buildroot-$(BUILDROOT_VERSION).tar.bz2
+
+ifeq ($(O),)
+ifeq ($(makedir),./)
+# Building in project dir => create output dir
+O = $(CURDIR)/output
+else
+# Building from some other dir => use this dir as output dir
+O = $(CURDIR)
+endif
+endif
+
+.PHONY: all $(MAKECMDGOALS)
+
+all: $(BUILDROOT_DIR)
+	@$(MAKE) -C buildroot O=$(O) BR2_PROJECT_DIR=$(BR2_PROJECT_DIR) $(all)
+
+all     := $(filter-out all,$(MAKECMDGOALS))
+$(all): all
+        @:
+
+$(BUILDROOT_DIR):
+	mkdir -p $@
+	wget -O - $(BUILDROOT_SITE)/$(BUILDROOT_SOURCE) | \
+		tar -xjf - -C $@ --strip-components=1
+	for p in `ls $(makedir)/patches/buildroot/buildroot-* 2>/dev/null`; do \
+		patch -d $@ -p1 -i $$p; \
+	done
#19 lore raw

PATCH v2 1/1 Add target to create a project directory

Quoted 93 lines · Arnout Vandecappelle (Essensium/Mind)

---
v2: Removed accidental changes to busybox.config and uClibc.config

---
  Makefile              |   30 ++++++++++++++++++++++++++++++
  Makefile.project.tmpl |   40 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 70 insertions(+)

create mode 100644 Makefile.project.tmpl

Makefile +30 -0
index 0e5b28e..a3b88f7 100644
@@ -698,6 +698,33 @@ endif
 
  cross: $(BASE_TARGETS)
 
+ifneq ($(PROJECT_DIR),)
+ifeq ($(findstring -git,$(BR2_VERSION)),)
+BUILDROOT_VERSION = $(BR2_VERSION)
+else
+BUILDROOT_VERSION = snapshot
+endif
+
+# Write a buildroot config in the project dir, then use that defconfig to
+# re-generate the .config.  This replaces the config file paths with paths
+# pointing into PROJECT_DIR (unless they have been changed from their
+# default values).  The subsequent update-all-config writes all the config
+# files into the PROJECT_DIR.  That last step doesn't need to set PROJECT_DIR
+# or DEFCONFIG anymore, because they're already set in the new .config.
+projectdir:
+	mkdir -p $(PROJECT_DIR)
+	sed s/@BUILDROOT_VERSION@/$(BUILDROOT_VERSION)/g \
+		Makefile.project.tmpl > $(PROJECT_DIR)/Makefile
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		savedefconfig
+	$(MAKE1) $(EXTRAMAKEARGS) \
+		PROJECT_DIR=$(PROJECT_DIR) \
+		DEFCONFIG=$(PROJECT_DIR)/buildroot.config \
+		defconfig
+	$(MAKE1) $(EXTRAMAKEARGS) update-all-config
+endif
+
  help:
  	@echo 'Cleaning:'
  	@echo '  clean                  - delete all files created by build'
@@ -756,6 +783,9 @@ endif
  	@echo '  source-check           - check selected packages for valid download URLs'
  	@echo '  external-deps          - list external packages used'
  	@echo '  legal-info             - generate info about license compliance'
+ifneq ($(PROJECT_DIR),)
+	@echo '  projectdir             - Prepare project directory with a Makefile.'
+endif
  	@echo
  	@echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
  	@echo '  make O=dir             - Locate all output files in "dir", including .config'
Makefile.project.tmpl new file +30 -0
new file mode 100644
index 0000000..b41180a
@@ -0,0 +1,40 @@
+# This Makefile creates a build environment using the directory containing
+# this Makefile as the project directory.
+# If called from a different directory using 'make -f ...', the current
+# directory is used as the output directory.
+
+lastword = $(word $(words $(1)),$(1))
+makedir  = $(dir $(call lastword,$(MAKEFILE_LIST)))
+
+BR2_PROJECT_DIR = $(realpath $(makedir))
+BUILDROOT_DIR   = $(BR2_PROJECT_DIR)/buildroot
+BUILDROOT_VERSION = @BUILDROOT_VERSION@
+BUILDROOT_SITE    = http://buildroot.net/downloads
+BUILDROOT_SOURCE  = buildroot-$(BUILDROOT_VERSION).tar.bz2
+
+ifeq ($(O),)
+ifeq ($(makedir),./)
+# Building in project dir => create output dir
+O = $(CURDIR)/output
+else
+# Building from some other dir => use this dir as output dir
+O = $(CURDIR)
+endif
+endif
+
+.PHONY: all $(MAKECMDGOALS)
+
+all: $(BUILDROOT_DIR)
+	@$(MAKE) -C buildroot O=$(O) BR2_PROJECT_DIR=$(BR2_PROJECT_DIR) $(all)
+
+all     := $(filter-out all,$(MAKECMDGOALS))

Makefile.project.tmpl line 40

Quoted 10 lines
Makefile.project.tmpl new file +10 -0
+$(all): all
+        @:
+
+$(BUILDROOT_DIR):
+	mkdir -p $@
+	wget -O - $(BUILDROOT_SITE)/$(BUILDROOT_SOURCE) | \
+		tar -xjf - -C $@ --strip-components=1
+	for p in `ls $(makedir)/patches/buildroot/buildroot-* 2>/dev/null`; do \
+		patch -d $@ -p1 -i $$p; \
+	done

I probably miss something, but
do I have to download buldroot for every project?
Can I use my local BR git tree as a buildroot source for my projects instead of downloading?

Thanks,
Val.

Quoted 6 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#20 lore raw

PATCH v2 1/1 Add target to create a project directory

Quoted 11 lines · Valentine Barshak

Makefile.project.tmpl line 40

Quoted 7 lines

+$(BUILDROOT_DIR):

Makefile.project.tmpl new file +6 -0
+    mkdir -p $@
+    wget -O - $(BUILDROOT_SITE)/$(BUILDROOT_SOURCE) | \
+        tar -xjf - -C $@ --strip-components=1
+    for p in `ls $(makedir)/patches/buildroot/buildroot-* 2>/dev/null`; do \
+        patch -d $@ -p1 -i $$p; \
+    done

I probably miss something, but
do I have to download buldroot for every project?
Can I use my local BR git tree as a buildroot source for my projects instead of downloading?

No, make a symlink to the BR tree and it won't download anything.

But this automatic download feature is probably going a bridge too far :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#21 lore raw

PATCH v2 1/1 Add target to create a project directory

Quoted 15 lines · Arnout Vandecappelle
Quoted 9 lines · Valentine Barshak

Makefile.project.tmpl line 40

Quoted 8 lines

+$(BUILDROOT_DIR):

Makefile.project.tmpl new file +4 -0
+    mkdir -p $@
+    wget -O - $(BUILDROOT_SITE)/$(BUILDROOT_SOURCE) | \
+        tar -xjf - -C $@ --strip-components=1
+    for p in `ls $(makedir)/patches/buildroot/buildroot-*

2>/dev/null`; do \

Makefile.project.tmpl new file +2 -0
+        patch -d $@ -p1 -i $$p; \
+    done
Quoted 4 lines

I probably miss something, but
do I have to download buldroot for every project?
Can I use my local BR git tree as a buildroot source for my projects instead of downloading?

Quoted 4 lines

No, make a symlink to the BR tree and it won't download anything.

But this automatic download feature is probably going a bridge too far
:-)

Thanks,
probably symlinking should be done by default instead of downloading? I'd assume that when someone does make projectdir from the BR directory, they'd expect this particular BR do be used as the source for the new project.

In case of downloading, it's possible to download/copy current BR to another location manually (without projectdir) and build there.

Are there any obvious differences compared to using projectdir in this case?

What benefits does it give?

Thanks,
Val.

Quoted 4 lines

Regards,
Arnout

#22 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The filesystem overlay is a tree that is copied over the target fs after building everything - which is currently usually done in the post-build script.

Also replace the documentation for a custom skeleton with the filesystem overlay and deprecate the custom skeleton.

---
 Makefile                         |    9 +++++++++
 docs/manual/customize-rootfs.txt |   21 +++++++++------------
 target/generic/Config.in         |   13 +++++++++++++
 3 files changed, 31 insertions(+), 12 deletions(-)
Makefile +9 -0
index a3b88f7..31770ce 100644
@@ -466,6 +466,15 @@ endif
 		echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
 	) >  $(TARGET_DIR)/etc/os-release
 
+	@for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
+		if [ -d $${dir} ]; then \
+			$(call MESSAGE,"Copying overlay $${dir}"); \
+			rsync -a \
+				--exclude .svn --exclude .git --exclude .hg --exclude '*~' \
+				$${dir}/ $(TARGET_DIR); \
+		fi \
+	done
+
 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
 	@$(call MESSAGE,"Executing post-build script")
 	$(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
docs/manual/customize-rootfs.txt +9 -12
index 8c3ea82..b3c160b 100644
@@ -1,5 +1,6 @@
 Customizing the generated target filesystem
 -------------------------------------------
+[customize-rootfs]
 
 There are a few ways to customize the resulting target filesystem:
 
@@ -10,24 +11,20 @@ There are a few ways to customize the resulting target filesystem:
   anything to the target filesystem, but if you decide to completely
   rebuild your toolchain and tools, these changes will be lost.
 
-* Create your own 'target skeleton'. You can start with the default
-  skeleton available under +fs/skeleton+ and then customize it to suit
-  your needs. The +BR2_ROOTFS_SKELETON_CUSTOM+ and
-  +BR2_ROOTFS_SKELETON_CUSTOM_PATH+ will allow you to specify the
-  location of your custom skeleton. At build time, the contents of the
-  skeleton are copied to output/target before any package
-  installation.
+* Create a filesystem overlay: a tree of files that are copied directly
+  over the target filesystem after it has been built.  Set
+  +BR2_ROOTFS_OVERLAY+ to the top of the tree.  +.git+, +.svn+,
+  +.hg+ directories and files ending with +~+ are excluded.
 
 * In the Buildroot configuration, you can specify the path to a
   post-build script, that gets called 'after' Buildroot builds all the
   selected software, but 'before' the rootfs packages are
   assembled. The destination root filesystem folder is given as the
   first argument to this script, and this script can then be used to
-  copy programs, static data or any other needed file to your target
-  filesystem. You should, however, use this feature with care.
-  Whenever you find that a certain package generates wrong or unneeded
-  files, you should fix that package rather than work around it with a
-  post-build cleanup script.
+  remove or modify any file in your target filesystem. You should,
+  however, use this feature with care. Whenever you find that a certain
+  package generates wrong or unneeded files, you should fix that
+  package rather than work around it with a post-build cleanup script.
 
 * A special package, 'customize', stored in +package/customize+ can be
   used. You can put all the files that you want to see in the final
target/generic/Config.in +13 -0
index 76137b7..35cadfb 100644
@@ -105,6 +105,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT
 
 config BR2_ROOTFS_SKELETON_CUSTOM
 	bool "custom target skeleton"
+	depends on BR2_DEPRECATED
 	help
 	  Use custom target skeleton.
 
@@ -168,6 +169,18 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
 
 endif # BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_OVERLAY
+	string "Root filesystem overlay"
+	default "$(PROJECT_DIR)/rootfs-overlay" if BR2_PROJECT_DIR != ""
+	default ""
+	help
+	  Specify a list of directories that are copied over the target
+	  root filesystem after the build has finished and before it is
+	  packed into the selected filesystem images.
+
+	  It is copied as-is into the rootfs, excluding files ending with
+	  ~ and .git, .svn and .hg directories.
+
 config BR2_ROOTFS_POST_BUILD_SCRIPT
 	string "Custom script to run before creating filesystem images"
 	default "$(PROJECT_DIR)/post-build.sh" if BR2_PROJECT_DIR != ""
#23 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

Arnout,

Quoted 4 lines · Arnout Vandecappelle (Essensium/Mind)

The filesystem overlay is a tree that is copied over the target fs after building everything - which is currently usually done in the post-build script.

I'm very happy to see the overlay fs concept get introduced. We introduced an almost identical concept to our customized buildroot a couple of years ago, and found it to be a great addition. In particular, it lets us keep a full skeleton with most of our files, and a couple very small overlays for things that we want just in an NFS-mount dev scenario and just in a FLASH image scenario.

However, we still make use of the custom target skeleton feature.
Basically, we wanted to keep our initial skeleton in our project directory
with our overlays, rather than hack up the default skeleton that comes with buildroot. Also, we wanted to avoid having to maintain a list of files installed by the default skeleton that then need to be deleted in a post-build script.

(The truth is that we use our custom skeleton both as the initial custom skeleton that gets copied during the beginning of the process, and as an overlay that gets copied at the end of the process, so that no package-installed scripts take precedence over our customized target skeleton files.)

So I still see use, at least for us, for a custom skeleton. No?

Danomi -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121013/7f9f53c7/attachment.html>

#24 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

Quoted 10 lines · Danomi Manchego

However, we still make use of the custom target skeleton feature. Basically, we wanted to keep our initial skeleton in our project directory with our overlays, rather than hack up the default skeleton that comes with buildroot. Also, we wanted to avoid having to maintain a list of files installed by the default skeleton that then need to be deleted in a post-build script.

(The truth is that we use our custom skeleton both as the initial custom skeleton that gets copied during the beginning of the process, and as an overlay that gets copied at the end of the process, so that no package-installed scripts take precedence over our customized target skeleton files.)

So I still see use, at least for us, for a custom skeleton. No?

If you need to remove files from the default skeleton, then there's something
wrong with the default skeleton. Now I take a second look, indeed there's a lot in there that is unneeded, e.g. .bash_profile if no bash is installed...

So I'll un-deprecate the custom skeleton in the next round.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#25 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

Quoted 16 lines · Arnout Vandecappelle
Quoted 14 lines · Danomi Manchego

However, we still make use of the custom target skeleton feature.
Basically, we wanted to keep our initial skeleton in
our project directory with our overlays, rather than hack up the default skeleton that comes with buildroot. Also, we
wanted to avoid having to maintain a list of files installed by the default skeleton that then need to be deleted in a post-build script.

(The truth is that we use our custom skeleton both as the initial custom skeleton that gets copied during the beginning
of the process, and as an overlay that gets copied at the end of the process, so that no package-installed scripts
take precedence over our customized target skeleton files.)

Quoted 9 lines
Quoted 2 lines

So I still see use, at least for us, for a custom skeleton. No?

If you need to remove files from the default skeleton, then there's
something
wrong with the default skeleton. Now I take a second look, indeed there's a lot
in there that is unneeded, e.g. .bash_profile if no bash is installed...

Maybe saying that the files "need to be deleted" was too strong. I didn't really distinguish between "need to be deleted" versus "files that are unneeded and potentially confusing to others by their presence". Anyway, thanks for agreeing to un-deprecate.

Danomi -

Quoted 6 lines

So I'll un-deprecate the custom skeleton in the next round.

Regards,
Arnout

Quoted 9 lines

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR
Leuven
LinkedIn profile: http://www.linkedin.com/in/**arnoutvandecappelle<http://www.linkedin.com/in/arnoutvandecappelle>
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121014/141257eb/attachment.html>

#26 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

The filesystem overlay is a tree that is copied over the target fs after building everything - which is currently usually done in the post-build script.

Also replace the documentation for a custom skeleton with the filesystem overlay and deprecate the custom skeleton.

Note that I'm not against this feature, but we discussed this before (I think on Buildroot Developer Day in Brussels beginning of 2012, or otherwise on the list) and the outcome back then was that it was not necessary as it was very easy to add directly to the post-build script.

Quoted 106 lines
---
 Makefile                         |    9 +++++++++
 docs/manual/customize-rootfs.txt |   21 +++++++++------------
 target/generic/Config.in         |   13 +++++++++++++
 3 files changed, 31 insertions(+), 12 deletions(-)
Makefile +9 -0
index a3b88f7..31770ce 100644
@@ -466,6 +466,15 @@ endif
                echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
        ) >  $(TARGET_DIR)/etc/os-release
 
+       @for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
+               if [ -d $${dir} ]; then \
+                       $(call MESSAGE,"Copying overlay $${dir}"); \
+                       rsync -a \
+                               --exclude .svn --exclude .git --exclude .hg --exclude '*~' \
+                               $${dir}/ $(TARGET_DIR); \
+               fi \
+       done
+
 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
        @$(call MESSAGE,"Executing post-build script")
        $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
docs/manual/customize-rootfs.txt +9 -12
index 8c3ea82..b3c160b 100644
@@ -1,5 +1,6 @@
 Customizing the generated target filesystem
 -------------------------------------------
+[customize-rootfs]
 
 There are a few ways to customize the resulting target filesystem:
 
@@ -10,24 +11,20 @@ There are a few ways to customize the resulting target filesystem:
   anything to the target filesystem, but if you decide to completely
   rebuild your toolchain and tools, these changes will be lost.
 
-* Create your own 'target skeleton'. You can start with the default
-  skeleton available under +fs/skeleton+ and then customize it to suit
-  your needs. The +BR2_ROOTFS_SKELETON_CUSTOM+ and
-  +BR2_ROOTFS_SKELETON_CUSTOM_PATH+ will allow you to specify the
-  location of your custom skeleton. At build time, the contents of the
-  skeleton are copied to output/target before any package
-  installation.
+* Create a filesystem overlay: a tree of files that are copied directly
+  over the target filesystem after it has been built.  Set
+  +BR2_ROOTFS_OVERLAY+ to the top of the tree.  +.git+, +.svn+,
+  +.hg+ directories and files ending with +~+ are excluded.
 
 * In the Buildroot configuration, you can specify the path to a
   post-build script, that gets called 'after' Buildroot builds all the
   selected software, but 'before' the rootfs packages are
   assembled. The destination root filesystem folder is given as the
   first argument to this script, and this script can then be used to
-  copy programs, static data or any other needed file to your target
-  filesystem. You should, however, use this feature with care.
-  Whenever you find that a certain package generates wrong or unneeded
-  files, you should fix that package rather than work around it with a
-  post-build cleanup script.
+  remove or modify any file in your target filesystem. You should,
+  however, use this feature with care. Whenever you find that a certain
+  package generates wrong or unneeded files, you should fix that
+  package rather than work around it with a post-build cleanup script.
 
 * A special package, 'customize', stored in +package/customize+ can be
   used. You can put all the files that you want to see in the final
target/generic/Config.in +13 -0
index 76137b7..35cadfb 100644
@@ -105,6 +105,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT
 
 config BR2_ROOTFS_SKELETON_CUSTOM
        bool "custom target skeleton"
+       depends on BR2_DEPRECATED
        help
          Use custom target skeleton.
 
@@ -168,6 +169,18 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
 
 endif # BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_OVERLAY
+       string "Root filesystem overlay"
+       default "$(PROJECT_DIR)/rootfs-overlay" if BR2_PROJECT_DIR != ""
+       default ""
+       help
+         Specify a list of directories that are copied over the target
+         root filesystem after the build has finished and before it is
+         packed into the selected filesystem images.
+
+         It is copied as-is into the rootfs, excluding files ending with
+         ~ and .git, .svn and .hg directories.
+
 config BR2_ROOTFS_POST_BUILD_SCRIPT
        string "Custom script to run before creating filesystem images"
        default "$(PROJECT_DIR)/post-build.sh" if BR2_PROJECT_DIR != ""

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#27 lore raw

PATCH 12/13 target/generic: add filesystem overlay option

Quoted 11 lines · Thomas De Schampheleire
Quoted 9 lines · Arnout Vandecappelle (Essensium/Mind)
Quoted 9 lines

From: Arnout Vandecappelle (Essensium/Mind)<[email protected]>

The filesystem overlay is a tree that is copied over the target fs after building everything - which is currently usually done in the post-build script.

Also replace the documentation for a custom skeleton with the filesystem overlay and deprecate the custom skeleton.

Quoted 6 lines
Quoted 1 line
Quoted 1 line

Note that I'm not against this feature, but we discussed this before (I think on Buildroot Developer Day in Brussels beginning of 2012, or otherwise on the list) and the outcome back then was that it was not necessary as it was very easy to add directly to the post-build script.

I understood it as: it's a low-priority nice-to-have because there are
other ways to do it. So I will resend this patch.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#28 lore raw

PATCH 13/13 Document BR2_PROJECT_DIR in the manual

In reply to Arnout Vandecappelle (Essensium/Mind)

From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>

---
 docs/manual/customize-project.txt |   37 +++++++++++++++++++++++++++++++++++++
 docs/manual/customize.txt         |    2 ++
 2 files changed, 39 insertions(+)
 create mode 100644 docs/manual/customize-project.txt
docs/manual/customize-project.txt new file +37 -0
new file mode 100644
index 0000000..db6b757
@@ -0,0 +1,37 @@
+Storing the configuration in a project directory
+------------------------------------------------
+[[project-dir]]
+
+When you use buildroot in different projects, it's a good idea to keep
+each project separate from buildroot itself.  Buildroot makes this
+possible with the +BR2_PROJECT_DIR+ option.  The project directory
+contains all the configuration files and the filesystem overlay for
+your project.
+
+After configuring buildroot, the linux kernel, etc., run the following
+command.
+
+--------------------
+make PROJECT_DIR=/path/to/project/dir projectdir
+--------------------
+
+This will create the directory +/path/to/project/dir+, which contains
+the buildroot configuration, and all other configuration files required
+to rebuild your system.
+
+To further customize your project, you can:
+
+* add a directory called +rootfs-overlay+ and fill it with additional
+  files and directories that should be installed in the root filesystem
+  (see xref:customize-rootfs[+BR2_ROOTFS_OVERLAY+]);
+
+* add a script called +post-build.sh+ to modify the root filesystem
+  (see xref:customize-rootfs[+BR2_ROOTFS_POST_BUILD_SCRIPT+]);
+
+* add a makefile +project.mk+ with additional buildroot targets.
+
+In addition, the project directory contains a Makefile to allow you to
+build directly from there.  This Makefile downloads and extracts
+buildroot, then builds everything according to your configuration. To
+avoid downloading buildroot, create a symbolic link to the buildroot
+directory in the project directory.
docs/manual/customize.txt +2 -0
index e8235de..86fc1fb 100644
@@ -10,3 +10,5 @@ include::customize-uclibc-config.txt[]
 include::customize-kernel-config.txt[]
 
 include::customize-toolchain.txt[]
+
+include::customize-project.txt[]
#29 lore raw

cover Add support for a project directory

In reply to Arnout Vandecappelle (Essensium/Mind)

Arnout,

Quoted 22 lines · Arnout Vandecappelle \(Essensium/Mind\)

Many buildroot users prefer to keep their project's customizations
separate from buildroot itself. This makes it easier to go to a new buildroot version, and to identify which parts are project- specific. Although it was already possible to keep the project's customization separate, this patch set simplifies it.

It introduces a new config option, BR2_PROJECT_DIR (patch 1).
This symbol is used to set defaults for many other config options (patches 2-7). The buildroot config itself can also be stored in the project directory by setting a default BR2_DEFCONFIG (patch 8).

Patch 9 does a 'make defconfig' and 'make world' in a single run
when a project directory is available.

Patch 10 makes it possible to update all config files (buildroot,
linux, busybox, ...) in a single shot.

Patch 11 adds a 'make projectdir' target to initialize a project
directory. It also creates a Makefile in the project directory:
it downloads buildroot itself, so the project directory is self-sufficient.

Quoted 4 lines

Patch 12 adds the thing that everybody has to put in their
post-build script as a configuration option: a rootfs overlay. This patch could also be applied independent of the series (except for the one line that sets a default based on PROJECT_DIR).

I agree about this one.

Quoted 1 line

Patch 13, finally, adds the PROJECT_DIR concept to the manual.

I'll have a close look at all this later, but for reference, this is almost exactly a feature that Buildroot had years ago, and that we painfully progressively removed because it was not used properly by anyone, and was crippling the code base and usage of Buildroot with a lot of useless complexity.

So I'll have a look, but my initial impression is one of fairly high skepticism, to say the least.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#30 lore raw

cover Add support for a project directory

Quoted 2 lines · Thomas Petazzoni

So I'll have a look, but my initial impression is one of fairly high skepticism, to say the least.

Ok, I had a look, and I'm going to NAK this.

All what this stuff is adding can already be done with the current Buildroot, by putting the configuration files in a board/something/foo directory, and adjusting the Buildroot configuration. It just adds a useless layer with a fuzzy concept of "project" that we had in the past, and was a terrible idea.

Moreover, the introduction text states that "Many buildroot users prefer to keep their project's customizations separate from buildroot itself", but the patch set doesn't solve this problem at all:

* Custom packages are not taken into account

* Additional patches added to existing packages are not taken into account

* Modification to the recipes of existing packages are not taken into account. And it is very common for a project that you need to slightly upgrade or adjust the recipe of a few existing packages.

So even with this additional complexity, the most annoying problems are not solved. So I really do prefer to keep things as it is: people have to use version control systems to keep their changes cleanly separated from the base Buildroot version. A half-working solution is not going to help our users to understand how to properly use Buildroot.

If we want to really separate the project specificities, then we need to introduce a real concept of "layers" like OpenEmbedded has, which allows to also override package recipes, add new custom packages, etc. But I am not sure we want to go down this road.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#31 lore raw

cover Add support for a project directory

Quoted 10 lines · Thomas Petazzoni
Quoted 2 lines · Thomas Petazzoni

So I'll have a look, but my initial impression is one of fairly high skepticism, to say the least.

Ok, I had a look, and I'm going to NAK this.

All what this stuff is adding can already be done with the current Buildroot, by putting the configuration files in a board/something/foo directory, and adjusting the Buildroot configuration.

It doesn't even have to be in a board/something/foo directory, it can
easily be out of tree. The only problem is that you have to write down a fairly long path for each of the relevant config options. So what patches 1 to 7 do is nothing more than changing the defaults.

Perhaps the name should be changed to CONFIG_DIR because it really just
contains configuration. However, CONFIG is already pretty overloaded (buildroot config, pkg-config, autoconf) so I don't like to use it.

Quoted 3 lines

It just adds a
useless layer with a fuzzy concept of "project" that we had in the past, and was a terrible idea.

That it didn't work in the past doesn't mean it's a terrible idea :-)

Quoted 3 lines

Moreover, the introduction text states that "Many buildroot users prefer to keep their project's customizations separate from buildroot itself", but the patch set doesn't solve this problem at all:

It's not a "problem", because it is already possible now - I've done
it for my last four buildroot projects (without any modification to stock buildroot), and I find it _much_ more convenient than before to upgrade buildroot - particularly if I just want to test that particular project against current master. But the main advantage is that you can nicely separate the things which are proprietary from the things that are potentially upstreamable (because those are still applied in the buildroot tree itself).

Quoted 1 line

* Custom packages are not taken into account

  In $(PROJECT_DIR)/project.mk, add:

BR2_PACKAGE_FOO=y
include package/foo/foo.mk

As I mentioned in my first mail, the setting of BR2_PACKAGE_FOO=y
could be automated, but I'm in fact not convinced that it's worth it.

Quoted 2 lines

* Additional patches added to existing packages are not taken into account

You can add a post-patch hook in project.mk. It's a bit more involved,
that's why I propose to automate that in the package infrastructure. But I haven't needed that up to now so I don't have a solution ready, and I'm not going to spend time on it if it will be NAK'd anyway :-)

For the things that do frequently need patches (linux, u-boot, ...)
we already have config options, so we could just add PROJECT_DIR-based defaults for those as well.

Quoted 3 lines

* Modification to the recipes of existing packages are not taken into account. And it is very common for a project that you need to slightly upgrade or adjust the recipe of a few existing packages.

Indeed. Those changes should still go in the buildroot tree itself.

Quoted 1 line

So even with this additional complexity,

Complexity? The diffstat of patches 1-7 is:

  8 files changed, 30 insertions(+), 2 deletions(-)

The ones after that are more involved, I agree.

Quoted 4 lines

the most annoying problems are
not solved. So I really do prefer to keep things as it is: people have to use version control systems to keep their changes cleanly separated from the base Buildroot version.

Version control doesn't really solve it, in my experience.

Quoted 7 lines

A half-working solution is not going
to help our users to understand how to properly use Buildroot.

If we want to really separate the project specificities, then we need to introduce a real concept of "layers" like OpenEmbedded has, which allows to also override package recipes, add new custom packages, etc. But I am not sure we want to go down this road.

I'm pretty sure we don't want to go down that road. I don't believe
the possibility of overriding package recipes is warranted. I also don't think it's very useful in our context to have several layers. The only thing I want is to keep the customizations (i.e. configuration, skeleton, etc.) in a separate directory tree from buildroot.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#32 lore raw

cover Add support for a project directory

Arnout,

Quoted 7 lines · Arnout Vandecappelle
Quoted 3 lines

All what this stuff is adding can already be done with the current Buildroot, by putting the configuration files in a board/something/foo directory, and adjusting the Buildroot configuration.

It doesn't even have to be in a board/something/foo directory, it can
easily be out of tree. The only problem is that you have to write down a fairly long path for each of the relevant config options.

Come on, it's just something like:

	$(TOPDIR)/../myproject/linux.config
Quoted 5 lines
Quoted 3 lines

It just adds a
useless layer with a fuzzy concept of "project" that we had in the past, and was a terrible idea.

That it didn't work in the past doesn't mean it's a terrible idea :-)

Except that what you're proposing is almost exactly what we had at the time, so to me it sounds like the same terrible idea :)

Quoted 4 lines
Quoted 3 lines

Moreover, the introduction text states that "Many buildroot users prefer to keep their project's customizations separate from buildroot itself", but the patch set doesn't solve this problem at all:

Quoted 8 lines

It's not a "problem", because it is already possible now - I've done
it for my last four buildroot projects (without any modification to stock buildroot), and I find it _much_ more convenient than before to upgrade buildroot - particularly if I just want to test that particular project against current master. But the main advantage is that you can nicely separate the things which are proprietary from the things that are potentially upstreamable (because those are still applied in the buildroot tree itself).

I still don't get what this patch set adds that you can't do with the existing Buildroot infrastructure.

Quoted 6 lines
Quoted 1 line

* Custom packages are not taken into account

  In $(PROJECT_DIR)/project.mk, add:

BR2_PACKAGE_FOO=y
include package/foo/foo.mk

Then you can just use the "local.mk" mechanism similarly, it already exists.

Quoted 11 lines
Quoted 2 lines

* Additional patches added to existing packages are not taken into account

You can add a post-patch hook in project.mk. It's a bit more involved,
that's why I propose to automate that in the package infrastructure. But I haven't needed that up to now so I don't have a solution ready, and I'm not going to spend time on it if it will be NAK'd anyway :-)

For the things that do frequently need patches (linux, u-boot, ...)
we already have config options, so we could just add PROJECT_DIR-based defaults for those as well.

I really would prefer to _document_ how to properly use the existing Buildroot infrastructure to cleanly separate custom stuff from Buildroot, rather than introducing more mechanisms on top of it.

Quoted 5 lines
Quoted 3 lines

* Modification to the recipes of existing packages are not taken into account. And it is very common for a project that you need to slightly upgrade or adjust the recipe of a few existing packages.

Indeed. Those changes should still go in the buildroot tree itself.

And those are the most annoying ones to maintain and upgrade when you want to upgrade to a new Buildroot version. So basically, it seems to me like your patch set solves problems that are already solved (specifying a custom location of kernel config, uClibc config, kernel patches, U-Boot patches, etc.), while it doesn't solve any of the real problems that aren't solved today.

Quoted 6 lines
Quoted 1 line

So even with this additional complexity,

Complexity? The diffstat of patches 1-7 is:

  8 files changed, 30 insertions(+), 2 deletions(-)

The ones after that are more involved, I agree.

It's not a question of diffstat. It's a question of "is this mechanism easy to grasp for newcomers and can it be immediately understood" and "does this mechanism adds any value over what Buildroot already provides"?

Quoted 6 lines
Quoted 4 lines

the most annoying problems are
not solved. So I really do prefer to keep things as it is: people have to use version control systems to keep their changes cleanly separated from the base Buildroot version.

Version control doesn't really solve it, in my experience.

Why so?

Quoted 8 lines
Quoted 7 lines

A half-working solution is not going
to help our users to understand how to properly use Buildroot.

If we want to really separate the project specificities, then we need to introduce a real concept of "layers" like OpenEmbedded has, which allows to also override package recipes, add new custom packages, etc. But I am not sure we want to go down this road.

Quoted 5 lines

I'm pretty sure we don't want to go down that road. I don't believe
the possibility of overriding package recipes is warranted. I also don't think it's very useful in our context to have several layers. The only thing I want is to keep the customizations (i.e. configuration, skeleton, etc.) in a separate directory tree from buildroot.

And this is all already possible:

BR2_ROOTFS_SKELETON_CUSTOM=y BR2_ROOTFS_SKELETON_CUSTOM_PATH="$(TOPDIR)/../foo"

BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(TOPDIR)/../kernel.config"

etc, etc.

So, sorry, but still not convinced. But I'm not the only Buildroot developer and user, and I'm not the maintainer. So my voice is just one amongst many others.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#33 lore raw

cover Add support for a project directory

Quoted 8 lines · Thomas Petazzoni

Arnout,

Quoted 4 lines · Arnout Vandecappelle
Quoted 3 lines

All what this stuff is adding can already be done with the current Buildroot, by putting the configuration files in a board/something/foo directory, and adjusting the Buildroot configuration.

Quoted 7 lines
Quoted 3 lines

It doesn't even have to be in a board/something/foo directory, it can
easily be out of tree. The only problem is that you have to write down a fairly long path for each of the relevant config options.

Come on, it's just something like:

	$(TOPDIR)/../myproject/linux.config

Except that I want the flexibility to have the buildroot tree in a different
place (e.g. a shared directory). That said, it's still easy:

  $(MYPROJECT_DIR)/linux.config

The issue is that it has to be filled in in many places. I'm just trying
to make it easier. And I'm also trying to establish a default policy, so it's easier for users to understand how to use buildroot.

[snip]

Quoted 2 lines

I still don't get what this patch set adds that you can't do with the existing Buildroot infrastructure.

As I wrote several times already, all of this can already be done with the
current infrastructure (with one exception: 'make savedefconfig' saving to a different file than 'defconfig'). It just provides simpler defaults.

[snip]

Quoted 3 lines

I really would prefer to _document_ how to properly use the existing Buildroot infrastructure to cleanly separate custom stuff from Buildroot, rather than introducing more mechanisms on top of it.

Well, that documentation would be:

- Define all the custom paths to $(PROJECT_DIR)/foo.config
- Write a Makefile that does 'make -C <buildroot_dir> PROJECT_DIR=<project_dir>'

And people will wonder why all those paths aren't already
$(PROJECT_DIR)/foo.config by default.

[snip]

Quoted 4 lines

It's not a question of diffstat. It's a question of "is this mechanism easy to grasp for newcomers and can it be immediately understood" and "does this mechanism adds any value over what Buildroot already provides"?

IMHO, it is.

I could do the following: I write a section in the documentation about
how to save your customization. This section will have two alternatives:
in-tree configuration or out-of-tree configuration. Then I can post a second patch that removes the parts of the out-of-tree documentation that become unnecessary when this patch series is implemented.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

the most annoying problems are
not solved. So I really do prefer to keep things as it is: people have to use version control systems to keep their changes cleanly separated from the base Buildroot version.

Version control doesn't really solve it, in my experience.

Why so?

Mainly because customers for some obscure reason want to use svn.

[snip]

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#34 lore raw

cover Add support for a project directory

In reply to Thomas Petazzoni
Quoted 5 lines · Thomas Petazzoni

I'll have a close look at all this later, but for reference, this is almost exactly a feature that Buildroot had years ago, and that we painfully progressively removed because it was not used properly by anyone, and was crippling the code base and usage of Buildroot with a lot of useless complexity.

Sorry that I'm not letting this go, but: how is this similar to the
project concept that was removed in 2009? I'm not trying to share any of the build output between different projects -- the only thing that is shared is the buildroot directory.

Should I rename it to something else?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#35 lore raw

cover Add support for a project directory

Quoted 4 lines · Arnout Vandecappelle

Sorry that I'm not letting this go, but: how is this similar to the
project concept that was removed in 2009? I'm not trying to share any of the build output between different projects -- the only thing that is shared is the buildroot directory.

I agree that you're not trying to share the build output between different projects, as was the "project feature" that existed before 2009 did. That said, I still don't get the benefit of this PROJECT_DIR thing when you can simply set you Linux configuration file, Linux patches, U-Boot patches and so on to point to the correct location with the existing Buildroot.

I don't see which problems it is solving, and to me, it only creates yet another option to configure Buildroot that will only confuse users.

But again, as I said in my earlier e-mails: this is just _my_ voice, and I am not the only Buildroot developer or contributor, and I am not the maintainer. So my voice is just my voice, nothing more.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#36 lore raw

cover Add support for a project directory

Hi

I have patched my 2012.02 and 2012.05 so i could enter a project name in the buildroot menuconfig. If I was happy with everyting and did my version of saveconfig then it created a default config:

buildrootdir/configs/<projectname>_defconfig

And i also saved the kernel .config,busybox .config,and uclibc .config under board/<projectname> This was for me convenient enough.

I think it does not make much sense to make it complicated. In practice i found out when I develop a new board I try to use the latest version, I don't port older boards to the latest buildroot unless I need stuff that is only supported in the latest kernels/libs etc.
So all my archived (patched) buildroot versions contain just one hw board and several rootfs variations.(different target applications)

( one of patches creates a symlink in the buildroot directory, so I can just refer to buildroot/kerneldir in make module makefile, I don't need to edit my makefiles after having selected another kernel version )

Regards Johan

-----Oorspronkelijk bericht-----
Van: buildroot-bounces at busybox.net [mailto:buildroot-bounces at busybox.net] Namens Thomas Petazzoni
Verzonden: woensdag 17 oktober 2012 19:26
Aan: Arnout Vandecappelle
CC: buildroot at busybox.net
Onderwerp: Re: [Buildroot] [PATCH 00/13] Add support for a project directory

Quoted 4 lines · Arnout Vandecappelle

Sorry that I'm not letting this go, but: how is this similar to the
project concept that was removed in 2009? I'm not trying to share any of the build output between different projects -- the only thing that is shared is the buildroot directory.

I agree that you're not trying to share the build output between different projects, as was the "project feature" that existed before
2009 did. That said, I still don't get the benefit of this PROJECT_DIR thing when you can simply set you Linux configuration file, Linux patches, U-Boot patches and so on to point to the correct location with the existing Buildroot.

I don't see which problems it is solving, and to me, it only creates yet another option to configure Buildroot that will only confuse users.

But again, as I said in my earlier e-mails: this is just _my_ voice, and I am not the only Buildroot developer or contributor, and I am not the maintainer. So my voice is just my voice, nothing more.

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#37 lore raw

cover Add support for a project directory

In reply to Arnout Vandecappelle (Essensium/Mind)

Hi,

Quoted 43 lines · Arnout Vandecappelle (Essensium/Mind)

Many buildroot users prefer to keep their project's customizations
separate from buildroot itself. This makes it easier to go to a new buildroot version, and to identify which parts are project- specific. Although it was already possible to keep the project's customization separate, this patch set simplifies it.

It introduces a new config option, BR2_PROJECT_DIR (patch 1).
This symbol is used to set defaults for many other config options (patches 2-7). The buildroot config itself can also be stored in the project directory by setting a default BR2_DEFCONFIG (patch 8).

Patch 9 does a 'make defconfig' and 'make world' in a single run
when a project directory is available.

Patch 10 makes it possible to update all config files (buildroot,
linux, busybox, ...) in a single shot.

Patch 11 adds a 'make projectdir' target to initialize a project
directory. It also creates a Makefile in the project directory:
it downloads buildroot itself, so the project directory is self-sufficient.

Patch 12 adds the thing that everybody has to put in their
post-build script as a configuration option: a rootfs overlay. This patch could also be applied independent of the series (except for the one line that sets a default based on PROJECT_DIR).

Patch 13, finally, adds the PROJECT_DIR concept to the manual.

What is still missing is a way to add custom packages and custom
patches in the project directory. Either can already be done with the BR2_PACKAGE_OVERRIDE_FILE, but I'm considering specific additions:

- For custom packages, including $(PROJECT_DIR)/package/*/*.mk and automatically setting these packages to 'y'. I don't think it's useful to include custom packages in the menuconfig - you just want them to be always enabled.

- For custom patches, add $(PROJECT_DIR)/patches/<pkg>/<pkg>-*.patch to the list of patches that generic-package looks for. The custom patches would come in addition to and after the buildroot patches.

Quoted 8 lines

Comments on these last two ideas are welcome.

Two weeks from now (Oct. 28) I'm giving a presentation about buildroot
at T-Dose in Eindhoven. I'll use the project directory concept in that presentation. So if there's any major feedback I'd like to hear it before that time :-)

For what it's worth, I don't think I need a PROJECT_DIR feature. I'm using Buildroot pretty much according to the way Thomas has described it in his 'Buildroot for real projects' presentation:
- project specific packages are placed in package/<company>/...,
- config files, post-build script, rootfs overlay, ... are placed in board/<company>/<project>/...

I'm using standard version control system features to merge these changes with new buildroot releases, with no real problems so far.

I do like some of the patches in this series, though, and have commented on them individually. I'd like these to be continued regardless of the decision on the series.

Best regards,
Thomas

Quoted 46 lines

---

Arnout Vandecappelle (Essensium/Mind) (13):
Add BR2_PROJECT_DIR config option
Set default BR2_PACKAGE_OVERRIDE_FILE based on BR2_PROJECT_DIR
linux: get default paths from BR2_PROJECT_DIR
busybox: get default paths from BR2_PROJECT_DIR target/generic: get default paths from BR2_PROJECT_DIR
toolchain-crosstool-ng: get default paths from BR2_PROJECT_DIR
uClibc: get default paths from BR2_PROJECT_DIR
Store BR2_DEFCONFIG in .config, and use it to update the original input Skip menuconfig if BR2_DEFCONFIG or BR2_PROJECT_DIR is given. Add update-all-config target
Add target to create a project directory
target/generic: add filesystem overlay option
Document BR2_PROJECT_DIR in the manual

 Config.in                                        |   27 +++++++
 Makefile                                         |   86 +++++++++++++++++++--
 Makefile.project.tmpl                            |   40 ++++++++++
 docs/manual/customize-project.txt                |   37 +++++++++
 docs/manual/customize-rootfs.txt                 |   21 ++---
 docs/manual/customize.txt                        |    2
 fs/common.mk                                     |    7 +-
 linux/Config.in                                  |    2
 linux/linux.mk                                   |    2
 package/busybox/Config.in                        |    1
 package/busybox/busybox-1.20.x.config            |   26 +++---
 package/busybox/busybox.mk                       |    4 +
 target/generic/Config.in                         |   16 ++++
 toolchain/toolchain-crosstool-ng/Config.in       |    1
 toolchain/toolchain-crosstool-ng/crosstool-ng.mk |    7 ++
 toolchain/uClibc/Config.in                       |    1
 toolchain/uClibc/uClibc-0.9.33.config            |   91 +++++++++-------------
 toolchain/uClibc/uclibc.mk                       |    4 +
 18 files changed, 286 insertions(+), 89 deletions(-)
 create mode 100644 Makefile.project.tmpl
 create mode 100644 docs/manual/customize-project.txt

--
Signature
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot