2013-10-03 08:42:06 +00:00
|
|
|
#!/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'
|
|
|
|
|
2023-05-16 06:21:40 +00:00
|
|
|
for symvers in $(grep -E '(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.(gz|xz)') "$@";
|
2013-10-03 08:42:06 +00:00
|
|
|
do
|
2023-05-16 06:21:40 +00:00
|
|
|
cat_prog="cat"
|
|
|
|
case "$symvers" in
|
|
|
|
*.gz) cat_prog="zcat" ;;
|
|
|
|
*.xz) cat_prog="xzcat" ;;
|
|
|
|
esac
|
|
|
|
|
2021-11-17 15:29:49 +00:00
|
|
|
# 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.
|
2023-05-16 06:21:40 +00:00
|
|
|
"$cat_prog" "$symvers" | awk '/[^ ]* [^ ]* vmlinux .*/ { print "kernel(" $2 ") = " $1 }'
|
2013-10-03 08:42:06 +00:00
|
|
|
done
|