* Update 0013-fedora-rpm.patch The patch was using the syntax of the mkspec file instead of that of the kernel.spec, leading to the build failing. * 6.6: Fix for Fedora and OpenSuse * 6.6: Fix for OpenSuse * Update 0013-fedora-rpm.patch to fix kernel-install issue on Fedora Patch grabbed from https://lore.kernel.org/linux-kbuild/20231103-rpmpost-v1-1-9c18afab47f4@meta.com/ * Undo removing of kernel-uname-r --------- Co-authored-by: Nanotwerp <Nanotwerp@gmail.com>
63 lines
2.6 KiB
Diff
63 lines
2.6 KiB
Diff
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
|
|
index 3eee0143e0c5..552177c1dfc5 100644
|
|
--- a/scripts/package/kernel.spec
|
|
+++ b/scripts/package/kernel.spec
|
|
@@ -18,2 +18,3 @@ Source2: diff.patch
|
|
Provides: kernel-$KERNELRELEASE
|
|
+Provides: kernel-uname-r = %{version}
|
|
BuildRequires: bc binutils bison dwarves
|
|
@@ -27,8 +27,8 @@ The Linux Kernel, the operating system core itself
|
|
%package headers
|
|
Summary: Header files for the Linux kernel for use by glibc
|
|
Group: Development/System
|
|
-Obsoletes: kernel-headers
|
|
Provides: kernel-headers = %{version}
|
|
+Provides: installonlypkg(kernel) = %{version}
|
|
%description headers
|
|
Kernel-headers includes the C header files that specify the interface
|
|
between the Linux kernel and userspace libraries and programs. The
|
|
@@ -40,12 +40,31 @@ glibc package.
|
|
%package devel
|
|
Summary: Development package for building kernel modules to match the %{version} kernel
|
|
Group: System Environment/Kernel
|
|
+Provides: kernel-devel = %{version}
|
|
+Provides: kernel-devel-uname-r = %{version}
|
|
+Provides: installonlypkg(kernel) = %{version}
|
|
AutoReqProv: no
|
|
%description -n kernel-devel
|
|
This package provides kernel headers and makefiles sufficient to build modules
|
|
against the %{version} kernel package.
|
|
%endif
|
|
|
|
+# Opt out of a lot of Fedora hardening flags etc...
|
|
+# See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
|
+%undefine _package_note_file
|
|
+%undefine _auto_set_build_flags
|
|
+%undefine _include_frame_pointers
|
|
+%define _build_id_flags -Wl,--build-id=none
|
|
+%undefine _annotated_build
|
|
+%undefine _fortify_level
|
|
+%undefine _hardened_build
|
|
+%global _lto_cflags %{nil}
|
|
+%global _configure_gnuconfig_hack 0
|
|
+%global _configure_libtool_hardening_hack 0
|
|
+# Nearly had to go to the deep web to find documentation on this one... Gosh
|
|
+# See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
|
+%define _build_id_links none
|
|
+
|
|
%prep
|
|
%setup -q -n linux
|
|
cp %{SOURCE1} .config
|
|
@@ -77,10 +96,7 @@ rm -rf %{buildroot}
|
|
|
|
%post
|
|
if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KERNELRELEASE} -a -r /boot/System.map-%{KERNELRELEASE} ]; then
|
|
-cp /boot/vmlinuz-%{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm
|
|
-cp /boot/System.map-%{KERNELRELEASE} /boot/.System.map-%{KERNELRELEASE}-rpm
|
|
-rm -f /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE}
|
|
-/sbin/installkernel %{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm
|
|
+/sbin/installkernel %{KERNELRELEASE} /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE}
|
|
rm -f /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm
|
|
fi
|
|
|