From cb167f72af27aa8d3bc412351ce6590978135d1c Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 3 Feb 2025 10:29:26 +0000 Subject: automatic import of openEuler-rpm-config --- kabi.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 kabi.sh (limited to 'kabi.sh') diff --git a/kabi.sh b/kabi.sh new file mode 100644 index 0000000..dd49b8b --- /dev/null +++ b/kabi.sh @@ -0,0 +1,22 @@ +#!/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 '(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.(gz|xz)') "$@"; +do + cat_prog="cat" + case "$symvers" in + *.gz) cat_prog="zcat" ;; + *.xz) cat_prog="xzcat" ;; + esac + + # We generate dependencies only for symbols exported by vmlinux itself + # and not for kmods here as they are spread across subpackages, + # so Provides: generation for kmods is handled by find-provides.ksyms. + "$cat_prog" "$symvers" | awk '/[^ ]* [^ ]* vmlinux .*/ { print "kernel(" $2 ") = " $1 }' +done -- cgit v1.2.3