From cce2db1c9f957a17f4a328ddd1a200c344b10a49 Mon Sep 17 00:00:00 2001 From: Adel Kara Slimane Date: Sat, 7 Jan 2023 20:51:15 +0100 Subject: [PATCH] Various fixes for the RPM target (#684) * prepare: always patch RPM mkspec Like this we can notice earlier if it doesn't apply any longer Otherwise I only test RPM when issues get openned * RPM: fix RPM mkspecp atch, thanks @W3sG for the heads up! - Only part of the patch was applying - Fixed also the fact that packages conflict because of unneeded build-id files in /usr/lib/.build-id - Removed all the hardening flags Fedora uses by default "we do not do that here" Fixes: #669 #609 * install.sh: uninstall-help: fix Fedora query for installed TKG packages * install.sh: RPM: fix typo in variable Used the non absolute path for the work folder x) --- install.sh | 4 +- linux-tkg-config/prepare | 6 +-- linux-tkg-patches/5.10/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.11/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.12/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.13/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.14/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.15/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.16/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.17/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.18/0013-fedora-rpm.patch | 46 ++++++++++++++----- linux-tkg-patches/5.19/0013-fedora-rpm.patch | 46 ++++++++++++++----- linux-tkg-patches/5.4/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.7/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.8/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/5.9/0013-fedora-rpm.patch | 47 +++++++++++++++----- linux-tkg-patches/6.0/0013-fedora-rpm.patch | 46 ++++++++++++++----- linux-tkg-patches/6.1/0013-fedora-rpm.patch | 46 ++++++++++++++----- linux-tkg-patches/6.2/0013-fedora-rpm.patch | 46 ++++++++++++++----- 19 files changed, 616 insertions(+), 188 deletions(-) diff --git a/install.sh b/install.sh index 28134e8..2278267 100755 --- a/install.sh +++ b/install.sh @@ -249,7 +249,7 @@ if [ "$1" = "install" ]; then _extra_ver_str="_${_kernel_flavor}" fi - _fedora_work_dir="$_kernel_work_folder/linux-tkg-rpmbuild" + _fedora_work_dir="$_kernel_work_folder_abs/linux-tkg-rpmbuild" msg2 "Building kernel RPM packages" RPMOPTS="--define '_topdir ${_fedora_work_dir}'" make ${llvm_opt} -j ${_thread_num} rpm-pkg EXTRAVERSION="${_extra_ver_str}" @@ -416,7 +416,7 @@ if [ "$1" = "uninstall-help" ]; then msg2 "Note: linux-libc-dev packages are no longer created and installed, you can safely remove any remnants." elif [ "$_distro" = "Fedora" ]; then msg2 "List of installed custom tkg kernels: " - dnf list --installed kernel* + dnf list --installed | grep -i "tkg" msg2 "To uninstall a version, you should remove the kernel, kernel-headers and kernel-devel associated to it (if installed), with: " msg2 " sudo dnf remove --noautoremove kernel-VERSION kernel-devel-VERSION kernel-headers-VERSION" msg2 " where VERSION is displayed in the second column" diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index d4a254b..6e6d736 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -692,10 +692,8 @@ _tkg_srcprep() { _msg="Applying glitched base non-rt additions patch" && _tkg_patcher fi - if [[ "$_distro" =~ ^(Fedora|Suse)$ ]]; then - tkgpatch="$srcdir/0013-fedora-rpm.patch" - _msg="RPM: fixing spec generator" && _tkg_patcher - fi + tkgpatch="$srcdir/0013-fedora-rpm.patch" + _msg="RPM: fixing spec generator" && _tkg_patcher if [ -z $_misc_adds ]; then plain "Enable misc additions ? They may contain temporary fixes pending upstream, or some other changes that can break on non-Arch distros." diff --git a/linux-tkg-patches/5.10/0013-fedora-rpm.patch b/linux-tkg-patches/5.10/0013-fedora-rpm.patch index a8b1545..13d5688 100644 --- a/linux-tkg-patches/5.10/0013-fedora-rpm.patch +++ b/linux-tkg-patches/5.10/0013-fedora-rpm.patch @@ -1,28 +1,53 @@ -# Remove the obsoletes line in kernel-headers -# Add provides for kernel-devel so there's no conflict -# and fix akmod-nvidia - diff --git a/scripts/package/mkspec b/scripts/package/mkspec -index 7c477ca7d..1158f5559 100755 +index 70392fd2f..34f98648f 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec -@@ -25,0 +26 @@ fi +@@ -25,7 +25,7 @@ fi + +PROVIDES_DRM="" -@@ -27 +28 @@ if grep -q CONFIG_DRM=y .config; then + if grep -q CONFIG_DRM=y .config; then - PROVIDES=kernel-drm + PROVIDES_DRM="Provides: kernel-drm = %{version}" -@@ -30 +30,0 @@ fi + fi + -PROVIDES="$PROVIDES kernel-$KERNELRELEASE" -@@ -51 +51,3 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz + __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") +@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <