kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig)
cover kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig)
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(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/10 kconfig infra: support built-in config files
From: Thomas De Schampheleire <[email protected]>
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).
--- package/pkg-kconfig.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
package/pkg-kconfig.mk +5 -1
@@ -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.
Signature · 1 line
1.9.1
PATCH 2/10 kconfig infra: add support for defconfig files
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- package/pkg-kconfig.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
package/pkg-kconfig.mk +17 -0
@@ -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 ################################################################################
Signature · 1 line
1.9.1
PATCH 3/10 kconfig infra: make update-config/defconfig handling symmetrical
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- package/pkg-kconfig.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
package/pkg-kconfig.mk +4 -1
@@ -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
Signature · 1 line
1.9.1
PATCH 4/10 kconfig infra: remove all install stamp files
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
Some packages (like linux) may install things inside images/ as well, so remove the associated stamp file after running the configuration editor.
--- package/pkg-kconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-kconfig.mk +1 -1
@@ -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) \
Signature · 1 line
1.9.1
PATCH 4/10 kconfig infra: remove all install stamp files
Dear Yann E. MORIN,
package/pkg-kconfig.mk $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_ · line 74
Quoted 3 lines · Yann E. MORIN
package/pkg-kconfig.mk +1
-1rm -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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 5/10 kconfig infra: only provide foo-*config targets when the package is enabled
In reply to Yann E. MORINFrom: "Yann E. Morin" <[email protected]>
--- package/pkg-kconfig.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
package/pkg-kconfig.mk +8 -0
@@ -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 ################################################################################
Signature · 1 line
1.9.1
PATCH 6/10 linux: qstrip the path to the custom configuration file
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- linux/linux.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux/linux.mk +1 -1
@@ -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
Signature · 1 line
1.9.1
PATCH 7/10 linux: migrate to the kconfig infrastructure
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- linux/linux.mk | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-)
linux/linux.mk +8 -28
@@ -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.
Signature · 1 line
1.9.1
PATCH 8/10 linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- linux/linux.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
linux/linux.mk +4 -2
@@ -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),,
Signature · 1 line
1.9.1
PATCH 8/10 linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
Dear Yann E. MORIN,
Quoted 22 lines · Yann E. MORIN
From: Thomas De Schampheleire <[email protected]>
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
Makefilevariable and a shell variable; thus, it needs to be specified inLINUX_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.
Quoted 5 lines
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/linux.mk LINUX_MAKE_FLAGS = \ · line 60
Quoted 4 lines
linux/linux.mk +3
-1-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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 9/10 barebox: qstrip the path to the custom configuration file
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
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.
--- boot/barebox/barebox.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/barebox/barebox.mk +1 -1
@@ -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
Signature · 1 line
1.9.1
PATCH 10/10 barebox: migrate to the kconfig infrastructure
In reply to Yann E. MORINFrom: Thomas De Schampheleire <[email protected]>
--- boot/barebox/barebox.mk | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-)
boot/barebox/barebox.mk +5 -28
@@ -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
Signature · 1 line
1.9.1
PATCH 10/10 barebox: migrate to the kconfig infrastructure
Dear Yann E. MORIN,
Quoted 2 lines · Yann E. MORIN
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
cover kconfig infra: enhancements, and more packages migrated (branch yem/pdp/kconfig)
In reply to Yann E. MORINYann, Thomas,
Quoted 11 lines · Yann E. MORIN
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 forINITRAMFS_SOURCE
barebox: qstrip the path to the custom configuration file
barebox: migrate to the kconfig infrastructure
Quoted 2 lines
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com