summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-03-29 06:52:58 -0700
committerAnas Nashif <anas.nashif@intel.com>2013-03-29 06:52:58 -0700
commitbf13e4f1445c05b514fbb30584b84eec6e7d230a (patch)
tree7ed3c07a907aa37a15ad29469d3b49d7415ebb50
parent328527f11f71d0509bf921fb9297ba0cb5c4ecc1 (diff)
downloadlibrpm-tizen-bf13e4f1445c05b514fbb30584b84eec6e7d230a.tar.gz
librpm-tizen-bf13e4f1445c05b514fbb30584b84eec6e7d230a.tar.bz2
librpm-tizen-bf13e4f1445c05b514fbb30584b84eec6e7d230a.zip
add find-provides.ksyms
-rwxr-xr-xpackaging/find-provides.ksyms41
1 files changed, 41 insertions, 0 deletions
diff --git a/packaging/find-provides.ksyms b/packaging/find-provides.ksyms
new file mode 100755
index 000000000..c8f2ccda6
--- /dev/null
+++ b/packaging/find-provides.ksyms
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*) ;; # Fedora kernel module package names start with
+ # kernel-module.
+kernel*) kernel_flavor=${1#kernel-} ;;
+esac
+
+trap 'rm -f "$tmp"' EXIT
+tmp=$(mktemp)
+while read f; do
+ test -e "$f" || continue
+ case "$f" in
+ *.debug)
+ continue
+ ;;
+ */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz | */boot/vmlinu[xz]*)
+ ;;
+ *)
+ continue
+ esac
+ unzip=false
+ case "$f" in
+ *.gz | */boot/vmlinuz*)
+ unzip=true
+ esac
+ if $unzip && gzip -cd "$f" >"$tmp"; then
+ f=$tmp
+ fi
+ flavor=$(/usr/sbin/modinfo -F vermagic "$f")
+ flavor=${flavor%% *}
+ flavor=${flavor##*-}
+ if test -z "$flavor"; then
+ flavor=$kernel_flavor
+ fi
+ nm "$f" \
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
+done \
+| sort -u