Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 01/10] kconfig infra: support built-in config files
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 02/10] kconfig infra: add support for defconfig files Yann E. MORIN
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

When the configuration file of a package is located inside of the
package sources, a make dependency can only be expressed after the
package has been extracted (and patched).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 package/pkg-kconfig.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index ec58d69..ef724e5 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -41,9 +41,13 @@ ifndef $(2)_KCONFIG_FILE
 $$(error Internal error: no value specified for $(2)_KCONFIG_FILE)
 endif
 
+# The config file could be in-tree, so before depending on it the package should
+# be extracted (and patched) first
+$$($(2)_KCONFIG_FILE): | $(1)-patch
+
 # The .config file is obtained by copying it from the specified source
 # configuration file, after the package has been patched.
-$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch
+$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE)
 	$$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config
 
 # In order to get a usable, consistent configuration, some fixup may be needed.
-- 
1.9.1

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

* [Buildroot] [PATCH 02/10] kconfig infra: add support for defconfig files
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 01/10] kconfig infra: support built-in config files Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 03/10] kconfig infra: make update-config/defconfig handling symmetrical Yann E. MORIN
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

This commit adds support for using a defconfig file instead of a full
.config. This is a precondition to migrate packages like linux and
barebox to the kconfig infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 package/pkg-kconfig.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index ef724e5..db56b7a 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -47,8 +47,13 @@ $$($(2)_KCONFIG_FILE): | $(1)-patch
 
 # The .config file is obtained by copying it from the specified source
 # configuration file, after the package has been patched.
+# Since the file could be a defconfig file it needs to be expanded to a
+# full .config first. We use 'make oldconfig' because this can be safely
+# done even when the package does not support defconfigs.
 $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE)
 	$$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config
+	@yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
+		$$($(2)_KCONFIG_OPTS) oldconfig
 
 # In order to get a usable, consistent configuration, some fixup may be needed.
 # The exact rules are specified by the package .mk file.
@@ -68,10 +73,22 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_
 	rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built}
 	rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed
 
+$(1)-savedefconfig: $$($(2)_DIR)/.stamp_kconfig_fixup_done
+	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
+		$$($(2)_KCONFIG_OPTS) savedefconfig
+
 # Target to copy back the configuration to the source configuration file
 $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done
 	cp --preserve=timestamps -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
 
+# Note: make sure the timestamp of the stored configuration is not newer than
+# the .config to avoid a useless rebuild. Note that, contrary to
+# $(1)-update-config, the reference for 'touch' is _not_ the file from which
+# we copy.
+$(1)-update-defconfig: $(1)-savedefconfig
+	cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+
 endef # inner-kconfig-package
 
 ################################################################################
-- 
1.9.1

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

* [Buildroot] [PATCH 03/10] kconfig infra: make update-config/defconfig handling symmetrical
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 01/10] kconfig infra: support built-in config files Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 02/10] kconfig infra: add support for defconfig files Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files Yann E. MORIN
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Replace a 'cp --preserve' with a 'touch --reference' so that the code
for foo-update-config and foo-update-defconfig is symmetrical to ease
maintainability and increase clarity.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 package/pkg-kconfig.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index db56b7a..f76c7a7 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -78,8 +78,11 @@ $(1)-savedefconfig: $$($(2)_DIR)/.stamp_kconfig_fixup_done
 		$$($(2)_KCONFIG_OPTS) savedefconfig
 
 # Target to copy back the configuration to the source configuration file
+# Even though we could use 'cp --preserve-timestamps' here, the separate
+# cp and 'touch --reference' is used for symmetry with $(1)-update-defconfig.
 $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done
-	cp --preserve=timestamps -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
 
 # Note: make sure the timestamp of the stored configuration is not newer than
 # the .config to avoid a useless rebuild. Note that, contrary to
-- 
1.9.1

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

