Re: [PATCH 2/3] x86, platform, xen, kconfig: add xen defconfig helper

From: David Rientjes
Date: Sat Jun 07 2014 - 05:11:40 EST


On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:

> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 37621ac..9db34e2 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -256,6 +256,12 @@ kvmconfig:
> $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
> $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
>
> +PHONY += xenconfig
> +xenconfig:
> + $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
> + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/xen.config
> + $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> +
> define archhelp
> echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
> echo ' install - Install kernel using'
> @@ -270,4 +276,5 @@ define archhelp
> echo ' FDARGS="..." arguments for the booted kernel'
> echo ' FDINITRD=file initrd for the booted kernel'
> echo ' kvmconfig - Enable additional options for kvm guest kernel support'
> + echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
> endef

I suppose it would be easier to generalize the functionality and do
something like this instead since the two are otherwise identical:

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -250,11 +250,19 @@ archclean:
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=arch/x86/tools

+define build-virtconfig
+$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
+$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/$(1)
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+endef
+
PHONY += kvmconfig
kvmconfig:
- $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
- $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
- $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+ $(call build-virtconfig,kvm_guest.config)
+
+PHONY += xenconfig
+xenconfig:
+ $(call build-virtconfig,xen.config)

define archhelp
echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/