%bcond_with verbose # verbose build (V=1)
%define basever 6.12
-%define postver 16
+%define postver 23
%define rel 1
%define __alt_kernel %{nil}
%define localversion %{rel}
%define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion}
+%define kmod_ver 26-2
+
Summary: The Linux kernel (the core of the Linux operating system)
Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
# Source0-md5: 844fae6a58c7f43af44d8cea8484b4a1
%if "%{postver}" != "0"
Source1: http://www.kernel.org/pub/linux/kernel/v6.x/patch-%{version}.xz
-# Source1-md5: caaa2174c21aa98f3803f5a86cb78704
+# Source1-md5: 5c04e3c7aa02fb5166c054172c354548
%endif
Source2: kernel-module-build.pl
Source10: kernel-x86.config
Source11: kernel-x86_64.config
-URL: http://www.kernel.org/
-BuildRequires: binutils >= 3:2.18
-BuildRequires: bison
+URL: https://www.kernel.org/
+AutoReqProv: no
BuildRequires: /sbin/depmod
+BuildRequires: bc >= 1.06.95
+BuildRequires: binutils >= 3:2.23
+BuildRequires: bison >= 2.0
BuildRequires: elfutils-devel
-BuildRequires: flex
-BuildRequires: gcc >= 5:3.2
+BuildRequires: flex >= 2.5.35
+BuildRequires: gcc >= 6:7.2.0-6
+BuildRequires: gcc-c++
BuildRequires: gcc-plugin-devel
-BuildRequires: xz >= 1:4.999.7
-AutoReqProv: no
BuildRequires: hostname
-BuildRequires: kmod
-BuildRequires: openssl-devel
-BuildRequires: perl-base
-BuildRequires: rpm >= 4.5-74
-BuildRequires: rpmbuild(macros) >= 1.652
+BuildRequires: kmod >= %{kmod_ver}
+BuildRequires: libstdc++-devel
+BuildRequires: make >= 1:3.81
+BuildRequires: openssl-devel >= 1.0.0
+BuildRequires: openssl-tools >= 1.0.0
+BuildRequires: perl-base >= 5
+BuildRequires: rpm-build >= 4.5-74
+BuildRequires: rpmbuild(macros) >= 2.019
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz >= 1:4.999.7
+BuildConflicts: dwarves < 1.16
Requires(post): coreutils
Requires(post): dracut
-Requires(post): kmod >= 12-2
+Requires(post): kmod >= %{kmod_ver}
Requires: /sbin/depmod
Requires: coreutils
Requires: dracut
-Requires: kmod >= 12-2
+Requires: kmod >= %{kmod_ver}
%ifarch i686
Requires: cpuinfo(pae)
%endif
Conflicts: e2fsprogs < 1.29
Conflicts: isdn4k-utils < 3.1pre1
Conflicts: jfsutils < 1.1.3
+Conflicts: libcap-libs < 1:2.34
+Conflicts: libusb < 1.0.9
Conflicts: linux-firmware < 20120720
Conflicts: lvm2 < 2.02.40
Conflicts: module-init-tools < 3.16
Summary(pl.UTF-8): Pliki służące do budowania modułów jądra
Group: Development/Building
Requires: %{name}-headers = %{epoch}:%{version}-%{release}
-Conflicts: rpmbuild(macros) < 1.652
+Requires: elfutils-devel
+Requires: make
+Conflicts: rpmbuild(macros) < 2.019
AutoReqProv: no
%description module-build
%{__xz} -dc %{SOURCE1} | patch -p1 -s
%endif
+chmod 755 tools/objtool/sync-check.sh
+
# Fix EXTRAVERSION in main Makefile
sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile
find -name '*.py' -print0 | \
xargs -0 %{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
- -e '1s,/usr/bin/env python$,%{__python},' \
- -e '1s,/usr/bin/env python3$,%{__python3},'
+ -e '1s,/usr/bin/env python$,%{__python},' \
+ -e '1s,/usr/bin/env python3$,%{__python3},'
%{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
-e '1s,/usr/bin/env python$,%{__python},' \
- -e '1s,/usr/bin/env python3$,%{__python3},' \
+ -e '1s,/usr/bin/env python3$,%{__python3},' \
scripts/bloat-o-meter \
scripts/diffconfig \
scripts/dtc/dt-extract-compatibles \
install -d %{objdir}
cat > %{targetobj}.mk <<'EOF'
# generated by %{name}.spec
-KERNELSRC := %{srcdir}
+KERNELSRC := %{srcdir}
KERNELOUTPUT := %{objdir}
SRCARCH := %{target_arch_dir}
ARCH := %{_target_base_arch}
Q := %{!?with_verbose:@}
MAKE_OPTS := %{MakeOpts}
-DEFCONFIG := %{defconfig}
+DEFCONFIG := %{defconfig}
EOF
cd %{objdir}
%{?with_verbose:V=1} \
oldconfig
+%{__make} \
+ TARGETOBJ=%{targetobj} \
+ %{?with_verbose:V=1} \
+ scripts
+
# build kernel
+export DTC_FLAGS=-@
+ICECC_EXTRAFILES="${ICECC_EXTRAFILES:+$ICECC_EXTRAFILES:}$(test -d %{objdir}/scripts/gcc-plugins && find %{objdir}/scripts/gcc-plugins -name '*.so' | paste -s -d :)"
%{__make} \
TARGETOBJ=%{targetobj} \
%{?with_verbose:V=1} \
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} %{MakeOpts} -j1 %{!?with_verbose:-s} modules_install \
+%{__make} %{MakeOpts} %{!?with_verbose:-s} modules_install \
-C %{objdir} \
%{?with_verbose:V=1} \
DEPMOD=%{DepMod} \
- mod_compress_cmd=true \
INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
+ INSTALL_MOD_STRIP="--strip-debug --remove-section=.comment --remove-section=.note.GNU-stack" \
KERNELRELEASE=%{kernel_release}
install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
%endif
-# /etc/modrobe.d
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
+# /etc/depmod.d /etc/modrobe.d
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/{depmod.d,modprobe.d}/%{kernel_release}
# /usr/src/linux
install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
find $RPM_BUILD_ROOT%{_kernelsrcdir}/$dir -name '.*.cmd' -exec rm "{}" ";"
done
+# Needed for CONFIG_STACK_VALIDATION / ORC_UNWINDER enabled builds
+install -d $RPM_BUILD_ROOT%{_kernelsrcdir}/tools/objtool
+cp -a %{objdir}/tools/objtool/fixdep $RPM_BUILD_ROOT%{_kernelsrcdir}/tools/objtool
+cp -a %{objdir}/tools/objtool/objtool $RPM_BUILD_ROOT%{_kernelsrcdir}/tools/objtool
+
# 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
%exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
/lib/modules/%{kernel_release}/kernel/security
+%dir %{_sysconfdir}/depmod.d/%{kernel_release}
%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
# provided by build
%{_kernelsrcdir}/scripts/selinux/mdp/*.c
%exclude %dir %{_kernelsrcdir}/security
%exclude %dir %{_kernelsrcdir}/security/selinux
+%attr(755,root,root) %{_kernelsrcdir}/tools/objtool/fixdep
+%attr(755,root,root) %{_kernelsrcdir}/tools/objtool/objtool
%if %{with doc}
%files doc
%exclude %{_kernelsrcdir}/security/selinux/include
%{_kernelsrcdir}/tools/*
%exclude %{_kernelsrcdir}/tools/include
+%exclude %{_kernelsrcdir}/tools/objtool/fixdep
+%exclude %{_kernelsrcdir}/tools/objtool/objtool
%{_kernelsrcdir}/usr
%{_kernelsrcdir}/COPYING
%{_kernelsrcdir}/CREDITS