* [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 03/10] kconfig infra: make update-config/defconfig handling symmetrical Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-14 15:35   ` Thomas Petazzoni
  2015-02-03 14:21 ` [Buildroot] [PATCH 05/10] kconfig infra: only provide foo-*config targets when the package is enabled Yann E. MORIN
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Some packages (like linux) may install things inside images/ as well, so
remove the associated stamp file after running the configuration editor.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 package/pkg-kconfig.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index f76c7a7..8e68315 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -71,7 +71,7 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_
 	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
 		$$($(2)_KCONFIG_OPTS) $$(subst $(1)-,,$$@)
 	rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built}
-	rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed
+	rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed
 
 $(1)-savedefconfig: $$($(2)_DIR)/.stamp_kconfig_fixup_done
 	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
-- 
1.9.1

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

* [Buildroot] [PATCH 05/10] kconfig infra: only provide foo-*config targets when the package is enabled
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 06/10] linux: qstrip the path to the custom configuration file Yann E. MORIN
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: "Yann E. Morin" <yann.morin.1998@free.fr>

Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
 package/pkg-kconfig.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index 8e68315..04ac37d 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -66,6 +66,12 @@ $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
 # Before running configure, the configuration file should be present and fixed
 $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 
+# Only enable the foo-*config targets when the package is actually enabled.
+# Note: the variable $(2)_KCONFIG_VAR is not related to the kconfig
+# infrastructure, but defined by pkg-generic.mk. The generic infrastructure is
+# already called above, so we can effectively use this variable.
+ifeq ($$($$($(2)_KCONFIG_VAR)),y)
+
 # Configuration editors (menuconfig, ...)
 $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
@@ -92,6 +98,8 @@ $(1)-update-defconfig: $(1)-savedefconfig
 	cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE)
 	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
 
+endif # package enabled
+
 endef # inner-kconfig-package
 
 ################################################################################
-- 
1.9.1

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

* [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig)
@ 2015-02-03 14:21 Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 01/10] kconfig infra: support built-in config files Yann E. MORIN
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

Hello All!

This series is a collaborative work of Thomas DS and I to improve the
kconfig package infrastructure, so that it is able to handle both the
Linux kernel and the Barebox bootloader.

The first part of the series prepares the kconfig package infrastructure:
  - support config files bundled in the package
  - support defconfig files
  - hide kconfig-related targets when the package is disabled

Then it prepares the Linux package for being migrated to use the kconfig
package infrastructure, plus a little extra to ease collaborative work:
  - qstrip the path to the custom (def)config file
  - do the actual migration
  - do not store absolute path for the initramfs source tree

Eventually, it switches Barebox to using the package infrastructure as
well:
  - qstrip the path to the custom (def)config file
  - do the actual migration


Regards,
Yann E. MORIN.


The following changes since commit 088ca7f95988bc846f224e43b2a5e11fa6113334:

  mjpegtools: add optional support for png/sdl/sdl_gfx/X11/gtk2 (2015-02-03 14:23:09 +0100)

are available in the git repository at:

  git://git.busybox.net/~ymorin/git/buildroot yem/pdp/kconfig

for you to fetch changes up to ea421877479d951601ffcf49fd5bce2d9d4f96b5:

  barebox: migrate to the kconfig infrastructure (2015-02-03 15:05:05 +0100)

----------------------------------------------------------------
Thomas De Schampheleire (9):
      kconfig infra: support built-in config files
      kconfig infra: add support for defconfig files
      kconfig infra: make update-config/defconfig handling symmetrical
      kconfig infra: remove all install stamp files
      linux: qstrip the path to the custom configuration file
      linux: migrate to the kconfig infrastructure
      linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
      barebox: qstrip the path to the custom configuration file
      barebox: migrate to the kconfig infrastructure

Yann E. Morin (1):
      kconfig infra: only provide foo-*config targets when the package is enabled

 boot/barebox/barebox.mk | 35 ++++++-----------------------------
 linux/linux.mk          | 42 ++++++++++++------------------------------
 package/pkg-kconfig.mk  | 38 +++++++++++++++++++++++++++++++++++---
 3 files changed, 53 insertions(+), 62 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 06/10] linux: qstrip the path to the custom configuration file
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (4 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 05/10] kconfig infra: only provide foo-*config targets when the package is enabled Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 07/10] linux: migrate to the kconfig infrastructure Yann E. MORIN
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Even though this is not strictly necessary with the current version of
linux.mk, it becomes necessary when migrating linux.mk to the kconfig
infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 linux/linux.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index 29f59e8..a321fa7 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -171,7 +171,7 @@ LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES
 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)
+KERNEL_SOURCE_CONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
 endif
 
 define LINUX_CONFIGURE_CMDS
-- 
1.9.1

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

* [Buildroot] [PATCH 07/10] linux: migrate to the kconfig infrastructure
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (5 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 06/10] linux: qstrip the path to the custom configuration file Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE Yann E. MORIN
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Migrate the linux package to the kconfig infrastructure.
A notable change compared to the original behavior:

- the targets linux-update-(def)config are now always saving the config
  file, even for a defconfig bundled in the linux sources. This is done
  to keep the kconfig infrastructure simple.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 linux/linux.mk | 36 ++++++++----------------------------
 1 file changed, 8 insertions(+), 28 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index a321fa7..86dd1ee 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -55,6 +55,8 @@ LINUX_MAKE_FLAGS = \
 	CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
 	DEPMOD=$(HOST_DIR)/sbin/depmod
 
+LINUX_MAKE_ENV = $(TARGET_MAKE_ENV)
+
 # Get the real Linux version, which tells us where kernel modules are
 # going to be installed in the target filesystem.
 LINUX_VERSION_PROBED = $(shell $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease)
@@ -174,10 +176,11 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
 endif
 
