From 91d3da9ece787b1692f7e42e1b6400d17a39f23d Mon Sep 17 00:00:00 2001 From: Solar Designer Date: Thu, 14 Sep 2023 22:09:33 +0200 Subject: [PATCH] RPM: Use kernel build directory corresponding to kernel-devel --- CHANGES | 6 ++++++ lkrg.spec | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1981b2a0..c0279213 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +The following major changes have been made since LKRG 0.9.7: + + *) RPM spec file improvements to make it work or properly fail in a wider set + of circumstances + + The following major changes have been made between LKRG 0.9.6 and 0.9.7: *) Support new mainline kernels 6.4 to 6.5.x, and hopefully beyond diff --git a/lkrg.spec b/lkrg.spec index 7e65abb6..d34de653 100644 --- a/lkrg.spec +++ b/lkrg.spec @@ -5,12 +5,12 @@ Summary: Linux Kernel Runtime Guard (LKRG) Name: lkrg Version: 0.9.7 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 URL: https://lkrg.org Source: https://lkrg.org/download/%name-%version.tar.gz ExclusiveArch: %ix86 x86_64 %arm32 %arm64 -BuildRequires: make, gcc, kernel-devel +BuildRequires: make, gcc, elfutils-libelf-devel, kernel, kernel-devel BuildRoot: /override/%name-%version %description @@ -28,7 +28,7 @@ as open a file) based on the unauthorized credentials. %setup -q %build -make %{?_smp_mflags} +make %{?_smp_mflags} KERNELRELEASE=%kmod_headers_version %install rm -rf %buildroot @@ -55,6 +55,12 @@ echo 'To enable LKRG on bootup please use: systemctl enable lkrg' %_sysconfdir/sysctl.d/* %changelog +* Thu Sep 14 2023 Solar Designer 0.9.7-2 +- Use kernel build directory corresponding to the kernel-devel package, not to +the currently running kernel +- "BuildRequires: kernel" for the /lib/modules/* directory +- "BuildRequires: elfutils-libelf-devel" to support CONFIG_UNWINDER_ORC=y + * Thu Sep 14 2023 Solar Designer 0.9.7-1 - Wrote this rough RPM spec file for Red Hat'ish distros, seems to work fine on RHEL 7, 8, 9 rebuilds, but is only reliable when there's exactly one