SPECS/linux/linux-esx.spec
07878434
 %global security_hardening none
534cd4dc
 Summary:       Kernel
 Name:          linux-esx
115281cf
 Version:       4.4.20
c49b19f8
 Release:       6%{?dist}
534cd4dc
 License:       GPLv2
 URL:           http://www.kernel.org/
 Group:         System Environment/Kernel
07878434
 Vendor:        VMware, Inc.
534cd4dc
 Distribution:  Photon
115281cf
 Source0:       http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
 %define sha1 linux=67f6d0f7d8c90d7f9fe7c3e1ee4d82b008b77767
534cd4dc
 Source1:       config-esx-%{version}
5214ccfa
 Patch0:        double-tcp_mem-limits.patch
 Patch1:        linux-4.4-sysctl-sched_weighted_cpuload_uses_rla.patch
 Patch2:        linux-4.4-watchdog-Disable-watchdog-on-virtual-machines.patch
 Patch3:        SUNRPC-Do-not-reuse-srcport-for-TIME_WAIT-socket.patch
115281cf
 Patch4:        vmxnet3-1.4.6.0-update-rx-ring2-max-size.patch
5214ccfa
 Patch5:        01-clear-linux.patch
 Patch6:        02-pci-probe.patch
 Patch7:        03-poweroff.patch
 Patch8:        04-quiet-boot.patch
 Patch9:        05-pv-ops.patch
 Patch10:       06-sunrpc.patch
115281cf
 Patch11:       vmxnet3-1.4.6.0-avoid-calling-pskb_may_pull-with-interrupts-disabled.patch
aa91ef58
 #fixes CVE-2016-3135
45b023d0
 Patch12:       netfilter-x_tables-check-for-size-overflow.patch
 Patch13:       REVERT-sched-fair-Beef-up-wake_wide.patch
e123d083
 Patch14:       e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch
115281cf
 Patch15:       VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch
 Patch16:       vmxnet3-1.4.6.0-fix-lock-imbalance-in-vmxnet3_tq_xmit.patch
 Patch17:       vmxnet3-1.4.7.0-set-CHECKSUM_UNNECESSARY-for-IPv6-packets.patch
 Patch18:       vmxnet3-1.4.8.0-segCnt-can-be-1-for-LRO-packets.patch
 #fixes CVE-2016-0758
 Patch19:       keys-fix-asn.1-indefinite-length-object-parsing.patch
 Patch20:       vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch
 Patch21:       vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch
c49b19f8
 #fixes CVE-2016-8666
 Patch22:       ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch
 #fixes CVE-2016-8666
 Patch23:       tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch
115281cf
 BuildRequires: bc
534cd4dc
 BuildRequires: kbd
 BuildRequires: kmod
 BuildRequires: glib-devel
 BuildRequires: xerces-c-devel
 BuildRequires: xml-security-c-devel
 BuildRequires: libdnet
 BuildRequires: libmspack
 BuildRequires: Linux-PAM
 BuildRequires: openssl-devel
 BuildRequires: procps-ng-devel
 Requires:      filesystem kmod coreutils
07878434
 
 %description
a3c18b12
 The Linux kernel build for GOS for VMware hypervisor.
07878434
 
534cd4dc
 %package devel
 Summary:       Kernel Dev
 Group:         System Environment/Kernel
 Requires:      python2
 Requires:      %{name} = %{version}-%{release}
 %description devel
07878434
 The Linux package contains the Linux kernel dev files
 
 %package docs
534cd4dc
 Summary:       Kernel docs
 Group:         System Environment/Kernel
 Requires:      python2
 Requires:      %{name} = %{version}-%{release}
07878434
 %description docs
 The Linux package contains the Linux kernel doc files
 
 %prep
5214ccfa
 %setup -q -n linux-%{version}
c4e65aa5
 %patch0 -p1
07878434
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
b556c0a5
 %patch6 -p1
c4e65aa5
 %patch7 -p1
e20fa742
 %patch8 -p1
97a4ea30
 %patch9 -p1
d0c0e8c4
 %patch10 -p1
aa91ef58
 %patch11 -p1
 %patch12 -p1
45b023d0
 %patch13 -p1
e123d083
 %patch14 -p1
115281cf
 %patch15 -p1
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
 %patch19 -p1
 %patch20 -p1
 %patch21 -p1
c49b19f8
 %patch22 -p1
 %patch23 -p1
07878434
 
 %build
115281cf
 # patch vmw_balloon driver
 sed -i 's/module_init/late_initcall/' drivers/misc/vmw_balloon.c
 
07878434
 make mrproper
 cp %{SOURCE1} .config
 make LC_ALL= oldconfig
 make VERBOSE=1 KBUILD_BUILD_VERSION="1-photon" KBUILD_BUILD_HOST="photon" ARCH="x86_64" %{?_smp_mflags}
 
 %install
 install -vdm 755 %{buildroot}/etc
 install -vdm 755 %{buildroot}/boot
f728561a
 install -vdm 755 %{buildroot}%{_defaultdocdir}/linux-esx-%{version}
