From fa3dd2ca59d834799070ded175ab0c17a364dc3e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 3 Oct 2013 11:42:06 +0300 Subject: [PATCH] Add dependency generator for kABI provides The only difference from RHEL 7 is that we're looking for symvers file in /lib/modules now, per #1609695[1]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1609695 - Add dependency generator for kABI provides Resolves: #1942563 Resolves: #2008554 Signed-off-by: Eugene Syromiatnikov --- kabi.attr | 2 ++ kabi.sh | 13 +++++++++++++ kernel-srpm-macros.spec | 8 ++++++++ 3 files changed, 23 insertions(+) create mode 100644 kabi.attr create mode 100644 kabi.sh diff --git a/kabi.attr b/kabi.attr new file mode 100644 index 0000000..85d30a2 --- /dev/null +++ b/kabi.attr @@ -0,0 +1,2 @@ +%__kabi_provides %{_rpmconfigdir}/kabi.sh +%__kabi_path ^/lib/modules/[1-9].*/symvers.gz$ diff --git a/kabi.sh b/kabi.sh new file mode 100644 index 0000000..0afa5ad --- /dev/null +++ b/kabi.sh @@ -0,0 +1,13 @@ +#!/bin/bash +x +# +# kabi.sh - Automatically extract any kernel symbol checksum from the +# symvers file and add to RPM deps. This is used to move the +# checksum checking from modprobe to rpm install for 3rd party +# modules (so they can fail during install and not at load). + +IFS=$'\n' + +for symvers in $(grep -E '/lib/modules/[1-9].*/symvers\.gz') "$@"; +do + zcat $symvers | awk ' {print "kernel(" $2 ") = " $1 }' +done diff --git a/kernel-srpm-macros.spec b/kernel-srpm-macros.spec index e099f74..9b7a319 100644 --- a/kernel-srpm-macros.spec +++ b/kernel-srpm-macros.spec @@ -30,6 +30,10 @@ Source300: kmodtool Source301: rpmsort Source302: symset-table +# kabi provides generator +Source400: kabi.attr +Source401: kabi.sh + %global rrcdir /usr/lib/rpm/redhat @@ -74,13 +78,17 @@ install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalia install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp install -p -m 644 -t %{buildroot}%{_fileattrsdir} kmod.attr +install -p -m 644 -t "%{buildroot}%{_fileattrsdir}" kabi.attr +install -p -m 755 -t "%{buildroot}%{_rpmconfigdir}" kabi.sh %files %{_rpmconfigdir}/macros.d/macros.kernel-srpm %{_fileattrsdir}/kmod.attr %files -n kernel-rpm-macros +%{_rpmconfigdir}/kabi.sh %{_rpmconfigdir}/macros.d/macros.kmp +%{_fileattrsdir}/kabi.attr %dir %{rrcdir}/find-provides.d %{rrcdir}/kmodtool %{rrcdir}/rpmsort