]> git.pld-linux.org Git - packages/kernel.git/blobdiff - kernel.spec
build without grsec and old module-init-tools
[packages/kernel.git] / kernel.spec
index 3184542e07fc7087478e06af680ff639b52620ca..75e37c126f3855b5efd34cb46d2a54214969a0a5 100644 (file)
@@ -6,10 +6,12 @@
 #   - with_grsec_minimal
 #   - with_grsec_full
 #
+# LATEST VERSION CHECKER:
+# # curl -s http://www.kernel.org/kdist/finger_banner
+#
 # TODO:
 # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
-# - add a subpackage (kernel-firmware?) for ~35 firmware files
-# - update or remove tahoe9xx patch2 
+# - update or remove tahoe9xx patch2
 # - update or remove mpt-fusion patch90
 # - update grsec_minimal patch1000:
 #   fs/proc/base.c:1484: error: 'struct task_struct' has no member named 'uid'
 %endif
 
 %define                basever         2.6.32
-%define                postver         .2
+%define                postver         .63
 %define                rel             1
 
 %define                _enable_debug_packages                  0
 %define                alt_kernel      myown
 %endif
 %else
-%if %{without rescuecd}
 %define                __alt_kernel    %{?with_pax:pax}%{!?with_grsec_full:nogrsecurity}%{!?with_apparmor:noaa}%{?with_pae:pae}
 %if "%{__alt_kernel}" != ""
 %define                alt_kernel      %{__alt_kernel}
 %endif
-%else
-%define                alt_kernel      rescuecd
 %endif
+
+%if %{with rescuecd}
+%define                alt_kernel      rescuecd
 %endif
 
 # kernel release (used in filesystem and eventually in uname -r)
@@ -155,10 +157,9 @@ Group:             Base/Kernel
 Source0:       http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
 # Source0-md5: 260551284ac224c3a43c4adac7df4879
 %if "%{postver}" != "%{nil}"
-Source1:       http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
-# Source1-md5: 924b7aa0fcd6e54c12ecc9b3c3082f59
+Patch1:                http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v%{basever}/patch-%{version}.xz
+# Patch1-md5:  bcde8b57108d4989765a616b4b8ff301
 %endif
-
 Source3:       kernel-autoconf.h
 Source4:       kernel-config.h
 Source6:       kernel-config.awk
@@ -200,7 +201,7 @@ Patch4:             kernel-fbcon-margins.patch
 
 # netfilter related stuff mostly based on patch-o-matic-ng
 # snapshot 20070806 with some fixes. Some modules
-# were ported to nf_conntrack. 
+# were ported to nf_conntrack.
 
 Patch10:       kernel-pom-ng-IPV4OPTSSTRIP.patch
 Patch11:       kernel-pom-ng-ipv4options.patch
@@ -234,7 +235,7 @@ Patch41:    kernel-ipvs-nfct.patch
 # http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
 Patch49:       kernel-zph.patch
 
-# based on http://www.linuximq.net/patchs/linux-2.6.29.1-imq-test2.diff
+# http://www.linuximq.net/patchs/linux-2.6.32-imq-test2.diff
 Patch50:       kernel-imq.patch
 
 # http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.28.patch.bz2
@@ -269,7 +270,7 @@ Patch85:    kernel-hostap.patch
 # Taken from http://download.opensuse.org/factory/repo/src-oss/suse/src/kernel-source-2.6.30-10.3.src.rpm
 Patch90:       kernel-mpt-fusion.patch
 
-# based on http://vserver.13thfloor.at/Experimental/patch-2.6.32.1-vs2.3.0.36.27.diff
+# based on http://vserver.13thfloor.at/Experimental/patch-2.6.32.63-vs2.3.0.36.30.diff
 Patch100:      kernel-vserver-2.3.patch
 Patch101:      kernel-vserver-fixes.patch
 
@@ -320,7 +321,7 @@ Patch5000:  kernel-apparmor.patch
 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
 Patch7000:     kernel-inittmpfs.patch
 
-# based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.32.1-200912151746.patch kernel-grsec_full.patch
+# based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.32.7-201001291848.patch kernel-grsec_full.patch
 # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
 #       (since upstream deletes older patches)
 Patch9999:     kernel-grsec_full.patch
@@ -336,10 +337,12 @@ BuildRequires:    elftoaout
 %ifarch ppc
 BuildRequires: uboot-mkimage
 %endif
-AutoReqProv:   no
+##BuildRequires:       gcc < 6:4.6
 BuildRequires: /sbin/depmod
 BuildRequires: gcc >= 5:3.2
