All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request v4] Pull request for branch arnout-update-config
@ 2013-02-05 17:15 Arnout Vandecappelle
  2013-02-05 17:15 ` [Buildroot] [PATCH 1/4] manual: add section about storing the configuration Arnout Vandecappelle
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 17:15 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

 Hello,

 This is a refresh of the patches that describe in the manual how
to save the configuration in the board directory, that add the
post-build overlay option, and that does 'make savedefconfig' save
to a configured file rather than "defconfig".

 The patches that add a xxx-update-config for each package with a
configuration possibility and that add an update-all-configs goal
have been left out, because at the BR developer days it was decided
to always update the config after you do a xxx-menuconfig. So
those patches will become superfluous anyway. They will come in a
separate series.

 These patches come as a series rather than individually because the
later ones all update the documentation that is added in the first
one.

 Regards,
 Arnout
--

The following changes since commit ddd69b5609cc9bd954afcfc2f91831d64b9cfff7:

  libffi: switch to using a Git version, brings Microblaze and Xtensa support (2013-02-05 15:57:02 +0100)

are available in the git repository at:

  https://git.gitorious.org/buildroot/buildroot.git arnout-update-config

for you to fetch changes up to 41e27bc2d2881606d1da299f6056d24bc9d34e78:

  Make savedefconfig save to a configured file. (2013-02-05 17:59:37 +0100)

----------------------------------------------------------------
Arnout Vandecappelle (Essensium/Mind) (4):
      manual: add section about storing the configuration.
      target/generic: add filesystem overlay option
      busybox: busybox-update-config should depend on busybox-configure
      Make savedefconfig save to a configured file.

 Config.in                                 |   12 +++
 Makefile                                  |   26 ++++-
 docs/manual/adding-packages-directory.txt |    1 +
 docs/manual/board-support.txt             |   38 -------
 docs/manual/customize-rootfs.txt          |   17 +--
 docs/manual/customize-store.txt           |  159 +++++++++++++++++++++++++++++
 docs/manual/customize.txt                 |    2 +
 package/busybox/busybox.mk                |    2 +-
 system/Config.in                          |   11 ++
 9 files changed, 219 insertions(+), 49 deletions(-)
 delete mode 100644 docs/manual/board-support.txt
 create mode 100644 docs/manual/customize-store.txt
--
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH 1/4] manual: add section about storing the configuration.
  2013-02-05 17:15 [Buildroot] [pull request v4] Pull request for branch arnout-update-config Arnout Vandecappelle
@ 2013-02-05 17:15 ` Arnout Vandecappelle
  2013-02-05 20:04   ` Peter Korsgaard
  2013-02-05 17:16 ` [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option Arnout Vandecappelle
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 17:15 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

Reuse part of board-support.txt, and remove that one because it
was unused.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v4:
 - Rebased against master.

v3:
 - Removed the section about out-of-tree configuration.
 - Added barebox config.
 - Comments from Luca.

v2: mention LINUX_KERNEL_PATCH also in in-tree documentation
    (Samuel Martin)

It's probably Acked-by Luca, but since my changes are pretty
heavy (removing a whole section, adding barebox) I didn't include
the ack.
---
 docs/manual/adding-packages-directory.txt |    1 +
 docs/manual/board-support.txt             |   38 -------
 docs/manual/customize-store.txt           |  160 +++++++++++++++++++++++++++++
 docs/manual/customize.txt                 |    2 +
 4 files changed, 163 insertions(+), 38 deletions(-)
 delete mode 100644 docs/manual/board-support.txt
 create mode 100644 docs/manual/customize-store.txt

diff --git a/docs/manual/adding-packages-directory.txt b/docs/manual/adding-packages-directory.txt
index 5d17aac..cc68497 100644
--- a/docs/manual/adding-packages-directory.txt
+++ b/docs/manual/adding-packages-directory.txt
@@ -168,6 +168,7 @@ coding style].
 
 The +.mk+ file
 ~~~~~~~~~~~~~~
+[[adding-packages-mk]]
 
 Finally, here's the hardest part. Create a file named +libfoo.mk+. It
 describes how the package should be downloaded, configured, built,
diff --git a/docs/manual/board-support.txt b/docs/manual/board-support.txt
deleted file mode 100644
index 44ab6eb..0000000
--- a/docs/manual/board-support.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-// -*- mode:doc -*- ;
-
-[[board-support]]
-Creating your own board support
--------------------------------
-
-Creating your own board support in Buildroot allows users of a
-particular hardware platform to easily build a system that is known to
-work.
-
-To do so, you need to create a normal Buildroot configuration that
-builds a basic system for the hardware: toolchain, kernel, bootloader,
-filesystem and a simple Busybox-only userspace. No specific package
-should be selected: the configuration should be as minimal as
-possible, and should only build a working basic Busybox system for the
-target platform. You can of course use more complicated configurations
-for your internal projects, but the Buildroot project will only
-integrate basic board configurations. This is because package
-selections are highly application-specific.
-
-Once you have a known working configuration, run +make
-savedefconfig+. This will generate a minimal +defconfig+ file at the
-root of the Buildroot source tree. Move this file into the +configs/+
-directory, and rename it +BOARDNAME_defconfig+.
-
-It is recommended to use upstream versions of the Linux kernel and
-bootloaders where possible, and also to use default kernel and bootloader
-configurations if possible. If the defaults are incorrect for
-your board, or no default exists, we encourage you to send fixes to the
-corresponding upstream projects.
-
-However, in the mean time, you may want to store kernel or bootloader
-configuration or patches specific to your target platform. To do so,
-create a directory +board/MANUFACTURER+ and a subdirectory
-+board/MANUFACTURER/BOARDNAME+ (after replacing, of course,
-MANUFACTURER and BOARDNAME with the appropriate values, in lower case
-letters). You can then store your patches and configurations in these
-directories, and reference them from the main Buildroot configuration.
diff --git a/docs/manual/customize-store.txt b/docs/manual/customize-store.txt
new file mode 100644
index 0000000..435c1b9
--- /dev/null
+++ b/docs/manual/customize-store.txt
@@ -0,0 +1,160 @@
+// -*- mode:doc -*-
+
+[[customize-store]]
+Storing the configuration
+-------------------------
+
+When you have a buildroot configuration that you are satisfied with and
+you want to share it with others, put it under revision control or move
+on to a different buildroot project, you need to store the configuration
+so it can be rebuilt later. The configuration that needs to be stored
+consists of the buildroot configuration, the configuration files for
+packages that you use (kernel, busybox, uClibc, ...), and your rootfs
+modifications.
+
+Basics for storing the configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[[customize-store-basics]]
+
+Buildroot configuration
+^^^^^^^^^^^^^^^^^^^^^^^
+
+For storing the buildroot configuration itself, buildroot offers the
+following command: +make savedefconfig+
+
+This strips the buildroot configuration down by removing configuration
+options that are at their default value. The result is stored in a file
+called +defconfig+. Copy this file to +foo_defconfig+ in the +configs+
+directory. The configuration can then be rebuilt by running
++make foo_defconfig+
+
+Alternatively, you can copy the file to any other place and rebuild with
++make defconfig BR2_DEFCONFIG=<path-to-defconfig-file>+.
+
+
+Other package configuration
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The configuration files for busybox, the linux kernel, barebox, uClibc and
+crosstool-NG should be stored as well. For each of these, a
+buildroot configuration option exists to point to an input configuration
+file, e.g. +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+.  To save their
+configuration, set those configuration options to a path outside
+your output directory, e.g. +board/<manufacturer>/<boardname>/linux.config+.
+Then, copy the configuration files to that path.
+
+Make sure that you create a configuration file 'before' changing
+the +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+ etc. options.  Otherwise,
+buildroot will try to access this config file, which doesn't exist
+yet, and will fail. You can create the configuration file by running
++make linux-menuconfig+ etc.
+
+Buildroot provides a few helper targets to make the saving of
+configuration files easier.
+
+* +make linux-update-defconfig+ saves the linux configuration to the
+  path specified by +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+.  It
+  simplifies the config file by removing default values.  However,
+  this only works with kernels starting from 2.6.33.  For earlier
+  kernels, use +make linux-update-config+.
+* +make busybox-update-config+ saves the busybox configuration to the
+  path specified by +BR2_PACKAGE_BUSYBOX_CONFIG+.
+* +make uclibc-update-config+ saves the uClibc configuration to the
+  path specified by +BR2_UCLIBC_CONFIG+.
+* +make barebox-update-defconfig+ saves the barebox configuration to the
+  path specified by +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+.
+* For crosstool-NG and at91bootstrap3 and no helper exists so you
+  have to copy the config file manually to +BR2_TOOLCHAIN_CTNG_CONFIG+,
+  resp. +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+.
+
+
+Creating your own board support
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Creating your own board support in Buildroot allows users of a
+particular hardware platform to easily build a system that is known to
+work.
+
+To do so, you need to create a normal Buildroot configuration that
+builds a basic system for the hardware: toolchain, kernel, bootloader,
+filesystem and a simple Busybox-only userspace. No specific package
+should be selected: the configuration should be as minimal as
+possible, and should only build a working basic Busybox system for the
+target platform. You can of course use more complicated configurations
+for your internal projects, but the Buildroot project will only
+integrate basic board configurations. This is because package
+selections are highly application-specific.
+
+Once you have a known working configuration, run +make
+savedefconfig+. This will generate a minimal +defconfig+ file at the
+root of the Buildroot source tree. Move this file into the +configs/+
+directory, and rename it +<boardname>_defconfig+.
+
+It is recommended to use as much as possible upstream versions of the
+Linux kernel and bootloaders, and to use as much as possible default
+kernel and bootloader configurations. If they are incorrect for your
+board, or no default exists, we encourage you to send fixes to the
+corresponding upstream projects.
+
+However, in the mean time, you may want to store kernel or bootloader
+configuration or patches specific to your target platform. To do so,
+create a directory +board/<manufacturer>+ and a subdirectory
++board/<manufacturer>/<boardname>+. You can then store your patches
+and configurations in these directories, and reference them from the main
+Buildroot configuration.
+
+
+Step-by-step instructions for storing configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To store the configuration for a specific product, device or
+application, it is advisable to use the same conventions as for the
+board support: put the buildroot defconfig in the +configs+ directory,
+and any other files in a subdirectory of the +boards+ directory.  This
+section gives step-by-step instructions about how to do that. Of course,
+you can skip the steps that are not relevant for your use case.
+
+1. +make menuconfig+ to configure toolchain, packages and kernel.
+1. +make linux-menuconfig+ to update the kernel config, similar for
+   other configuration.
+1. +mkdir -p board/<manufacturer>/<boardname>+
+1. Set the following options to +board/<manufacturer>/<boardname>/<package>.config+
+   (as far as they are relevant):
+   * +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+
+   * +BR2_PACKAGE_BUSYBOX_CONFIG+
+   * +BR2_TOOLCHAIN_CTNG_CONFIG+
+   * +BR2_UCLIBC_CONFIG+
+   * +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+
+   * +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+
+1. Write the configuration files:
+   * +make linux-update-defconfig+
+   * +make busybox-update-config+
+   * +cp <output>/build/build-toolchain/.config board/<manufacturer>/<boardname>/ctng.config+
+   * +make uclibc-update-config+
+   * +cp <output>/build/at91bootstrap3-*/.config board/<manufacturer>/<boardname>/at91bootstrap3.config+
+   * +make barebox-update-defconfig+
+1. Create +board/<manufacturer>/<boardname>/fs-overlay/+ and fill it
+   with additional files you need on your rootfs, e.g.
+   +board/<manufacturer>/<boardname>/fs-overlay/etc/inittab+.
+1. Create a post-build script
+   +board/<manufacturer>/<boardname>/post-build.sh+.  It should contain
+   the following command:
++
+------------
+rsync -a --exclude .empty --exclude '*~' ${0%/*}/fs-overlay $1
+------------
++
+1. Set +BR2_ROOTFS_POST_BUILD_SCRIPT+ to +board/<manufacturer>/<boardname>/post-build.sh+
+1. If additional setuid permissions have to be set or device nodes have
+   to be created, create +board/<manufacturer>/<boardname>/device_table.txt+
+   and add that path to +BR2_ROOTFS_DEVICE_TABLE+.
+1. +make savedefconfig+ to save the buildroot configuration.
+1. +cp defconfig configs/<boardname>_defconfig+
+1. To add patches to the linux build, set +BR2_LINUX_KERNEL_PATCH+ to
+   +board/<manufacturer>/<boardname>/patches/linux/+ and add your
+   patches in that directory. Each patch should be called
+   +linux-<num>-<description>.patch+. Similar for U-Boot, barebox,
+   at91bootstrap and at91bootstrap3.
+1. If you need modifications to other packages, or if you need to add
+   packages, do that directly in the +packages/+ directory, following the
+   instructions in xref:adding-packages[].
diff --git a/docs/manual/customize.txt b/docs/manual/customize.txt
index 1e6f4e8..a13ba8f 100644
--- a/docs/manual/customize.txt
+++ b/docs/manual/customize.txt
@@ -12,3 +12,5 @@ include::customize-uclibc-config.txt[]
 include::customize-kernel-config.txt[]
 
 include::customize-toolchain.txt[]
+
+include::customize-store.txt[]
-- 
1.7.10.4

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

* [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option
  2013-02-05 17:15 [Buildroot] [pull request v4] Pull request for branch arnout-update-config Arnout Vandecappelle
  2013-02-05 17:15 ` [Buildroot] [PATCH 1/4] manual: add section about storing the configuration Arnout Vandecappelle
@ 2013-02-05 17:16 ` Arnout Vandecappelle
  2013-02-05 20:37   ` Peter Korsgaard
  2013-02-05 17:16 ` [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure Arnout Vandecappelle
  2013-02-05 17:16 ` [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file Arnout Vandecappelle
  3 siblings, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 17:16 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

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.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
---
v4: Rebased against master.

v3: keep the custom skeleton documentation

v2: don't deprecate custom skeleton
---
 Makefile                         |    9 +++++++++
 docs/manual/customize-rootfs.txt |   17 +++++++++++------
 docs/manual/customize-store.txt  |   13 +++++--------
 system/Config.in                 |   11 +++++++++++
 4 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 6f8ed0e..ac59071 100644
--- a/Makefile
+++ b/Makefile
@@ -501,6 +501,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\(s\)")
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
index 6399699..fa04d85 100644
--- a/docs/manual/customize-rootfs.txt
+++ b/docs/manual/customize-rootfs.txt
@@ -24,6 +24,12 @@ there are a few ways to customize the resulting target filesystem.
   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.
+  _Among these first 3 methods, this one should be preferred_.
+
 * 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
@@ -31,12 +37,11 @@ there are a few ways to customize the resulting target filesystem.
   specify the location of your post-build script. This option can be
   found in the +System configuration+ menu. 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. _Among these first 3 methods, this one should be preferred_.
+  and this script can then be used to 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.
   You may also use these variables in your post-build script:
     - +BUILDROOT_CONFIG+: the path to the Buildroot .config file
     - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see
diff --git a/docs/manual/customize-store.txt b/docs/manual/customize-store.txt
index 435c1b9..5d004ea 100644
--- a/docs/manual/customize-store.txt
+++ b/docs/manual/customize-store.txt
@@ -136,15 +136,12 @@ you can skip the steps that are not relevant for your use case.
 1. Create +board/<manufacturer>/<boardname>/fs-overlay/+ and fill it
    with additional files you need on your rootfs, e.g.
    +board/<manufacturer>/<boardname>/fs-overlay/etc/inittab+.
+   Set +BR2_ROOTFS_OVERLAY+
+   to +board/<manufacturer>/<boardname>/fs-overlay+.
 1. Create a post-build script
-   +board/<manufacturer>/<boardname>/post-build.sh+.  It should contain
-   the following command:
-+
-------------
-rsync -a --exclude .empty --exclude '*~' ${0%/*}/fs-overlay $1
-------------
-+
-1. Set +BR2_ROOTFS_POST_BUILD_SCRIPT+ to +board/<manufacturer>/<boardname>/post-build.sh+
+   +board/<manufacturer>/<boardname>/post-build.sh+.  Set
+   +BR2_ROOTFS_POST_BUILD_SCRIPT+ to
+   +board/<manufacturer>/<boardname>/post-build.sh+
 1. If additional setuid permissions have to be set or device nodes have
    to be created, create +board/<manufacturer>/<boardname>/device_table.txt+
    and add that path to +BR2_ROOTFS_DEVICE_TABLE+.
diff --git a/system/Config.in b/system/Config.in
index 69863c4..fa01d91 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -249,6 +249,17 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
 
 endif # BR2_ROOTFS_SKELETON_DEFAULT
 
+config BR2_ROOTFS_OVERLAY
+	string "Root filesystem overlay directories"
+	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.
+
+	  They are 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 ""
-- 
1.7.10.4

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

* [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure
  2013-02-05 17:15 [Buildroot] [pull request v4] Pull request for branch arnout-update-config Arnout Vandecappelle
  2013-02-05 17:15 ` [Buildroot] [PATCH 1/4] manual: add section about storing the configuration Arnout Vandecappelle
  2013-02-05 17:16 ` [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option Arnout Vandecappelle
@ 2013-02-05 17:16 ` Arnout Vandecappelle
  2013-02-05 20:38   ` Peter Korsgaard
  2013-02-05 17:16 ` [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file Arnout Vandecappelle
  3 siblings, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 17:16 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

Before the config file can be copied, it has to exist.  The
other xxx-update-config targets do this as well.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
---
v4: Rebased against master.

v2: small spelling mistake in commit message
---
 package/busybox/busybox.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 9154c08..599e145 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -223,5 +223,5 @@ busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
 	rm -f $(BUSYBOX_DIR)/.stamp_built
 	rm -f $(BUSYBOX_DIR)/.stamp_target_installed
 
-busybox-update-config:
+busybox-update-config: busybox-configure
 	cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
-- 
1.7.10.4

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

* [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file.
  2013-02-05 17:15 [Buildroot] [pull request v4] Pull request for branch arnout-update-config Arnout Vandecappelle
                   ` (2 preceding siblings ...)
  2013-02-05 17:16 ` [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure Arnout Vandecappelle
@ 2013-02-05 17:16 ` Arnout Vandecappelle
  2013-02-05 20:43   ` Peter Korsgaard
  2013-02-06 14:15   ` Gustavo Zacarias
  3 siblings, 2 replies; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 17:16 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

Store BR2_DEFCONFIG in .config, and use it to update the original input
defconfig file after updating the configuration.  When a config is
created by using the BR2_DEFCONFIG=... option, this is saved in the
.config file; later runs of savedefconfig will update that same location.
It is also possible to configure this place in the interactive
configuration.

The BR2_DEFCONFIG value itself is not saved into the generated
defconfig, since Kconfig considers it at its default. This is
intentional, to avoid hard-coding an absolute path in the defconfig.
It will anyway be set again when the defconfig is used with the
'make BR2_DEFCONFIG=... defconfig' command.

As a side-effect of this change, the *config options have been moved out
of the BR2_HAVE_DOT_CONFIG condition.  This doesn't make any functional
difference, because the .config is still not read for the *config targets.
However, the defconfig and savedefconfig targets do need to include
.config now, which makes them slightly slower.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
---
v4: Rebased against master.

v3: replaced foo_defconfig documentation with BR2_DEFCONFIG.
---
 Config.in                       |   12 ++++++++++++
 Makefile                        |   17 +++++++++++++----
 docs/manual/customize-store.txt |   10 ++++++----
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/Config.in b/Config.in
index af77a83..4929a80 100644
--- a/Config.in
+++ b/Config.in
@@ -22,6 +22,18 @@ config BR2_HOSTARCH_NEEDS_IA32_LIBS
 
 source "arch/Config.in"
 
+config BR2_DEFCONFIG_FROM_ENV
+	string
+	option env="BR2_DEFCONFIG"
+
+config BR2_DEFCONFIG
+	string "Location to save buildroot config"
+	default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
+	default "$(CONFIG_DIR)/defconfig"
+	help
+	  When running 'make savedefconfig', the defconfig file will be saved
+	  in this location.
+
 menu "Build options"
 
 menu "Commands"
diff --git a/Makefile b/Makefile
index ac59071..1476d97 100644
--- a/Makefile
+++ b/Makefile
@@ -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
 
@@ -594,6 +594,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+
 # configuration
 # ---------------------------------------------------------------------------
 
@@ -604,7 +606,12 @@ $(BUILD_DIR)/buildroot-config/%onf:
 	mkdir -p $(@D)/lxdialog
 	$(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
 
+DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
+
+# We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will
+# recognize that if it's still at its default $(CONFIG_DIR)/defconfig
 COMMON_CONFIG_ENV = \
+	BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \
 	KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
@@ -682,7 +689,7 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 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)
+	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
 
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
@@ -690,13 +697,15 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 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)
+.PHONY: defconfig savedefconfig
 
 #############################################################
 #
diff --git a/docs/manual/customize-store.txt b/docs/manual/customize-store.txt
index 5d004ea..bf7bd14 100644
--- a/docs/manual/customize-store.txt
+++ b/docs/manual/customize-store.txt
@@ -20,13 +20,15 @@ Buildroot configuration
 ^^^^^^^^^^^^^^^^^^^^^^^
 
 For storing the buildroot configuration itself, buildroot offers the
-following command: +make savedefconfig+
+following command: +make savedefconfig+.
 
 This strips the buildroot configuration down by removing configuration
 options that are@their default value. The result is stored in a file
-called +defconfig+. Copy this file to +foo_defconfig+ in the +configs+
-directory. The configuration can then be rebuilt by running
-+make foo_defconfig+
+called +defconfig+.  If you want to save it in another place, update set
+the +BR2_DEFCONFIG+ option, or call make with +make savedefconfig
+BR2_DEFCONFIG=<path-to-defconfig>+.  The usual place is
++configs/<boardname>_defconfig+. The configuration can then be rebuilt by
+running +make <boardname>_defconfig+.
 
 Alternatively, you can copy the file to any other place and rebuild with
 +make defconfig BR2_DEFCONFIG=<path-to-defconfig-file>+.
-- 
1.7.10.4

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

* [Buildroot] [PATCH 1/4] manual: add section about storing the configuration.
  2013-02-05 17:15 ` [Buildroot] [PATCH 1/4] manual: add section about storing the configuration Arnout Vandecappelle
@ 2013-02-05 20:04   ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2013-02-05 20:04 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 Arnout> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
 Arnout> Reuse part of board-support.txt, and remove that one because it
 Arnout> was unused.

Committed with minor fixes (see below).

 Arnout> +Other package configuration
 Arnout> +^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Arnout> +
 Arnout> +The configuration files for busybox, the linux kernel, barebox, uClibc and
 Arnout> +crosstool-NG should be stored as well. For each of these, a

s/as well/as well if changed/

 Arnout> +* For crosstool-NG and at91bootstrap3 and no helper exists so you
 Arnout> +  have to copy the config file manually to

s/at91bootstrap3 and no/at91bootstap3, no/

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option
  2013-02-05 17:16 ` [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option Arnout Vandecappelle
@ 2013-02-05 20:37   ` Peter Korsgaard
  2013-02-05 21:28     ` Arnout Vandecappelle
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2013-02-05 20:37 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 Arnout> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
 Arnout> The filesystem overlay is a tree that is copied over the target fs
 Arnout> after building everything - which is currently usually done in the
 Arnout> post-build script.

 Arnout> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 Arnout> Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
 Arnout> ---
 Arnout> v4: Rebased against master.

 Arnout> v3: keep the custom skeleton documentation

 Arnout> v2: don't deprecate custom skeleton
 Arnout> ---
 Arnout>  Makefile                         |    9 +++++++++
 Arnout>  docs/manual/customize-rootfs.txt |   17 +++++++++++------
 Arnout>  docs/manual/customize-store.txt  |   13 +++++--------
 Arnout>  system/Config.in                 |   11 +++++++++++
 Arnout>  4 files changed, 36 insertions(+), 14 deletions(-)

 Arnout> diff --git a/Makefile b/Makefile
 Arnout> index 6f8ed0e..ac59071 100644
 Arnout> --- a/Makefile
 Arnout> +++ b/Makefile
 Arnout> @@ -501,6 +501,15 @@ endif
 Arnout>  		echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
 Arnout>  	) >  $(TARGET_DIR)/etc/os-release
 
 Arnout> +	@for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
 Arnout> +		if [ -d $${dir} ]; then \
 Arnout> +			$(call MESSAGE,"Copying overlay $${dir}"); \
 Arnout> +			rsync -a \
 Arnout> +				--exclude .svn --exclude .git --exclude .hg --exclude '*~' \
 Arnout> +				$${dir}/ $(TARGET_DIR); \
 Arnout> +		fi \

Similar to the recent discussion about the post-build script, I don't
think we should ignore missing (misspelled?) directories, so I dropped
the -d test and committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure
  2013-02-05 17:16 ` [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure Arnout Vandecappelle
@ 2013-02-05 20:38   ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2013-02-05 20:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 Arnout> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
 Arnout> Before the config file can be copied, it has to exist.  The
 Arnout> other xxx-update-config targets do this as well.

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file.
  2013-02-05 17:16 ` [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file Arnout Vandecappelle
@ 2013-02-05 20:43   ` Peter Korsgaard
  2013-02-06 14:15   ` Gustavo Zacarias
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2013-02-05 20:43 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 Arnout> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
 Arnout> Store BR2_DEFCONFIG in .config, and use it to update the
 Arnout> original input defconfig file after updating the configuration.
 Arnout> When a config is created by using the BR2_DEFCONFIG=... option,
 Arnout> this is saved in the .config file; later runs of savedefconfig
 Arnout> will update that same location.

Committed with a minor fix (see below) - Thanks.
 Arnout> +called +defconfig+.  If you want to save it in another place, update set

s/update set/change/

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option
  2013-02-05 20:37   ` Peter Korsgaard
@ 2013-02-05 21:28     ` Arnout Vandecappelle
  0 siblings, 0 replies; 11+ messages in thread
From: Arnout Vandecappelle @ 2013-02-05 21:28 UTC (permalink / raw)
  To: buildroot

On 05/02/13 21:37, Peter Korsgaard wrote:
>   Arnout> +	@for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
>   Arnout> +		if [ -d $${dir} ]; then \
>   Arnout> +			$(call MESSAGE,"Copying overlay $${dir}"); \
>   Arnout> +			rsync -a \
>   Arnout> +				--exclude .svn --exclude .git --exclude .hg --exclude '*~' \
>   Arnout> +				$${dir}/ $(TARGET_DIR); \
>   Arnout> +		fi \
>
> Similar to the recent discussion about the post-build script, I don't
> think we should ignore missing (misspelled?) directories, so I dropped
> the -d test and committed, thanks.

  Yes, thanks, that was a left-over from when I had a default value for 
the overlay.

  Regards,
  Arnout

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

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

* [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file.
  2013-02-05 17:16 ` [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file Arnout Vandecappelle
  2013-02-05 20:43   ` Peter Korsgaard
@ 2013-02-06 14:15   ` Gustavo Zacarias
  1 sibling, 0 replies; 11+ messages in thread
From: Gustavo Zacarias @ 2013-02-06 14:15 UTC (permalink / raw)
  To: buildroot

On 02/05/2013 02:16 PM, Arnout Vandecappelle (Essensium/Mind) wrote:

>  source "arch/Config.in"
>  
> +config BR2_DEFCONFIG_FROM_ENV
> +	string
> +	option env="BR2_DEFCONFIG"
> +
> +config BR2_DEFCONFIG
> +	string "Location to save buildroot config"
> +	default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
> +	default "$(CONFIG_DIR)/defconfig"
> +	help
> +	  When running 'make savedefconfig', the defconfig file will be saved
> +	  in this location.
> +
>  menu "Build options"

Any particular reason for this option to be on the toplevel menu?
It looks terrible there :)
Maybe build options?
Regards.

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

end of thread, other threads:[~2013-02-06 14:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 17:15 [Buildroot] [pull request v4] Pull request for branch arnout-update-config Arnout Vandecappelle
2013-02-05 17:15 ` [Buildroot] [PATCH 1/4] manual: add section about storing the configuration Arnout Vandecappelle
2013-02-05 20:04   ` Peter Korsgaard
2013-02-05 17:16 ` [Buildroot] [PATCH 2/4] target/generic: add filesystem overlay option Arnout Vandecappelle
2013-02-05 20:37   ` Peter Korsgaard
2013-02-05 21:28     ` Arnout Vandecappelle
2013-02-05 17:16 ` [Buildroot] [PATCH 3/4] busybox: busybox-update-config should depend on busybox-configure Arnout Vandecappelle
2013-02-05 20:38   ` Peter Korsgaard
2013-02-05 17:16 ` [Buildroot] [PATCH 4/4] Make savedefconfig save to a configured file Arnout Vandecappelle
2013-02-05 20:43   ` Peter Korsgaard
2013-02-06 14:15   ` Gustavo Zacarias

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