check_kconfig.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Linux 2.6.32 and later Kernel module for VMware MVP PVTCP Server
  3. *
  4. * Copyright (C) 2010-2013 VMware, Inc. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; see the file COPYING. If not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. #line 5
  20. /**
  21. * @file
  22. * @brief Check for required kernel configuration
  23. *
  24. * Check to make sure that the kernel options that the MVP hypervisor requires
  25. * have been enabled in the kernel that this kernel module is being built
  26. * against.
  27. */
  28. #include <linux/version.h>
  29. /*
  30. * Minimum kernel version
  31. */
  32. #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
  33. #error "MVP requires a host kernel newer than 3.0.0"
  34. #endif
  35. /* module loading ability */
  36. #ifndef CONFIG_MODULES
  37. #error "MVP requires kernel loadable module support be enabled " \
  38. "(CONFIG_MODULES)"
  39. #endif
  40. #ifndef CONFIG_MODULE_UNLOAD
  41. #error "MVP requires kernel module unload support be enabled " \
  42. "(CONFIG_MODULE_UNLOAD)"
  43. #endif
  44. /* sysfs */
  45. #ifndef CONFIG_SYSFS
  46. #error "MVP requires sysfs support (CONFIG_SYSFS)"
  47. #endif
  48. /* network traffic isolation */
  49. #ifndef CONFIG_NAMESPACES
  50. #error "MVP requires namespace support (CONFIG_NAMESPACES)"
  51. #endif
  52. #ifndef CONFIG_NET_NS
  53. #error "MVP requires network namespace support (CONFIG_NET_NS)"
  54. #endif
  55. /* TCP/IP networking */
  56. #ifndef CONFIG_INET
  57. #error "MVP requires IPv4 support (CONFIG_INET)"
  58. #endif
  59. #ifndef CONFIG_IPV6
  60. #error "MVP requires IPv6 support (CONFIG_IPV6)"
  61. #endif
  62. /* VPN support */
  63. #if !defined(CONFIG_TUN) && !defined(CONFIG_TUN_MODULE)
  64. #error "MVP VPN support requires TUN device support (CONFIG_TUN)"
  65. #endif
  66. #if !defined(CONFIG_NETFILTER) && !defined(PVTCP_DISABLE_NETFILTER)
  67. #error "MVP requires netfilter support (CONFIG_NETFILTER)"
  68. #endif
  69. /* Force /proc/config.gz support for eng/userdebug builds */
  70. #ifdef MVP_DEBUG
  71. #if !defined(CONFIG_IKCONFIG) || !defined(CONFIG_IKCONFIG_PROC)
  72. #error "MVP_DEBUG requires /proc/config.gz support (CONFIG_IKCONFIG_PROC)"
  73. #endif
  74. #endif
  75. /* Sanity check we're only dealing with the memory hotplug + migrate and/or
  76. * compaction combo */
  77. #ifdef CONFIG_MIGRATION
  78. #if defined(CONFIG_NUMA) || defined(CONFIG_CPUSETS) || \
  79. defined(CONFIG_MEMORY_FAILURE)
  80. #error "MVP not tested with migration features other than " \
  81. "CONFIG_MEMORY_HOTPLUG and CONFIG_COMPACTION"
  82. #endif
  83. #endif