07878434
 install -vdm 755 %{buildroot}/etc/modprobe.d
534cd4dc
 install -vdm 755 %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}
07878434
 make INSTALL_MOD_PATH=%{buildroot} modules_install
115281cf
 cp -v arch/x86/boot/bzImage    %{buildroot}/boot/vmlinuz-esx-%{version}-%{release}
 cp -v System.map        %{buildroot}/boot/system.map-esx-%{version}-%{release}
 cp -v .config            %{buildroot}/boot/config-esx-%{version}-%{release}
f728561a
 cp -r Documentation/*        %{buildroot}%{_defaultdocdir}/linux-esx-%{version}
115281cf
 install -vdm 755 %{buildroot}/usr/lib/debug/lib/modules/%{version}-esx
 cp -v vmlinux %{buildroot}/usr/lib/debug/lib/modules/%{version}-esx/vmlinux-esx-%{version}-%{release}
a3c18b12
 
17ba709c
 # TODO: noacpi acpi=off noapic pci=conf1,nodomains pcie_acpm=off pnpacpi=off
34315282
 cat > %{buildroot}/boot/%{name}-%{version}-%{release}.cfg << "EOF"
fb6292b3
 # GRUB Environment Block
a3591eab
 photon_cmdline=init=/lib/systemd/systemd rcupdate.rcu_expedited=1 rw systemd.show_status=0 quiet noreplace-smp cpu_init_udelay=0 plymouth.enable=0
115281cf
 photon_linux=vmlinuz-esx-%{version}-%{release}
fb6292b3
 EOF
07878434
 
534cd4dc
 # cleanup dangling symlinks
 rm -f %{buildroot}/lib/modules/%{version}-esx/source
 rm -f %{buildroot}/lib/modules/%{version}-esx/build
 
 # create /use/src/linux-esx-headers-*/ content
5508a8d0
 find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs  sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}' copy
 find arch/x86/include include scripts -type f | xargs  sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}' copy
 find $(find arch/x86 -name include -o -name scripts -type d) -type f | xargs  sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}' copy
 find arch/x86/include Module.symvers include scripts -type f | xargs  sh -c 'cp --parents "$@" %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}' copy
534cd4dc
 
 # copy .config manually to be where it's expected to be
 cp .config %{buildroot}/usr/src/%{name}-headers-%{version}-%{release}
 # symling to the build folder
 ln -sf /usr/src/%{name}-headers-%{version}-%{release} %{buildroot}/lib/modules/%{version}-esx/build
115281cf
 find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
534cd4dc
 
34315282
 %post
 /sbin/depmod -aq %{version}-esx
 ln -sf %{name}-%{version}-%{release}.cfg /boot/photon.cfg
 
07878434
 %files
 %defattr(-,root,root)
115281cf
 /boot/system.map-esx-%{version}-%{release}
 /boot/config-esx-%{version}-%{release}
 /boot/vmlinuz-esx-%{version}-%{release}
34315282
 %config(noreplace) /boot/%{name}-%{version}-%{release}.cfg