+BuildRequires: tar >= 1:1.22
 BuildRequires: xz >= 1:4.999.7
+AutoReqProv:   no
 # for hostname command
 BuildRequires: net-tools
 BuildRequires: perl-base
@@ -355,6 +358,7 @@ Requires:   module-init-tools >= 0.9.9
 Provides:      %{name}(netfilter) = %{netfilter_snap}
 Provides:      %{name}(vermagic) = %{kernel_release}
 Obsoletes:     kernel%{_alt_kernel}-isdn-mISDN
+Obsoletes:     kernel-firmware
 Obsoletes:     kernel-misc-acer_acpi
 Obsoletes:     kernel-misc-fuse
 Obsoletes:     kernel-misc-uvc
@@ -418,7 +422,7 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                topdir          %{_builddir}/%{name}-%{version}
 %define                srcdir          %{topdir}/linux-%{basever}
 %define                objdir          %{topdir}/%{targetobj}
-%define                targetobj       %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
+%define                targetobj       %{_target_base_arch}-gcc-%(%{__cc} -dumpversion)
 
 %define                _kernelsrcdir   /usr/src/linux%{_alt_kernel}-%{version}
 
@@ -691,7 +695,7 @@ cd linux-%{basever}
 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
 
 %if "%{postver}" != "%{nil}"
-%{__bzip2} -dc %{SOURCE1} | patch -p1 -s
+%patch1 -p1
 %endif
 
 # tuxonice:
@@ -910,7 +914,7 @@ PaXconfig() {
        # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
        # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
        # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
-       # PAX_HOOK_ACL_FLAGS. 
+       # PAX_HOOK_ACL_FLAGS.
 
        %if %{with grsec_full}
                # Hardening grsec options if with pax
@@ -1123,16 +1127,28 @@ install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm}
 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
 
+# no point embed content for %ghost files. empty them
+for a in \
+       dep{,.bin} \
+       alias{,.bin} \
+       devname \
+       softdep \
+       symbols{,.bin} \
+       {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \
+; do
+       > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
+done
+
 # /boot
 install -d $RPM_BUILD_ROOT/boot
 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
 %ifarch %{ix86} %{x8664}
 cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
 %endif
 %ifarch ppc ppc64
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
 %endif
 %ifarch ia64
 %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
@@ -1230,9 +1246,13 @@ mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
 
+if [ -x /sbin/update-grub ]; then
+       /sbin/update-grub >/dev/null 2>&1
+fi
 if [ -x /sbin/new-kernel-pkg ]; then
        /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
-elif [ -x /sbin/rc-boot ]; then
+fi
+if [ -x /sbin/rc-boot ]; then
        /sbin/rc-boot 1>&2 || :
 fi
 
@@ -1348,11 +1368,33 @@ fi
 %if %{with myown}
 /lib/modules/%{kernel_release}/kernel/sound
 %endif
-%ghost /lib/modules/%{kernel_release}/modules.*
+
+%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
+
+# provided by build
+/lib/modules/%{kernel_release}/modules.order
+
+# rest modules.* are ghost (regenerated by post depmod -a invocation)
+%ghost /lib/modules/%{kernel_release}/modules.alias
+%ghost /lib/modules/%{kernel_release}/modules.alias.bin
+%ghost /lib/modules/%{kernel_release}/modules.ccwmap
+%ghost /lib/modules/%{kernel_release}/modules.dep
+%ghost /lib/modules/%{kernel_release}/modules.dep.bin
+%ghost /lib/modules/%{kernel_release}/modules.ieee1394map
+%ghost /lib/modules/%{kernel_release}/modules.inputmap
+%ghost /lib/modules/%{kernel_release}/modules.isapnpmap
+%ghost /lib/modules/%{kernel_release}/modules.ofmap
+%ghost /lib/modules/%{kernel_release}/modules.pcimap
+%ghost /lib/modules/%{kernel_release}/modules.seriomap
+%ghost /lib/modules/%{kernel_release}/modules.devname
+%ghost /lib/modules/%{kernel_release}/modules.softdep
+%ghost /lib/modules/%{kernel_release}/modules.symbols
+%ghost /lib/modules/%{kernel_release}/modules.symbols.bin
+%ghost /lib/modules/%{kernel_release}/modules.usbmap
+
 # symlinks pointing to kernelsrcdir
 %ghost /lib/modules/%{kernel_release}/build
 %ghost /lib/modules/%{kernel_release}/source
-%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
 
 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
 %files vmlinux
This page took 0.249393 seconds and 4 git commands to generate.