commit:     fd38ac4fb57ca9bc95ab9511c6948d326bdf48de
Author:     Daniel Robbins <drobbins <AT> funtoo <DOT> org>
AuthorDate: Sun Nov 12 03:24:10 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Nov 15 03:05:17 2017 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=fd38ac4f

Add --hyperv option for Microsoft Hyper-V. Enable within kernel image to ensure 
modules are available early at boot.

 doc/genkernel.8.txt  |  3 +++
 gen_cmdline.sh       |  8 +++++++-
 gen_configkernel.sh  | 15 +++++++++++++++
 gen_determineargs.sh |  1 +
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index a0c638e..7c653eb 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -303,6 +303,9 @@ INITIALIZATION
 *--*[*no-*]*iscsi*::
     Includes or excludes iSCSI support
 
+*--*[*no-*]*hyperv*::
+    Includes or excludes Microsoft Hyper-V support
+
 *--*[*no-*]*ssh*::
     Includes or excludes SSH (dropbear) support for remote LUKS keys.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 83b3829..1091d4d 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -114,7 +114,9 @@ longusage() {
   echo "       --no-multipath  Exclude Multipath support"
   echo "       --iscsi                 Include iSCSI support"
   echo "       --no-iscsi              Exclude iSCSI support"
-  echo "       --ssh           Include SSH (dropbear) support"
+  echo "       --hyperv                Include Microsoft Hyper-V support"
+  echo "       --no-hyperv             Exclude Microsoft Hyper-V support"
+  echo "       --ssh                   Include SSH (dropbear) support"
   echo "       --no-ssh                Exclude SSH (dropbear) support"
   echo "       --bootloader=grub       Add new kernel to GRUB configuration"
   echo "       --linuxrc=<file>        Specifies a user created linuxrc"
@@ -404,6 +406,10 @@ parse_cmdline() {
                        CMD_ISCSI=`parse_optbool "$*"`
                        print_info 2 "CMD_ISCSI: ${CMD_ISCSI}"
                        ;;
+               --hyperv|--no-hyperv)
+                       CMD_ISCSI=`parse_optbool "$*"`
+                       print_info 2 "CMD_HYPERV: ${CMD_HYPERV}"
+                       ;;
                --ssh|--no-ssh)
                        CMD_SSH=`parse_optbool "$*"`
                        print_info 2 "CMD_SSH: ${CMD_SSH}"

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 26e4610..697c478 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -219,6 +219,21 @@ config_kernel() {
                kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_SCSI_ISCSI_ATTRS" "${cfg_CONFIG_SCSI_ISCSI_ATTRS}"
        fi
 
+       # Make sure HyperV modules are enabled in the kernel, if --hyperv
+       if isTrue ${CMD_HYPERV}
+       then
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV" 
"y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HYPERV_UTILS" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HYPERV_BALLOON" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HYPERV_STORAGE" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HYPERV_NET" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HYPERV_KEYBOARD" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_PCI_HYPERV" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_FB_HYPERV" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_HID_HYPERV_MOUSE" "y"
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_UIO_HV_GENERIC" "y"
+       fi
+
        if isTrue ${SPLASH}
        then
                kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_FB_SPLASH" "y"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index fe9f85b..b686fca 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -118,6 +118,7 @@ determine_real_args() {
        set_config_with_override BOOL   LVM                  CMD_LVM
        set_config_with_override BOOL   DMRAID               CMD_DMRAID
        set_config_with_override BOOL   ISCSI                CMD_ISCSI
+       set_config_with_override BOOL   HYPERV               CMD_HYPERV
        set_config_with_override BOOL   BUSYBOX              CMD_BUSYBOX        
      "yes"
        set_config_with_override BOOL   NFS                  CMD_NFS            
      "yes"
        set_config_with_override BOOL   MICROCODE            CMD_MICROCODE

Reply via email to