Bug #432956: Easy to include VirtIO support in kernel.
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 14 Oct 2012 00:05:16 +0000 (00:05 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Sun, 14 Oct 2012 00:05:16 +0000 (00:05 +0000)
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
ChangeLog
gen_cmdline.sh
gen_configkernel.sh
gen_determineargs.sh

index 95b25a497a86df949c255a44eda63324b2a40486..85749ddf03063202fc36f61e6e85d9e00af87f34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  14 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> gen_cmdline.sh,
+  gen_configkernel.sh, gen_determineargs.sh:
+  Bug #432956: Easy to include VirtIO support in kernel.
+
   13 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> arch/alpha/modules_load,
   arch/arm/modules_load, arch/ia64/modules_load, arch/mips/modules_load,
   arch/parisc/modules_load, arch/parisc64/modules_load, arch/ppc/modules_load,
index 858b850d3a77472468904e80b2626efc12648308..5503bb56abcc866ba4e457baed2603755e0a76ad 100755 (executable)
@@ -31,6 +31,7 @@ longusage() {
   echo "       --no-xconfig            Don't run xconfig after oldconfig"
   echo "       --save-config           Save the configuration to /etc/kernels"
   echo "       --no-save-config        Don't save the configuration to /etc/kernels"
+  echo "       --virtio                        Include VirtIO kernel code"
   echo "  Kernel Compile settings"
   echo "       --oldconfig             Implies --no-clean and runs a 'make oldconfig'"
   echo "       --clean                 Run make clean before compilation"
@@ -321,6 +322,10 @@ parse_cmdline() {
                        CMD_ZFS=`parse_optbool "$*"`
                        print_info 2 "CMD_ZFS: ${CMD_ZFS}"
                        ;;
+               --virtio)
+                       CMD_VIRTIO=`parse_optbool "$*"`
+                       print_info 2 "CMD_VIRTIO: ${CMD_VIRTIO}"
+                       ;;
                --multipath|--no-multipath)
                        CMD_MULTIPATH=`parse_optbool "$*"`
                        if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ]
index b546db10f379be687e082d747714d97a0658b980..a69c7130fb421ce62c164be89c953d7a51fa9835 100755 (executable)
@@ -147,4 +147,17 @@ config_kernel() {
        then
                sed -i ${KERNEL_OUTPUTDIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'
        fi
+       
+       # VirtIO
+       if isTrue ${CMD_VIRTIO} 
+       then 
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_PARAVIRT_GUEST.*/CONFIG_PARAVIRT_GUEST=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_PCI.*/CONFIG_VIRTIO_PCI=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_BALLOON.*/CONFIG_VIRTIO_BALLOON=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_MMIO.*/CONFIG_VIRTIO_MMIO=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_BLK.*/CONFIG_VIRTIO_BLK=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SCSI_VIRTIO.*/CONFIG_SCSI_VIRTIO=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g'
+               sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g'
+       fi 
 }
index eb822b30aa2dda2bbb90b113c339f0e75a64c5a1..c3756d286b77dafaa1dea0d9e556d286417c552d 100755 (executable)
@@ -125,6 +125,7 @@ determine_real_args() {
        set_config_with_override STRING MDADM_CONFIG         CMD_MDADM_CONFIG
        set_config_with_override BOOL   E2FSPROGS            CMD_E2FSPROGS            "no"
        set_config_with_override BOOL   ZFS                  CMD_ZFS
+       set_config_with_override BOOL   VIRTIO               CMD_VIRTIO                           "no"
        set_config_with_override BOOL   MULTIPATH            CMD_MULTIPATH
        set_config_with_override BOOL   FIRMWARE             CMD_FIRMWARE
        set_config_with_override STRING FIRMWARE_DIR         CMD_FIRMWARE_DIR         "/lib/firmware"