07878434
 /lib/modules/*
 %exclude /lib/modules/%{version}-esx/build
534cd4dc
 %exclude /usr/src
07878434
 
 %files docs
 %defattr(-,root,root)
f728561a
 %{_defaultdocdir}/linux-esx-%{version}/*
07878434
 
534cd4dc
 %files devel
07878434
 %defattr(-,root,root)
 /lib/modules/%{version}-esx/build
534cd4dc
 /usr/src/%{name}-headers-%{version}-%{release}
07878434
 
 %changelog
c49b19f8
 *   Tue Oct 18 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-6
 -   ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch
 -   tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch
115281cf
 *   Thu Oct  6 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-5
 -   .config: added ADM PCnet32 support
 -   vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch
 -   vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch
 -   late_initcall for vmw_balloon driver
 -   Minor fixed in pv-ops patchset
 *   Mon Oct  3 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-4
 -   Package vmlinux with PROGBITS sections in -debuginfo subpackage
 *   Wed Sep 21 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-3
 -   Add PCIE hotplug support
 -   Switch processor type to generic
 *   Tue Sep 20 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-2
 -   Add -release number for /boot/* files
 -   Fixed generation of debug symbols for kernel modules & vmlinux
 *   Wed Sep  7 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.20-1
 -   Update to linux-4.4.20
 -   keys-fix-asn.1-indefinite-length-object-parsing.patch
 *   Thu Aug 25 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-11
 -   vmxnet3 patches to bumpup a version to 1.4.8.0
 *   Wed Aug 24 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-10
 -   .config: added NVME blk dev support
 *   Wed Aug 10 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-9
 -   Added VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch
 *   Wed Jul 20 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-8
 -   .config: added cgroups for pids,mem and blkio
 *   Mon Jul 11 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-7
 -   .config: added ip multible tables support
e123d083
 *   Fri Jun 17 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-6
 -   patch: e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch
 -   .config: disable rt group scheduling - not supported by systemd
45b023d0
 *   Fri May 27 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-5
 -   patch: REVERT-sched-fair-Beef-up-wake_wide.patch
6b1fc961
 *   Wed May 25 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-4
 -   .config: added net_9p and 9p_fs
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.4.8-3
 -   GA - Bump release of all rpms
aa91ef58
 *   Mon May 23 2016 Divya Thaluru <dthaluru@vmware.com> 4.4.8-2
 -   Added patches to fix CVE-2016-3134, CVE-2016-3135
5214ccfa
 *   Fri May 13 2016 Alexey Makhalov <amakhalov@vmware.com> 4.4.8-1
 -   Update to linux-4.4.8
 -   Added net-Drivers-Vmxnet3-set-... patch
 -   Added e1000e module
28755687
 *   Tue Mar 29 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-19
 -   Support kmsg dumping to vmware.log on panic
 -   sunrpc: xs_bind uses ip_local_reserved_ports
d0c0e8c4
 *   Thu Mar 24 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-18
 -   Apply photon8 config (+stack protector regular)
 -   pv-ops patch: added STA support
 -   Added patches from generic kernel
115281cf
 *   Wed Mar 09 2016 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 4.2.0-17
8414998b
 -   Enable ACPI hotplug support in kernel config
97a4ea30
 *   Sun Feb 14 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-16
 -   veth patch: don’t modify ip_summed
e20fa742
 *   Mon Feb 08 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-15
 -   Double tcp_mem limits, patch is added.
c4e65aa5
 *   Wed Feb 03 2016 Anish Swaminathan <anishs@vmware.com>  4.2.0-14
 -   Fixes for CVE-2015-7990/6937 and CVE-2015-8660.
b556c0a5
 *   Fri Jan 22 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-13
 -   Fix for CVE-2016-0728
5508a8d0
 *   Wed Jan 13 2016 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-12
 -   CONFIG_HZ=250
 -   Disable sched autogroup.
a3591eab
 *   Tue Jan 12 2016 Mahmoud Bassiouny <mbassiouny@vmware.com> 4.2.0-11
 -   Remove rootfstype from the kernel parameter.
83f041bc
 *   Tue Dec 15 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-10
 -   Skip rdrand reseed to improve boot time.
 -   .config changes: jolietfs(m), default THP=always, hotplug_cpu(m)
8b924dfa
 *   Tue Nov 17 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-9
 -   nordrand cmdline param is removed.
 -   .config: + serial 8250 driver (M).
c3771c35
 *   Fri Nov 13 2015 Mahmoud Bassiouny <mbassiouny@vmware.com> 4.2.0-8
 -   Change the linux image directory.
9d9ba8dd
 *   Tue Nov 10 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-7
 -   Get LAPIC timer frequency from HV, skip boot time calibration.
 -   .config: + dummy net driver (M).
534cd4dc
 *   Mon Nov 09 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-6
9d9ba8dd
 -   Rename subpackage dev -> devel.
534cd4dc
 -   Added the build essential files in the devel subpackage.
 -   .config: added genede driver module.
becc5c79
 *   Wed Oct 28 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-5
 -   Import patches from kernel2 repo.
 -   Added pv-ops patch (timekeeping related improvements).
 -   Removed unnecessary cmdline params.
 -   .config changes: elevator=noop by default, paravirt clock enable,
     initrd support, openvswitch module, x2apic enable.
1a289ff6
 *   Mon Sep 21 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-4
 -   CDROM modules are added.
246d1ed4
 *   Thu Sep 17 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-3
17ba709c
 -   Fix for 05- patch (SVGA mem size)
246d1ed4
 -   Compile out: pci hotplug, sched smt.
17ba709c
 -   Compile in kernel: vmware balloon & vmci.
246d1ed4
 -   Module for efi vars.
 *   Fri Sep 4 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-2
40c87d98
 -   Hardcoded poweroff (direct write to piix4), no ACPI is required.
 -   sd.c: Lower log level for "Assuming drive cache..." message.
246d1ed4
 *   Tue Sep 1 2015 Alexey Makhalov <amakhalov@vmware.com> 4.2.0-1
c86db2da
 -   Update to linux-4.2.0. Enable CONFIG_EFI
a3c18b12
 *   Fri Aug 28 2015 Alexey Makhalov <amakhalov@vmware.com> 4.1.3-5
 -   Added MD/LVM/DM modules.
 -   Pci probe improvements.
34315282
 *   Fri Aug 14 2015 Alexey Makhalov <amakhalov@vmware.com> 4.1.3-4
 -   Use photon.cfg as a symlink.
fb6292b3
 *   Thu Aug 13 2015 Alexey Makhalov <amakhalov@vmware.com> 4.1.3-3
a3c18b12
 -   Added environment file(photon.cfg) for a grub.
8e2e50b6
 *   Tue Aug 11 2015 Alexey Makhalov <amakhalov@vmware.com> 4.1.3-2
     Added pci-probe-vmware.patch. Removed unused modules. Decreased boot time. 
07878434
 *   Tue Jul 28 2015 Alexey Makhalov <amakhalov@vmware.com> 4.1.3-1
     Initial commit. Use patchset from Clear Linux.