From 4e0123cfe2de692f410ef59e38bc70c36601817b Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 29 Mar 2024 22:21:01 +0100 Subject: [PATCH] - merged spec changes from LINUX_6_1: version suffix instead of alt_kernel, dropped kernel-vanilla stuff, shebang fixes --- kernel.spec | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/kernel.spec b/kernel.spec index 98002b5..b066712 100644 --- a/kernel.spec +++ b/kernel.spec @@ -7,20 +7,26 @@ %define postver 4 %define rel 0.1 -%define alt_kernel 6.6 +%define __alt_kernel %{nil} + +%if "%{__alt_kernel}" != "" +%define alt_kernel %{__alt_kernel} +%endif + +%define versuffix -%{basever} # kernel release (used in filesystem and eventually in uname -r) # modules will be looked from /lib/modules/%{kernel_release} # localversion is just that without version for "> localversion" %define localversion %{rel} -%define kernel_release %{version}%{?alt_kernel:-%{alt_kernel}}-%{localversion} +%define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion} 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) Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme) Summary(pl.UTF-8): Jądro Linuksa -Name: kernel%{_alt_kernel} +Name: kernel%{versuffix}%{_alt_kernel} Version: %{basever}.%{postver} Release: %{rel} Epoch: 3 @@ -69,7 +75,6 @@ Suggests: keyutils Suggests: linux-firmware Provides: %{name}(netfilter) = 20070806 Provides: %{name}(vermagic) = %{kernel_release} -Obsoletes: kernel%{_alt_kernel}-vanilla Obsoletes: kernel-firmware Obsoletes: kernel-modules Conflicts: e2fsprogs < 1.29 @@ -112,7 +117,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define objdir %{topdir}/%{targetobj} %define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion) -%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version} +%define _kernelsrcdir /usr/src/linux%{versuffix}%{_alt_kernel}-%{version} %if "%{_target_base_arch}" != "%{_host_base_arch}" %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-tld-linux- @@ -157,7 +162,6 @@ Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra Group: Base/Kernel Obsoletes: kernel-smp-vmlinux -Obsoletes: kernel%{_alt_kernel}-vanilla-vmlinux %description vmlinux vmlinux - uncompressed kernel image. @@ -176,7 +180,6 @@ Group: Base/Kernel Requires(postun): %{name} = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release} Obsoletes: kernel-smp-drm -Obsoletes: kernel%{_alt_kernel}-vanilla-drm AutoReqProv: no %description drm @@ -196,7 +199,6 @@ Group: Base/Kernel Requires(postun): %{name} = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release} Obsoletes: kernel-smp-pcmcia -Obsoletes: kernel%{_alt_kernel}-vanilla-pcmcia Conflicts: pcmcia-cs < 3.1.21 Conflicts: pcmciautils < 004 AutoReqProv: no @@ -218,7 +220,6 @@ Group: Base/Kernel Requires(postun): %{name} = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release} Obsoletes: kernel-smp-sound-alsa -Obsoletes: kernel%{_alt_kernel}-vanilla-sound-alsa AutoReqProv: no %description sound-alsa @@ -236,7 +237,6 @@ Summary(de.UTF-8): Header Dateien für den Linux-Kernel Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa Group: Development/Building Provides: %{name}-headers(netfilter) = 20070806 -Obsoletes: kernel%{_alt_kernel}-vanilla-headers AutoReqProv: no %description headers @@ -259,7 +259,6 @@ Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebra Summary(pl.UTF-8): Pliki służące do budowania modułów jądra Group: Development/Building Requires: %{name}-headers = %{epoch}:%{version}-%{release} -Obsoletes: kernel%{_alt_kernel}-vanilla-module-build Conflicts: rpmbuild(macros) < 1.652 AutoReqProv: no @@ -281,7 +280,6 @@ Summary(de.UTF-8): Der Kernel Quelltext Summary(pl.UTF-8): Kod źródłowy jądra Linuksa Group: Development/Building Requires: %{name}-module-build = %{epoch}:%{version}-%{release} -Obsoletes: kernel%{_alt_kernel}-vanilla-source AutoReqProv: no %description source @@ -312,7 +310,6 @@ Summary: Kernel documentation Summary(de.UTF-8): Kernel Dokumentation Summary(pl.UTF-8): Dokumentacja do jądra Linuksa Group: Documentation -Obsoletes: kernel%{_alt_kernel}-vanilla-doc AutoReqProv: no %description doc @@ -338,7 +335,7 @@ cd linux-%{basever} %endif # Fix EXTRAVERSION in main Makefile -sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:-%{alt_kernel}}#g' Makefile +sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile # cleanup backups after patching find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f @@ -351,13 +348,15 @@ find -name '*.py' -print0 | \ %{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \ -e '1s,/usr/bin/env python$,%{__python},' \ -e '1s,/usr/bin/env python3$,%{__python3},' \ - scripts/bloat-o-meter \ - scripts/diffconfig \ - scripts/jobserver-exec \ - scripts/show_delta \ - tools/hv/vmbus_testing \ - tools/kvm/kvm_stat/kvm_stat \ - tools/testing/selftests/exec/binfmt_script.py + drivers/staging/greybus/tools/lbtest \ + scripts/bloat-o-meter \ + scripts/diffconfig \ + scripts/dtc/dt-extract-compatibles \ + scripts/jobserver-exec \ + scripts/show_delta \ + tools/hv/vmbus_testing \ + tools/kvm/kvm_stat/kvm_stat \ + tools/testing/selftests/exec/binfmt_script.py find -name '*.pl' -print0 | \ xargs -0 %{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' \ @@ -372,11 +371,10 @@ find -name '*.pl' -print0 | \ scripts/sphinx-pre-install \ scripts/stackdelta -%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\\1,' \ - scripts/config - -%{__sed} -i -e '1s,/usr/bin/awk,/bin/awk,' \ - scripts/ld-version.sh +%{__sed} -i -e '1s,/usr/bin/env bash,%{__bash},' \ + tools/testing/selftests/powerpc/security/mitigation-patching.sh \ + scripts/config \ + scripts/check-local-export %build install -d %{objdir} @@ -563,13 +561,13 @@ fi %depmod %{kernel_release} %post headers -ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel} +ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{versuffix}%{_alt_kernel} %postun headers if [ "$1" = "0" ]; then - if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then - if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then - rm -f %{_prefix}/src/linux%{_alt_kernel} + if [ -L %{_prefix}/src/linux%{versuffix}%{_alt_kernel} ]; then + if [ "$(readlink %{_prefix}/src/linux%{versuffix}%{_alt_kernel})" = "linux%{versuffix}%{_alt_kernel}-%{version}" ]; then + rm -f %{_prefix}/src/linux%{versuffix}%{_alt_kernel} fi fi fi -- 2.46.0