-define LINUX_CONFIGURE_CMDS
-	$(INSTALL) -m 0644 $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
-	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
-	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
+LINUX_KCONFIG_FILE = $(KERNEL_SOURCE_CONFIG)
+LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
+LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS)
+
+define LINUX_KCONFIG_FIXUP_CMDS
 	$(if $(BR2_arm)$(BR2_armeb),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
 	$(if $(BR2_TARGET_ROOTFS_CPIO),
@@ -222,7 +225,6 @@ define LINUX_CONFIGURE_CMDS
 		$(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK_MARK,$(@D)/.config))
 	$(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
-	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
 endef
 
 ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
@@ -319,29 +321,7 @@ endef
 
 include $(sort $(wildcard linux/linux-ext-*.mk))
 
-$(eval $(generic-package))
-
-ifeq ($(BR2_LINUX_KERNEL),y)
-linux-menuconfig linux-xconfig linux-gconfig linux-nconfig: linux-configure
-	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
-		$(subst linux-,,$@)
-	rm -f $(LINUX_DIR)/.stamp_{built,target_installed,images_installed}
-
-linux-savedefconfig: linux-configure
-	$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
-		$(subst linux-,,$@)
-
-ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
-linux-update-config: linux-configure $(LINUX_DIR)/.config
-	cp -f $(LINUX_DIR)/.config $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
-
-linux-update-defconfig: linux-savedefconfig
-	cp -f $(LINUX_DIR)/defconfig $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
-else
-linux-update-config: ;
-linux-update-defconfig: ;
-endif
-endif
+$(eval $(kconfig-package))
 
 # Support for rebuilding the kernel after the cpio archive has
 # been generated in $(BINARIES_DIR)/rootfs.cpio.
-- 
1.9.1

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

* [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (6 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 07/10] linux: migrate to the kconfig infrastructure Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-14 16:36   ` Thomas Petazzoni
  2015-02-03 14:21 ` [Buildroot] [PATCH 09/10] barebox: qstrip the path to the custom configuration file Yann E. MORIN
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

When Buildroot is configured to append the root filesystem to the Linux
kernel as initramfs, Buildroot sets the path to the initramfs source
dynamically in the Linux configuration file.

As this path is specified as an absolute path, typically being different
for different users of the same project (e.g. containing a username),
saving the configuration to a version control system (for example using
'make linux-update-defconfig') would result in a difference for this
path at every invocation by a different user.
Although this is technically not an issue, it is confusing that this
generates a difference.

Address this issue by using a not-yet-expanded make variable to specify
the path to the initramfs source. That variable will be expanded by the
Linux build system, which uses it both as a Makefile variable and a
shell variable; thus, it needs to be specified in LINUX_MAKE_ENV (so
it is exported and available in sub-processes of make).  Any saved
configuration file would simply contain the reference to the
not-yet-expanded variable.

As in the Linux build system, the config variables are both read from
make as from a shell script, we cannot use $() syntax as this would be
interpreted as a command invocation by the shell. Instead, use ${}
syntax which is interpreted as variable reference both by the shell as
by make.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 linux/linux.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index 86dd1ee..0e09269 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -55,7 +55,9 @@ LINUX_MAKE_FLAGS = \
 	CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
 	DEPMOD=$(HOST_DIR)/sbin/depmod
 
-LINUX_MAKE_ENV = $(TARGET_MAKE_ENV)
+LINUX_MAKE_ENV = \
+	$(TARGET_MAKE_ENV) \
+	BR_BINARIES_DIR=$(BINARIES_DIR)
 
 # Get the real Linux version, which tells us where kernel modules are
 # going to be installed in the target filesystem.
@@ -191,7 +193,7 @@ define LINUX_KCONFIG_FIXUP_CMDS
 	# rebuilt using the linux-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$(BINARIES_DIR)/rootfs.cpio",$(@D)/.config)
+		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$${BR_BINARIES_DIR}/rootfs.cpio",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,
-- 
1.9.1

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

* [Buildroot] [PATCH 09/10] barebox: qstrip the path to the custom configuration file
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (7 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-03 14:21 ` [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure Yann E. MORIN
  2015-02-14 16:33 ` [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Thomas Petazzoni
  10 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Even though this is not strictly necessary with the current version
of barebox.mk, it becomes necessary when migrating barebox.mk to the
kconfig infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 boot/barebox/barebox.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index 0fb7cec..f26c151 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -55,7 +55,7 @@ ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
 BAREBOX_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
 	$(BR2_TARGET_BAREBOX_BOARD_DEFCONFIG))_defconfig
 else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
-BAREBOX_SOURCE_CONFIG = $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE)
+BAREBOX_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
 endif
 
 define BAREBOX_CONFIGURE_CMDS
-- 
1.9.1

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

* [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (8 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 09/10] barebox: qstrip the path to the custom configuration file Yann E. MORIN
@ 2015-02-03 14:21 ` Yann E. MORIN
  2015-02-14 16:37   ` Thomas Petazzoni
  2015-02-14 16:33 ` [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Thomas Petazzoni
  10 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2015-02-03 14:21 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
---
 boot/barebox/barebox.mk | 33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk
index f26c151..56d545a 100644
--- a/boot/barebox/barebox.mk
+++ b/boot/barebox/barebox.mk
@@ -49,7 +49,7 @@ endif
 
 BAREBOX_MAKE_FLAGS = ARCH=$(BAREBOX_ARCH) CROSS_COMPILE="$(CCACHE) \
 	$(TARGET_CROSS)"
-
+BAREBOX_MAKE_ENV = $(TARGET_MAKE_ENV)
 
 ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
 BAREBOX_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\
@@ -58,12 +58,9 @@ else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
 BAREBOX_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE))
 endif
 
-define BAREBOX_CONFIGURE_CMDS
-	cp $(BAREBOX_SOURCE_CONFIG) \
-		$(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig
-	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) \
-		buildroot_defconfig
-endef
+BAREBOX_KCONFIG_FILE = $(BAREBOX_SOURCE_CONFIG)
+BAREBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
+BAREBOX_KCONFIG_OPTS = $(BAREBOX_MAKE_FLAGS)
 
 ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y)
 define BAREBOX_BUILD_BAREBOXENV_CMDS
@@ -106,7 +103,7 @@ define BAREBOX_INSTALL_TARGET_CMDS
 endef
 endif
 
-$(eval $(generic-package))
+$(eval $(kconfig-package))
 
 ifeq ($(BR2_TARGET_BAREBOX),y)
 # we NEED a board defconfig file unless we're at make source
@@ -115,24 +112,4 @@ ifeq ($(BAREBOX_SOURCE_CONFIG),)
 $(error No Barebox config file. Check your BR2_TARGET_BAREBOX_BOARD_DEFCONFIG or BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE settings)
 endif
 endif
-
-barebox-menuconfig barebox-xconfig barebox-gconfig barebox-nconfig: barebox-configure
-	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(BAREBOX_DIR) \
-		$(subst barebox-,,$@)
-	rm -f $(BAREBOX_DIR)/.stamp_{built,target_installed,images_installed}
-
-barebox-savedefconfig: barebox-configure
-	$(TARGET_MAKE_ENV) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(BAREBOX_DIR) \
-		$(subst barebox-,,$@)
-
-ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y)
-barebox-update-config: barebox-configure $(BAREBOX_DIR)/.config
-	cp -f $(BAREBOX_DIR)/.config $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE)
-
-barebox-update-defconfig: barebox-savedefconfig
-	cp -f $(BAREBOX_DIR)/defconfig $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE)
-else
-barebox-update-config: ;
-barebox-update-defconfig: ;
-endif
 endif
-- 
1.9.1

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

* [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files
  2015-02-03 14:21 ` [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files Yann E. MORIN
@ 2015-02-14 15:35   ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2015-02-14 15:35 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Tue,  3 Feb 2015 15:21:44 +0100, Yann E. MORIN wrote:

>  	rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built}
> -	rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed
> +	rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed

Maybe this could reuse the $(1)-clean-for-reconfigure target in order
to avoid duplicating this code removing the stamp files, no?

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

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

* [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig)
  2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
                   ` (9 preceding siblings ...)
  2015-02-03 14:21 ` [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure Yann E. MORIN
@ 2015-02-14 16:33 ` Thomas Petazzoni
  10 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2015-02-14 16:33 UTC (permalink / raw)
  To: buildroot

Yann, Thomas,

On Tue,  3 Feb 2015 15:21:46 +0100, Yann E. MORIN wrote:

> Thomas De Schampheleire (9):
>       kconfig infra: support built-in config files
>       kconfig infra: add support for defconfig files
>       kconfig infra: make update-config/defconfig handling symmetrical
>       kconfig infra: remove all install stamp files
>       linux: qstrip the path to the custom configuration file
>       linux: migrate to the kconfig infrastructure
>       linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
>       barebox: qstrip the path to the custom configuration file
>       barebox: migrate to the kconfig infrastructure
> 
> Yann E. Morin (1):
>       kconfig infra: only provide foo-*config targets when the package is enabled

Series applied to next. I've done some changes on two patches: I'll
comment directly on the relevant patches.

Thanks!

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

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

* [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
  2015-02-03 14:21 ` [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE Yann E. MORIN
@ 2015-02-14 16:36   ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2015-02-14 16:36 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Tue,  3 Feb 2015 15:21:48 +0100, Yann E. MORIN wrote:
> From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
> 
> When Buildroot is configured to append the root filesystem to the Linux
> kernel as initramfs, Buildroot sets the path to the initramfs source
> dynamically in the Linux configuration file.
> 
> As this path is specified as an absolute path, typically being different
> for different users of the same project (e.g. containing a username),
> saving the configuration to a version control system (for example using
> 'make linux-update-defconfig') would result in a difference for this
> path at every invocation by a different user.
> Although this is technically not an issue, it is confusing that this
> generates a difference.
> 
> Address this issue by using a not-yet-expanded make variable to specify
> the path to the initramfs source. That variable will be expanded by the
> Linux build system, which uses it both as a Makefile variable and a
> shell variable; thus, it needs to be specified in LINUX_MAKE_ENV (so
> it is exported and available in sub-processes of make).  Any saved
> configuration file would simply contain the reference to the
> not-yet-expanded variable.
> 
> As in the Linux build system, the config variables are both read from
> make as from a shell script, we cannot use $() syntax as this would be
> interpreted as a command invocation by the shell. Instead, use ${}
> syntax which is interpreted as variable reference both by the shell as
> by make.

At first, I was a bit dubious, because it now means that if one wants
to re-use the Buildroot generated Linux kernel config file outside of
Buildroot, (s)he has to remember to define this BR_BINARIES_DIR
variable. But since this use-case is probably not that frequent, I got
convinced by Yann that this patch makes versioning the kernel config
file nicer.

There was an implementation bug though. See below.


> -LINUX_MAKE_ENV = $(TARGET_MAKE_ENV)
> +LINUX_MAKE_ENV = \
> +	$(TARGET_MAKE_ENV) \
> +	BR_BINARIES_DIR=$(BINARIES_DIR)

Defining $(LINUX_MAKE_ENV) is call, but you have to use it at some
point. The linux.mk makefile was using $(TARGET_MAKE_ENV) everywhere,
so I've used $(LINUX_MAKE_ENV) instead before applying. Without this,
an initramfs-enabled kernel was not building, since the BR_BINARIES_DIR
variable value was not passed.

Thanks,

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

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

* [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure
  2015-02-03 14:21 ` [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure Yann E. MORIN
@ 2015-02-14 16:37   ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2015-02-14 16:37 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Tue,  3 Feb 2015 15:21:50 +0100, Yann E. MORIN wrote:

>  ifeq ($(BR2_TARGET_BAREBOX_USE_DEFCONFIG),y)
>  BAREBOX_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,\

This $(@D) was causing problems: Barebox was being constantly rebuilt,
because '/arch/arm/configs/<foobar>_defconfig' does not exist. This is
because $(@D) does not exist at this point.

I've instead used $(BAREBOX_DIR), just like the Linux kernel uses
$(LINUX_DIR). This solved the problem.

Thanks,

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

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

end of thread, other threads:[~2015-02-14 16:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 14:21 [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 01/10] kconfig infra: support built-in config files Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 02/10] kconfig infra: add support for defconfig files Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 03/10] kconfig infra: make update-config/defconfig handling symmetrical Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 04/10] kconfig infra: remove all install stamp files Yann E. MORIN
2015-02-14 15:35   ` Thomas Petazzoni
2015-02-03 14:21 ` [Buildroot] [PATCH 05/10] kconfig infra: only provide foo-*config targets when the package is enabled Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 06/10] linux: qstrip the path to the custom configuration file Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 07/10] linux: migrate to the kconfig infrastructure Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 08/10] linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE Yann E. MORIN
2015-02-14 16:36   ` Thomas Petazzoni
2015-02-03 14:21 ` [Buildroot] [PATCH 09/10] barebox: qstrip the path to the custom configuration file Yann E. MORIN
2015-02-03 14:21 ` [Buildroot] [PATCH 10/10] barebox: migrate to the kconfig infrastructure Yann E. MORIN
2015-02-14 16:37   ` Thomas Petazzoni
2015-02-14 16:33 ` [Buildroot] [PATCH 0/10] kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig) Thomas Petazzoni

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