[PATCH] config: Add 'make kvmconfig'

Sasha Levin
2011-10-27T12:07:24Z

This patch adds 'make kvmconfig' which allows to add KVM guest support
to a config file.

This allows for easier testing of configurations under virtualized
environments.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---

Updated sym list to include everything required when starting from
'make allnoconfig' plus KGDB support.

arch/x86/Kconfig | 27 +++++++++++++++++++++++++++
scripts/kconfig/Makefile | 6 +++++-
2 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6a47bb2..0b74528 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -520,6 +520,33 @@ config SCHED_OMIT_FRAME_POINTER

If in doubt, say "Y".

+config KVMTOOL_TEST_ENABLE
+ bool "Enable options to create a bootable tools/kvm/ kernel"
+ select NET
+ select NETDEVICES
+ select PCI
+ select BLK_DEV
+ select NETWORK_FILESYSTEMS
+ select INET
+ select EXPERIMENTAL
+ select SERIAL_8250
+ select SERIAL_8250_CONSOLE
+ select IP_PNP
+ select IP_PNP_DHCP
+ select BINFMT_ELF
+ select PCI_MSI
+ select KGDB
+ select KGDB_SERIAL_CONSOLE
+ select VIRTIO
+ select VIRTIO_RING
+ select VIRTIO_PCI
+ select VIRTIO_BLK
+ select VIRTIO_CONSOLE
+ select VIRTIO_NET
+ select 9P_FS
+ select NET_9P
+ select NET_9P_VIRTIO
+
menuconfig PARAVIRT_GUEST
bool "Paravirtualized guest support"
---help---
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 82d2eb2..356e551 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -3,7 +3,7 @@
# These targets are used from top-level makefile

PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
- localmodconfig localyesconfig
+ localmodconfig localyesconfig kvmconfig

ifdef KBUILD_KCONFIG
Kconfig := $(KBUILD_KCONFIG)
@@ -33,6 +33,10 @@ silentoldconfig: $(obj)/conf
$(Q)mkdir -p include/generated
$< --$@ $(Kconfig)

+kvmconfig:
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/config -e KVMTOOL_TEST_ENABLE
+ @echo 'Kernel configuration modified to run as KVM guest.'
+
# if no path is given, then use src directory to find file
ifdef LSMOD
LSMOD_F := $(LSMOD)
--
1.7.7.1