#
-# NOTE:
-# the following bcond combos will not work
-# - without_vserver and any of the following
-# - with_grsecurity
-#
# LATEST VERSION CHECKER:
# # curl -s http://www.kernel.org/kdist/finger_banner
#
%bcond_with verbose # verbose build (V=1)
%bcond_with reiser4 # support for reiser4 fs (experimental)
-%bcond_with grsecurity # don't build grsecurity nor pax at all
-%bcond_with pax # build pax and grsecurity (ie. grsecurity && pax)
-
%bcond_with fbcondecor # build fbcondecor (disable FB_TILEBLITTING and affected fb modules)
%bcond_without pae # build PAE (HIGHMEM64G) support on 32bit i686 athlon pentium3 pentium4
%bcond_with nfsroot # build with root on NFS support
%bcond_without imq # imq support
%bcond_without esfq # esfq support
%bcond_without ipv6 # ipv6 support
+%bcond_with padmcrypt # parallel dm-crypt
%bcond_without vserver # support for VServer (enabled by default)
%{?debug:%define with_verbose 1}
-%if %{with vanilla}
-%unglobal with_grsecurity
-%endif
-
-%if %{without grsecurity}
-%unglobal with_pax
-%endif
-
-%if %{with pax}
-%define with_grsecurity 1
-%define with_pax 1
-%endif
-
%define have_drm 1
%define have_oss 1
%define have_sound 1
%define have_pcmcia 1
%if %{with rescuecd}
-%unglobal with_grsecurity
-%unglobal with_pax
%unglobal with_vserver
%define have_drm 0
%define have_sound 0
%define have_pcmcia 0
%endif
-%define rel 1
-%define basever 3.5
-%define postver .3
+%define rel 0.1
+%define basever 3.12
+%define postver .0
# __alt_kernel is list of features, empty string if none set
# _alt kernel is defined as: %{nil}%{?alt_kernel:-%{?alt_kernel}} (defined in rpm.macros)
# alt_kernel should be defined if __alt_kernel has non-empty value (for %{?alt_kernel:foo} constructs)
-%define __alt_kernel %{?with_pax:pax}%{?with_grsecurity:grsecurity}
+%define __alt_kernel %{nil}
%if "%{__alt_kernel}" != ""
%define alt_kernel %{__alt_kernel}
License: GPL v2
Group: Base/Kernel
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
-# Source0-md5: 24153eaaa81dedc9481ada8cd9c3b83d
+# Source0-md5: cc6ee608854e0da4b64f6c1ff8b6398c
%if "%{postver}" != ".0"
-Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2
-# Patch0-md5: 94115bfe01743bd4326d71f321f2e5ac
+Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
+# Patch0-md5: 8431ee4e2467fdfde47e31701813a265
%endif
+Source1: kernel.sysconfig
Source3: kernel-autoconf.h
Source4: kernel-config.h
Source41: kernel-patches.config
Source43: kernel-vserver.config
-Source45: kernel-grsec.config
-Source49: kernel-pax.config
-Source50: kernel-no-pax.config
Source55: kernel-imq.config
Source56: kernel-reiser4.config
Patch10: kernel-pom-ng-IPV4OPTSSTRIP.patch
-Patch16: kernel-pom-ng-mms-conntrack-nat.patch
-Patch22: kernel-pom-ng-rsh.patch
-Patch23: kernel-pom-ng-rpc.patch
-
# http://ftp.linux-vserver.org/pub/people/dhozac/p/k/delta-owner-xid-feat02.diff
Patch37: kernel-owner-xid.patch
# http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
Patch49: kernel-zph.patch
-# based on http://www.linuximq.net/patchs/patch-imqmq-3.1.diff.bz2
+# http://www.linuximq.net
Patch50: kernel-imq.patch
-# http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.35.patch.bz2
-Patch51: kernel-reiser4.patch
+Patch51: http://downloads.sourceforge.net/project/reiser4/reiser4-for-linux-3.x/reiser4-for-3.11.1.patch.gz
+# Patch51-md5: 24a7d3711aadd26000d16eaac943a4ce
# http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2
Patch53: kernel-esfq.patch
# http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
Patch85: kernel-hostap.patch
-# http://vserver.13thfloor.at/Experimental/patch-3.5.1-vs2.3.4.1.diff
+# http://www.linuxtv.org/wiki/index.php/TechniSat_CableStar_Combo_HD_CI#Patch
+Patch90: kernel-technisat-combo-hd-ci.patch
+
+# http://vserver.13thfloor.at/Experimental/patch-3.10.9-vs2.3.6.6.diff
+# note there are additional patches from above url:
+# - *fix* are real fixes (we want these)
+# - *feat* are new features/tests (we don't want these)
Patch100: kernel-vserver-2.3.patch
Patch101: kernel-vserver-fixes.patch
-# http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.11_for_3.3.0-rc3.diff.gz
-Patch140: kernel-unionfs.patch
+# git clone git://kernel.opensuse.org/kernel-source.git
+# patches.suse/ovl*
+Patch110: ovl01-vfs-add-i_op-dentry_open.patch
+Patch111: ovl02-vfs-export-do_splice_direct-to-modules.patch
+Patch112: ovl03-vfs-export-inode_permission-to-modules.patch
+Patch113: ovl04-vfs-introduce-clone_private_mount.patch
+Patch114: ovl05-overlay-filesystem.patch
+Patch115: ovl06-overlayfs-add-statfs-support.patch
+Patch116: ovl07-overlayfs-implement-show_options.patch
+Patch117: ovl08-overlay-overlay-filesystem-documentation.patch
+Patch118: ovl09-fs-limit-filesystem-stacking-depth.patch
# git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git, read README
# Patch creation:
# git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git
# cd aufs3-standalone
-# git checkout -b aufs3.5 origin/aufs3.5
+# git checkout -b aufs3.10 origin/aufs3.10
# cat aufs3-kbuild.patch aufs3-base.patch aufs3-standalone.patch > ~/rpm/packages/kernel/kernel-aufs3.patch
# mkdir linux
# cp -a Documentation fs include linux
# drop hunk at the end of patch (hunk is patching include/linux/Kbuild with single line change)
#
Patch145: kernel-aufs3.patch
-Patch146: kernel-aufs2-unionfs.patch
-Patch147: kernel-aufs2-no-const-grsec.patch
-Patch148: kernel-aufs2-reiser4.patch
+Patch146: kernel-aufs3+vserver.patch
# Show normal colors in menuconfig with ncurses ABI 6
Patch250: kernel-fix_256colors_menuconfig.patch
# https://patchwork.kernel.org/patch/236261/
Patch400: kernel-virtio-gl-accel.patch
+# http://people.redhat.com/mpatocka/patches/kernel/dm-crypt-paralelizace/current/series.html
+Patch500: dm-crypt-remove-percpu.patch
+Patch501: dm-crypt-unbound-workqueue.patch
+Patch502: dm-crypt-dont-allocate-partial-pages.patch
+Patch503: dm-crypt-fix-allocation-deadlock.patch
+Patch504: dm-crypt-offload-writes-to-thread.patch
+Patch505: dm-crypt-sort-requests.patch
+
Patch2000: kernel-small_fixes.patch
Patch2001: kernel-pwc-uncompress.patch
Patch2003: kernel-regressions.patch
-# http://git.kernel.org/?p=linux/kernel/git/jj/linux-apparmor.git;a=shortlog;h=refs/heads/v3.5-aa2.8
+# bzr co lp:apparmor
+# ls apparmor/kernel-patches/3.12
Patch5000: kernel-apparmor.patch
# for rescuecd
# based on ftp://ftp.leg.uct.ac.za/pub/linux/rip/tmpfs_root-2.6.30.diff.gz
Patch7000: kernel-inittmpfs.patch
-# based on http://grsecurity.net/~spender/grsecurity-2.2.2-3.1.1-201111181902.patch
-# NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
-# (since upstream deletes older patches)
-# NOTE: mirror of old grsecurity patches:
-# https://github.com/slashbeast/grsecurity-scrape/tree/master/test
-Patch9999: kernel-grsec_full.patch
-Patch10000: kernel-grsec-caps.patch
-Patch10001: kernel-grsec-common.patch
-Patch10002: kernel-grsec_fixes.patch
-
# Do not remove this line, please. It is easier for me to uncomment two lines, then patch
# kernel.spec every time.
#Patch50000: kernel-usb_reset.patch
BuildRequires: xz >= 1:4.999.7
AutoReqProv: no
BuildRequires: hostname
-BuildRequires: virtual(module-tools)
+BuildRequires: kmod
BuildRequires: perl-base
BuildRequires: rpm-build >= 4.5-24
BuildRequires: rpmbuild(macros) >= 1.652
Requires(post): coreutils
Requires(post): geninitrd >= 10000-3
-Requires(post): virtual(module-tools)
+Requires(post): kmod >= 12-2
Requires: /sbin/depmod
Requires: coreutils
Requires: geninitrd >= 10000-3
-Requires: virtual(module-tools)
+Requires: kmod >= 12-2
%if %{with pae}
%ifarch i686 athlon pentium3 pentium4
Requires: cpuinfo(pae)
%endif
%endif
+Suggests: crda
Suggests: dracut
Suggests: keyutils
Suggests: linux-firmware
Conflicts: util-linux < 2.10o
Conflicts: util-vserver < 0.30.216
Conflicts: xfsprogs < 2.6.0
-ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
+ExclusiveArch: i486 i586 i686 pentium3 pentium4 athlon %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
ExclusiveOS: Linux
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}
%define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
%define __features \
-%{?with_grsecurity:Grsecurity support - enabled}\
-%{?with_pax:PaX support - enabled}\
%{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
%{?with_nfsroot:Root on NFS - enabled}\
Group: Development/Building
Requires: %{name}-module-build = %{epoch}:%{version}-%{release}
AutoReqProv: no
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description source
This is the source code for the Linux kernel. You can build a custom
Summary(pl.UTF-8): Dokumentacja do jądra Linuksa
Group: Documentation
AutoReqProv: no
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description doc
This is the documentation for the Linux kernel, as found in
ln -s %{SOURCE10} Makefile
cd linux-%{basever}
-# hack against warning in pax/grsec
-sed -i 's/-Werror//' arch/alpha/kernel/Makefile
-
-
%if "%{postver}" != ".0"
%patch0 -p1
%endif
# kernel-pom-ng-IPV4OPTSSTRIP.patch
%patch10 -p1
-# kernel-pom-ng-mms-conntrack-nat.patch
-%patch16 -p1
-
-# kernel-pom-ng-rsh.patch
-%patch22 -p1
-
-# kernel-pom-ng-rpc.patch
-%patch23 -p1
-
# kernel-owner-xid.patch
%if %{with vserver}
%patch37 -p1
# hostap enhancements from/for aircrack-ng
%patch85 -p1
+# TechniSat_CableStar_Combo_HD_CI
+%patch90 -p1
+
# vserver
%if %{with vserver}
%patch100 -p1
%patch101 -p1
%endif
+%patch110 -p1
+%patch111 -p1
+%patch112 -p1
+%patch113 -p1
+%patch114 -p1
+%patch115 -p1
+%patch116 -p1
+%patch117 -p1
+%patch118 -p1
+
# aufs3
-%if %{with reiser4}
-%patch148 -p1
-%endif
%patch145 -p1
+%if %{with vserver}
%patch146 -p1
-
-# unionfs
-%patch140 -p1
+%endif
%if %{with rescuecd}
%patch7000 -p1
%endif
-# grsecurity & pax stuff
-#
-%if %{with grsecurity}
-exit 0
-%patch9999 -p1
-# aufs needs this
-%patch147 -p1
-%{?with_vserver:%patch10000 -p1}
-%{?with_vserver:%patch10001 -p1}
-%{?with_vserver:%patch10002 -p1}
-%endif
-#
-# end of grsecurity & pax stuff
-
# apparmor
%patch5000 -p1
# virtio-gl
%patch400 -p1
+# parallel dm-crypt
+%if %{with padmcrypt}
+%patch500 -p1
+%patch501 -p1
+%patch502 -p1
+%patch503 -p1
+%patch504 -p1
+%patch505 -p1
+%endif
+
%endif # vanilla
# Small fixes:
#%patch2003 -p1
# Do not remove this, please!
-#%patch50000 -p1
+#%%patch50000 -p1
# Fix EXTRAVERSION in main Makefile
sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:.%{alt_kernel}}#g' Makefile
DEFCONFIG := %{defconfig}
EOF
-PaXconfig() {
- set -x
- cat <<-EOCONFIG > $1
- %ifarch %{ix86}
- CONFIG_PAX_SEGMEXEC=y
- # performance impact on CPUs without NX bit
- CONFIG_PAX_PAGEEXEC=n
- # Testing KERNEXEC
-
- CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n
- CONFIG_PCI_BIOS=n
- CONFIG_EFI=n
- %endif
-
- %ifarch ppc64
- CONFIG_PAX_NOELFRELOCS=n
- %endif
- %ifarch ppc
- CONFIG_PAX_EMUTRAMP=y
- CONFIG_PAX_EMUSIGRT=y
- CONFIG_PAX_EMUPLT=y
- %endif
-
- %ifarch sparc sparc64 alpha
- CONFIG_PAX_EMUPLT=y
- %endif
-
- # Now we have to check MAC system integration. Grsecurity 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.
-
- %if %{with grsecurity}
- # Hardening grsec options if with pax
- CONFIG_GRKERNSEC_PROC_MEMMAP=y
- # almost rational (see HIDESYM help)
- CONFIG_GRKERNSEC_HIDESYM=y
-
- # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
- %else
- CONFIG_PAX_HAVE_ACL_FLAGS=n
- CONFIG_PAX_HOOK_ACL_FLAGS=y
- %endif
-EOCONFIG
-
- return 0
-}
-
RescueConfig() {
set -x
cat <<-EOCONFIG > $1
# CONFIG_DVB_CORE is not set
# CONFIG_HAMRADIO is not set
# CONFIG_ARCNET is not set
- # CONFIG_FB is not set
# CONFIG_DRM is not set
# CONFIG_WATCHDOG is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_PHONE is not set
# CONFIG_STRICT_DEVMEM is not set
# CONFIG_IMA is not set
+ # CONFIG_MEDIA_SUPPORT is not set
+ # CONFIG_UWB is not set
+ # CONFIG_PWM is not set
+ # CONFIG_COMEDI_NI_LABPC_ISA is not set
+ # CONFIG_FB_SYS_FILLRECT is not set
+ # CONFIG_FB_SYS_COPYAREA is not set
+ # CONFIG_FB_SYS_IMAGEBLIT is not set
+ # CONFIG_FB_SYS_FOPS is not set
+ # CONFIG_FB_HECUBA is not set
+ # CONFIG_FB_SVGALIB is not set
+ # CONFIG_FB_CIRRUS is not set
+ # CONFIG_FB_PM2 is not set
+ # CONFIG_FB_CYBER2000 is not set
+ # CONFIG_FB_ARC is not set
+ # CONFIG_FB_ASILIANT is not set
+ # CONFIG_FB_IMSTT is not set
+ # CONFIG_FB_VGA16 is not set
+ # CONFIG_FB_UVESA is not set
+ # CONFIG_FB_N411 is not set
+ # CONFIG_FB_HGA is not set
+ # CONFIG_FB_S1D13XXX is not set
+ # CONFIG_FB_NVIDIA is not set
+ # CONFIG_FB_RIVA is not set
+ # CONFIG_FB_I740 is not set
+ # CONFIG_FB_LE80578 is not set
+ # CONFIG_FB_CARILLO_RANCH is not set
+ # CONFIG_FB_MATROX is not set
+ # CONFIG_FB_RADEON is not set
+ # CONFIG_FB_ATY128 is not set
+ # CONFIG_FB_ATY is not set
+ # CONFIG_FB_S3 is not set
+ # CONFIG_FB_SAVAGE is not set
+ # CONFIG_FB_SIS is not set
+ # CONFIG_FB_VIA is not set
+ # CONFIG_FB_NEOMAGIC is not set
+ # CONFIG_FB_KYRO is not set
+ # CONFIG_FB_3DFX is not set
+ # CONFIG_FB_VOODOO1 is not set
+ # CONFIG_FB_VT8623 is not set
+ # CONFIG_FB_TRIDENT is not set
+ # CONFIG_FB_ARK is not set
+ # CONFIG_FB_PM3 is not set
+ # CONFIG_FB_CARMINE is not set
+ # CONFIG_FB_GEODE is not set
+ # CONFIG_FB_TMIO is not set
+ # CONFIG_FB_SM501 is not set
+ # CONFIG_FB_SMSCUFX is not set
+ # CONFIG_FB_UDL is not set
+ # CONFIG_FB_GOLDFISH is not set
+ # CONFIG_XEN_FBDEV_FRONTEND is not set
+ # CONFIG_FB_METRONOME is not set
+ # CONFIG_FB_MB862XX is not set
+ # CONFIG_FB_BROADSHEET is not set
+ # CONFIG_FB_AUO_K190X is not set
+ # CONFIG_FB_AUO_K1900 is not set
+ # CONFIG_FB_AUO_K1901 is not set
+ # CONFIG_FB_HYPERV is not set
CONFIG_AUFS=y
CONFIG_AUFS_FS=y
CONFIG_AUFS_BR_RAMFS=y
CONFIG_ISO9660_FS=y
CONFIG_NLS_UTF8=y
CONFIG_SQUASHFS=y
+ CONFIG_FB=y
+ CONFIG_FB_EFI=y
+ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
EOCONFIG
return 0
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
%endif
-
-# Temporary disabled RELOCATABLE. Needed only on x86??
-%if %{with pax} || %{with grsecurity}
- CONFIG_RELOCATABLE=n
-%endif
EOCONFIG
%if %{with rescuecd}
RescueConfig rescue.config
%endif
-%if %{with pax}
- PaXconfig pax.config
-%endif
-
# prepare kernel-style config file from multiple config files
%{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \
%if %{with myown}
rescue.config \
%endif
\
-%if %{with pax}
- %{SOURCE45} \
- %{SOURCE49} \
- pax.config \
-%else
- %if %{with grsecurity}
- %{SOURCE45} \
- %{SOURCE50} \
- %endif
-%endif
- \
%if %{with reiser4}
%{SOURCE56} \
%endif
devname \
softdep \
symbols{,.bin} \
- {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \
; do
test -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
> $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
# /boot
install -d $RPM_BUILD_ROOT/boot
cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
+cp -aL %{objdir}/.config $RPM_BUILD_ROOT/boot/config-%{kernel_release}
%ifarch %{ix86} %{x8664}
cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
# ghosted initrd
touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
+touch $RPM_BUILD_ROOT%{initrd_dir}/initramfs-%{kernel_release}.img
%if "%{_target_base_arch}" != "%{_host_base_arch}"
touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
# /etc/modrobe.d
install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
+install -d $RPM_BUILD_ROOT/etc/sysconfig
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/kernel
+
# /usr/src/linux
install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
find $RPM_BUILD_ROOT%{_kernelsrcdir}/$dir -name '.*.cmd' -exec rm "{}" ";"
done
+# version.h location changed in 3.7, but a lot of external modules don't know about it
+# add a compatibility symlink
+ln -s ../generated/uapi/linux/version.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/version.h
+
# disable this here, causes a lot of build-time problems and our rpm-build disables it anyway
%{__sed} -i -e 's|\(CONSTIFY_PLUGIN.*:=.*\)|# \1|' $RPM_BUILD_ROOT%{_kernelsrcdir}/Makefile
cp -a "$f" "$RPM_BUILD_ROOT%{_kernelsrcdir}/$ff"
done
+%if %{with doc}
# move to %{_docdir} so we wouldn't depend on any kernel package for dirs
install -d $RPM_BUILD_ROOT%{_docdir}
mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}}
-rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
-rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
-rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
-rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
+%else
+%{__rm} -r $RPM_BUILD_ROOT%{_kernelsrcdir}/Documentation
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
fi
%post
+[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
+if [[ "$CREATE_SYMLINKS" != [Nn][Oo] ]]; then
%ifarch ia64
-mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
-%{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
-ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
-%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
-%endif
-mv -f /boot/vmlinuz{,.old} 2> /dev/null
-%{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
-mv -f /boot/System.map{,.old} 2> /dev/null
-%{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
-ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
-%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
-ln -sf System.map-%{kernel_release} /boot/System.map
-%{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
+ mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
+ ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
+%if 0%{?alt_kernel:1}
+ mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null
+ ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}
+%endif
+%endif
+ mv -f /boot/vmlinuz{,.old} 2> /dev/null
+ mv -f /boot/System.map{,.old} 2> /dev/null
+ ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
+ ln -sf System.map-%{kernel_release} /boot/System.map
+%if 0%{?alt_kernel:1}
+ mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null
+ mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null
+ ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}
+ ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}
+%endif
+fi
%depmod %{kernel_release}
%posttrans
-# generate initrd after all dependant modules are installed
-/sbin/geninitrd -f --initrdfs=initramfs %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
-mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
-%{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.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}}
+# use posttrans to generate initrd after all dependant module packages (-drm, etc) are installed
+[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
+initrd_file=""
+if [[ "$USE_GENINITRD" != [Nn][Oo] ]]; then
+ /sbin/geninitrd -f --initrdfs=initramfs %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release} || :
+ initrd_file="initrd-%{kernel_release}.gz"
+fi
# if dracut is present then generate full-featured initramfs
-if [ -x /sbin/dracut ]; then
+if [[ "$USE_DRACUT" != [Nn][Oo] ]] && [ -x /sbin/dracut ]; then
/sbin/dracut --force --quiet /boot/initramfs-%{kernel_release}.img %{kernel_release}
+ [ -n "$initrd_file" ] || initrd_file="initramfs-%{kernel_release}.img"
+fi
+
+if [[ "$CREATE_SYMLINKS" != [Nn][Oo] ]]; then
+ mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
+ if [ -n "$initrd_file" ] ; then
+ ln -sf "$initrd_file" %{initrd_dir}/initrd
+ fi
+%if 0%{?alt_kernel:1}
+ mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null
+ if [ -n "$initrd_file" ] ; then
+ ln -sf "$initrd_file" %{initrd_dir}/initrd%{_alt_kernel}
+ fi
+%endif
fi
# update boot loaders when old package files are gone from filesystem
if [ -x /sbin/rc-boot ]; then
/sbin/rc-boot 1>&2 || :
fi
+if [ -x /sbin/efi-boot-update ]; then
+ /sbin/efi-boot-update --auto || :
+fi
%post vmlinux
-mv -f /boot/vmlinux{,.old} 2> /dev/null
-%{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
-ln -sf vmlinux-%{kernel_release} /boot/vmlinux
-%{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
+[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
+if [[ "$CREATE_SYMLINKS" != [Nn][Oo] ]]; then
+ mv -f /boot/vmlinux{,.old} 2> /dev/null
+ ln -sf vmlinux-%{kernel_release} /boot/vmlinux
+%if 0%{?alt_kernel:1}
+ mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null
+ ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}
+%endif
+fi
%post drm
%depmod %{kernel_release}
%files
%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/kernel
%ifarch sparc sparc64
/boot/vmlinux.aout-%{kernel_release}
%endif
%endif
/boot/vmlinuz-%{kernel_release}
/boot/System.map-%{kernel_release}
+/boot/config-%{kernel_release}
%ghost %{initrd_dir}/initrd-%{kernel_release}.gz
+%ghost %{initrd_dir}/initramfs-%{kernel_release}.img
/lib/firmware/%{kernel_release}
%dir /lib/modules/%{kernel_release}
/lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
/lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
%ifnarch sparc
-%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
-%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
-%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
+%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/pci/cx88/cx88-alsa.ko*
+%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/usb/em28xx/em28xx-alsa.ko*
+%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/pci/saa7134/saa7134-alsa.ko*
%endif
%endif
%dir /lib/modules/%{kernel_release}/misc
%exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
%exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
%exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
-%exclude /lib/modules/%{kernel_release}/kernel/drivers/staging/telephony/ixj_pcmcia.ko*
%exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
%endif
%exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
# 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.devname
-%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.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
/lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
/lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
/lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
-/lib/modules/%{kernel_release}/kernel/drivers/staging/telephony/ixj_pcmcia.ko*
-%endif
/lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
+%endif
/lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
%endif
%ifnarch sparc
/lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
-/lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
-/lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
-/lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
+/lib/modules/%{kernel_release}/kernel/drivers/media/pci/cx88/cx88-alsa.ko*
+/lib/modules/%{kernel_release}/kernel/drivers/media/usb/em28xx/em28xx-alsa.ko*
+/lib/modules/%{kernel_release}/kernel/drivers/media/pci/saa7134/saa7134-alsa.ko*
%endif
%if %{have_oss}
%{_kernelsrcdir}/arch/*/kernel/asm-offsets*
%{_kernelsrcdir}/arch/*/kernel/sigframe*.h
%{_kernelsrcdir}/drivers/lguest/lg.h
-%{_kernelsrcdir}/drivers/media/video/bt8xx/bttv.h
+%{_kernelsrcdir}/drivers/media/pci/bt8xx/bttv.h
%{_kernelsrcdir}/kernel/bounds.c
%{_kernelsrcdir}/scripts/basic/*.c
%attr(755,root,root) %{_kernelsrcdir}/scripts/kconfig/*.sh
%{_kernelsrcdir}/scripts/kconfig/[m-u]*.h
%{_kernelsrcdir}/scripts/kconfig/lxdialog
%{_kernelsrcdir}/scripts/mod/*.c
-%{_kernelsrcdir}/scripts/mod/[^e]*.h
+%{_kernelsrcdir}/scripts/mod/modpost.h
%attr(755,root,root) %{_kernelsrcdir}/scripts/mkcompile_h
%{_kernelsrcdir}/scripts/mkmakefile
%{_kernelsrcdir}/scripts/module-common.lds
%{_kernelsrcdir}/scripts/selinux/mdp/*.c
%exclude %dir %{_kernelsrcdir}/security
%exclude %dir %{_kernelsrcdir}/security/selinux
-%if %{with grsecurity}
-%{_kernelsrcdir}/tools/gcc/*.c
-%endif
%if %{with doc}
%files doc
%ifarch ppc ppc64
%exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
%endif
+%{_kernelsrcdir}/arch/arm/kvm
+%{_kernelsrcdir}/arch/arm64/kvm
+%{_kernelsrcdir}/arch/mips/kvm
%{_kernelsrcdir}/arch/s390/kvm
%{_kernelsrcdir}/arch/x86/kvm
%exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
%exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
%exclude %{_kernelsrcdir}/drivers/lguest/lg.h
-%exclude %{_kernelsrcdir}/drivers/media/video/bt8xx/bttv.h
+%exclude %{_kernelsrcdir}/drivers/media/pci/bt8xx/bttv.h
%{_kernelsrcdir}/block
%{_kernelsrcdir}/crypto
%{_kernelsrcdir}/drivers
%{_kernelsrcdir}/firmware
%{_kernelsrcdir}/fs
-%if %{with grsecurity} && %{without rescuecd}
-%{_kernelsrcdir}/grsecurity
-%endif
%{_kernelsrcdir}/init
%{_kernelsrcdir}/ipc
%{_kernelsrcdir}/kernel
%{_kernelsrcdir}/security
%exclude %{_kernelsrcdir}/security/selinux/include
%{_kernelsrcdir}/tools/*
-%if %{with grsecurity}
-%exclude %{_kernelsrcdir}/tools/gcc/*.c
-%endif
%{_kernelsrcdir}/usr
%{_kernelsrcdir}/COPYING
%{_kernelsrcdir}/CREDITS