vmware-modules-279.6.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic linux-info linux-mod user versionator udev
  5. PV_MAJOR=$(get_major_version)
  6. PV_MINOR=$(get_version_component_range 2)
  7. DESCRIPTION="VMware kernel modules"
  8. HOMEPAGE="http://www.vmware.com/"
  9. SRC_URI=""
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="pax_kernel +vmci +vsock"
  14. RDEPEND=""
  15. DEPEND="${RDEPEND}
  16. || ( =app-emulation/vmware-player-6.0.${PV_MINOR}*
  17. =app-emulation/vmware-workstation-10.0.${PV_MINOR}* )"
  18. S=${WORKDIR}
  19. pkg_setup() {
  20. CONFIG_CHECK="~HIGH_RES_TIMERS"
  21. if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
  22. CONFIG_CHECK="${CONFIG_CHECK} BKL"
  23. fi
  24. if use vmci ; then
  25. CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI"
  26. else
  27. CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI"
  28. fi
  29. if use vsock ; then
  30. CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS"
  31. else
  32. CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS"
  33. fi
  34. linux-info_pkg_setup
  35. linux-mod_pkg_setup
  36. VMWARE_GROUP=${VMWARE_GROUP:-vmware}
  37. VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock"
  38. VMWARE_MODULE_LIST="vmblock vmmon vmnet"
  39. use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci"
  40. use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock"
  41. VMWARE_MOD_DIR="${PN}-${PVR}"
  42. BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
  43. enewgroup "${VMWARE_GROUP}"
  44. filter-flags -mfpmath=sse -mavx -mpclmul -maes
  45. for mod in ${VMWARE_MODULE_LIST}; do
  46. MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
  47. done
  48. }
  49. src_unpack() {
  50. cd "${S}"
  51. for mod in ${VMWARE_MODULE_LIST_ALL}; do
  52. tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
  53. done
  54. }
  55. src_prepare() {
  56. epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
  57. epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
  58. epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
  59. use pax_kernel && epatch "${FILESDIR}/279-hardened.patch"
  60. epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
  61. kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
  62. kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch"
  63. kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.10-00-userns.patch"
  64. kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-getname.patch"
  65. #kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-deprecated.patch"
  66. kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-04-dentry.patch"
  67. kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-05-inode.patch"
  68. kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
  69. kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-readlink.patch"
  70. kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-01-vsock.patch"
  71. kernel_is ge 3 17 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.17-00-netdev.patch"
  72. kernel_is ge 3 18 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.18-00-version-redefined.patch"
  73. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-compat-namei.patch"
  74. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-dentry.patch"
  75. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmblock-path.patch"
  76. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-iovec.patch"
  77. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-iovec.patch"
  78. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vmci_qpair.patch"
  79. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vsock.patch"
  80. kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-07-vsock.patch"
  81. kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.2-00-cookie.patch"
  82. # Allow user patches so they can support RC kernels and whatever else
  83. epatch_user
  84. }
  85. src_install() {
  86. linux-mod_src_install
  87. local udevrules="${T}/60-vmware.rules"
  88. cat > "${udevrules}" <<-EOF
  89. KERNEL=="vmci", GROUP="vmware", MODE="660"
  90. KERNEL=="vmw_vmci", GROUP="vmware", MODE="660"
  91. KERNEL=="vmmon", GROUP="vmware", MODE="660"
  92. KERNEL=="vsock", GROUP="vmware", MODE="660"
  93. EOF
  94. udev_dorules "${udevrules}"
  95. }