2006-12-19 00:17:44 +01:00
|
|
|
SUSE specific kernel provides/requires scripts
|
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./scripts/Makefile.am.orig 2011-05-11 14:31:45.000000000 +0000
|
|
|
|
+++ ./scripts/Makefile.am 2011-05-11 14:46:38.000000000 +0000
|
|
|
|
@@ -16,6 +16,7 @@ EXTRA_DIST = \
|
|
|
|
rpmdb_loadcvt rpm.daily rpm.log rpm2cpio.sh \
|
2010-03-26 11:56:28 +01:00
|
|
|
tcl.req tgpg vpkg-provides.sh \
|
|
|
|
find-requires.php find-provides.php \
|
|
|
|
+ find-requires.ksyms find-provides.ksyms \
|
|
|
|
find-php-provides find-php-requires \
|
|
|
|
mono-find-requires mono-find-provides \
|
|
|
|
ocaml-find-requires.sh ocaml-find-provides.sh \
|
2011-05-16 18:07:44 +02:00
|
|
|
@@ -32,6 +33,7 @@ rpmconfig_SCRIPTS = \
|
2010-03-26 11:56:28 +01:00
|
|
|
check-buildroot check-rpaths check-rpaths-worker \
|
|
|
|
find-lang.sh \
|
|
|
|
perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \
|
|
|
|
+ find-requires.ksyms find-provides.ksyms \
|
|
|
|
mono-find-requires mono-find-provides \
|
|
|
|
pkgconfigdeps.sh libtooldeps.sh \
|
|
|
|
ocaml-find-requires.sh ocaml-find-provides.sh \
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./scripts/find-provides.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
|
|
|
|
+++ ./scripts/find-provides.ksyms 2011-05-11 14:46:38.000000000 +0000
|
2009-06-12 16:15:38 +02:00
|
|
|
@@ -0,0 +1,41 @@
|
2006-12-19 00:17:44 +01:00
|
|
|
+#! /bin/sh
|
|
|
|
+
|
|
|
|
+IFS=$'\n'
|
|
|
|
+
|
|
|
|
+case "$1" in
|
|
|
|
+kernel-module-*) ;; # Fedora kernel module package names start with
|
|
|
|
+ # kernel-module.
|
2009-06-12 16:15:38 +02:00
|
|
|
+kernel*) kernel_flavor=${1#kernel-} ;;
|
2006-12-19 00:17:44 +01:00
|
|
|
+esac
|
|
|
|
+
|
2009-06-12 16:15:38 +02:00
|
|
|
+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=$(/sbin/modinfo -F vermagic "$f")
|
2008-11-17 16:33:54 +01:00
|
|
|
+ flavor=${flavor%% *}
|
|
|
|
+ flavor=${flavor##*-}
|
2009-06-12 16:15:38 +02:00
|
|
|
+ if test -z "$flavor"; then
|
|
|
|
+ flavor=$kernel_flavor
|
|
|
|
+ fi
|
|
|
|
+ nm "$f" \
|
2008-11-21 15:09:51 +01:00
|
|
|
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
|
2006-12-19 00:17:44 +01:00
|
|
|
+done \
|
|
|
|
+| sort -u
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./scripts/find-requires.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
|
|
|
|
+++ ./scripts/find-requires.ksyms 2011-05-11 14:46:38.000000000 +0000
|
2009-04-02 17:18:50 +02:00
|
|
|
@@ -0,0 +1,57 @@
|
2006-12-19 00:17:44 +01:00
|
|
|
+#! /bin/bash
|
|
|
|
+
|
|
|
|
+IFS=$'\n'
|
|
|
|
+
|
|
|
|
+case "$1" in
|
|
|
|
+kernel-module-*) ;; # Fedora kernel module package names start with
|
|
|
|
+ # kernel-module.
|
|
|
|
+kernel*) is_kernel_package=1 ;;
|
|
|
|
+esac
|
|
|
|
+
|
|
|
|
+all_provides() {
|
|
|
|
+ for module in "$@"; do
|
|
|
|
+ nm "$module"
|
|
|
|
+ done \
|
|
|
|
+ | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):\1\t\2:p' \
|
2009-01-08 14:33:30 +01:00
|
|
|
+ | sort -t $'\t' -k2 -u
|
2006-12-19 00:17:44 +01:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+all_requires() {
|
|
|
|
+ for module in "$@"; do
|
|
|
|
+ set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q)
|
2009-04-02 17:18:50 +02:00
|
|
|
+ /sbin/modprobe --dump-modversions "$module" \
|
2006-12-19 00:17:44 +01:00
|
|
|
+ | sed -r -e 's:^0x0*::' -e 's:$:\t'"$1"':'
|
|
|
|
+ done \
|
2009-01-08 14:33:30 +01:00
|
|
|
+ | sort -t $'\t' -k2 -u
|
2006-12-19 00:17:44 +01:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+if ! [ -z "$is_kernel_package" -a -e /sbin/modinfo -a -e /sbin/modprobe ]; then
|
|
|
|
+ cat > /dev/null
|
|
|
|
+ exit 0
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+modules=($(grep -E '/lib/modules/.+\.ko$'))
|
|
|
|
+if [ ${#modules[@]} -gt 0 ]; then
|
|
|
|
+ symset_table=$(mktemp -t ${0##*/}.XXXXX)
|
2009-01-08 14:33:30 +01:00
|
|
|
+ /usr/lib/rpm/symset-table | sort -t $'\t' -k 1,1 > $symset_table
|
2006-12-19 00:17:44 +01:00
|
|
|
+
|
|
|
|
+ join -t $'\t' -j 1 -a 2 $symset_table <(
|
|
|
|
+ # Filter out requirements that we fulfill ourself.
|
|
|
|
+ join -t $'\t' -j 2 -v 1 \
|
|
|
|
+ <(all_requires "${modules[@]}") \
|
|
|
|
+ <(all_provides "${modules[@]}") \
|
|
|
|
+ | awk '
|
|
|
|
+ BEGIN { FS = "\t" ; OFS = "\t" }
|
|
|
|
+ { print $3 "/" $2 "/" $1 }
|
|
|
|
+ ' \
|
2009-01-08 14:33:30 +01:00
|
|
|
+ | sort -t $'\t' -k 1,1 -u) \
|
2006-12-19 00:17:44 +01:00
|
|
|
+ | sort -u \
|
|
|
|
+ | awk '
|
|
|
|
+ { FS = "\t" ; OFS = "\t" }
|
|
|
|
+ { split($1, arr, "/")
|
2008-05-06 18:29:40 +02:00
|
|
|
+ flavor = gensub(/.*-/, "", "", arr[1]) }
|
|
|
|
+ NF == 3 { print "kernel(" flavor ":" $2 ") = " $3
|
|
|
|
+ next }
|
|
|
|
+ { print "ksym(" flavor ":" arr[3] ") = " arr[2] }
|
2006-12-19 00:17:44 +01:00
|
|
|
+ '
|
|
|
|
+fi
|