2018-02-14 10:47:53 +01:00
|
|
|
--- ./scripts/Makefile.am.orig 2018-02-14 09:42:12.958726157 +0000
|
|
|
|
+++ ./scripts/Makefile.am 2018-02-14 09:43:26.605515718 +0000
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -19,6 +19,7 @@ EXTRA_DIST = \
|
2017-01-19 16:41:55 +01:00
|
|
|
tgpg vpkg-provides.sh \
|
2014-09-16 14:03:10 +02:00
|
|
|
find-requires find-provides \
|
|
|
|
find-requires.php find-provides.php \
|
|
|
|
+ find-requires.ksyms find-provides.ksyms \
|
|
|
|
mono-find-requires mono-find-provides \
|
|
|
|
ocaml-find-requires.sh ocaml-find-provides.sh \
|
2017-12-05 11:46:24 +01:00
|
|
|
pkgconfigdeps.sh libtooldeps.sh metainfo.prov \
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -36,6 +37,7 @@ rpmconfig_SCRIPTS = \
|
2014-09-16 14:03:10 +02:00
|
|
|
find-lang.sh find-requires find-provides \
|
2017-12-05 11:46:24 +01:00
|
|
|
perl.prov perl.req pythondeps.sh pythondistdeps.py \
|
2018-01-31 15:06:28 +01:00
|
|
|
python-macro-helper \
|
2014-09-16 14:03:10 +02:00
|
|
|
+ find-requires.ksyms find-provides.ksyms \
|
2017-12-05 11:46:24 +01:00
|
|
|
metainfo.prov \
|
2014-09-16 14:03:10 +02:00
|
|
|
mono-find-requires mono-find-provides \
|
|
|
|
pkgconfigdeps.sh libtooldeps.sh \
|
2018-02-14 10:47:53 +01:00
|
|
|
--- ./scripts/find-provides.ksyms.orig 2018-02-14 09:42:54.757606752 +0000
|
|
|
|
+++ ./scripts/find-provides.ksyms 2018-02-14 09:42:39.165651303 +0000
|
|
|
|
@@ -0,0 +1,81 @@
|
|
|
|
+#! /bin/bash
|
|
|
|
+
|
|
|
|
+IFS=$'\n'
|
|
|
|
+
|
|
|
|
+is_opensuse=false
|
|
|
|
+
|
|
|
|
+if test "$1" = "--opensuse"; then
|
|
|
|
+ if test "$2" -gt 0; then
|
|
|
|
+ is_opensuse=true
|
|
|
|
+ fi
|
|
|
|
+ shift 2
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if ! $is_opensuse; then
|
|
|
|
+ trap 'rm -f "$tmp"' EXIT
|
|
|
|
+ tmp=$(mktemp)
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+while read f; do
|
|
|
|
+ test -e "$f" || continue
|
|
|
|
+ is_module=""
|
|
|
|
+ case "$f" in
|
|
|
|
+ *.debug)
|
|
|
|
+ continue
|
|
|
|
+ ;;
|
|
|
|
+ */boot/vmlinu[xz]-*)
|
|
|
|
+ flavor=${f##*/vmlinu[xz]-}
|
|
|
|
+ flavor=${flavor%.gz}
|
|
|
|
+ echo "kernel-uname-r = $flavor"
|
|
|
|
+ version=${flavor}
|
|
|
|
+ flavor=${flavor##*-}
|
|
|
|
+ ;;
|
|
|
|
+ */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz | */boot/vmlinu[xz]*)
|
|
|
|
+ is_module="1"
|
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ continue
|
|
|
|
+ esac
|
|
|
|
+ if $is_opensuse; then
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
|
|
+ unzip=false
|
|
|
|
+ case "$f" in
|
|
|
|
+ *.gz | */boot/vmlinuz*)
|
|
|
|
+ unzip=true
|
|
|
|
+ esac
|
|
|
|
+ if $unzip && gzip -cd "$f" >"$tmp"; then
|
|
|
|
+ f=$tmp
|
|
|
|
+ fi
|
|
|
|
+ if test -z "$flavor" -a -n "$is_module" ; then
|
|
|
|
+ flavor=$(/sbin/modinfo -F vermagic "$f")
|
|
|
|
+ flavor=${flavor%% *}
|
|
|
|
+ version=${flavor}
|
|
|
|
+ flavor=${flavor##*-}
|
|
|
|
+ fi
|
|
|
|
+ if test -z "$flavor"; then
|
|
|
|
+ echo "warning: cannot determine kernel flavor from $(/sbin/modinfo -F vermagic "$f" 2>&1)" >&2
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
|
|
+ objdir=$(readlink /lib/modules/$version/build)
|
|
|
|
+ objdir_build=$RPM_BUILD_ROOT$(readlink $RPM_BUILD_ROOT/lib/modules/$version/build)
|
|
|
|
+ for i in $objdir_build $objdir ; do
|
|
|
|
+ ksym_provides=$i/scripts/mod/ksym-provides
|
|
|
|
+ [ -x $ksym_provides ] && break
|
|
|
|
+ done
|
|
|
|
+ if [ -x $ksym_provides ] ; then
|
|
|
|
+ $ksym_provides $flavor $f
|
|
|
|
+ else
|
|
|
|
+ major=${version%%.*}
|
|
|
|
+ sub=${version#*.}
|
|
|
|
+ sub=${sub%%.*}
|
|
|
|
+ if [ "$major" -ge 4 -a "$sub" -ge 10 ] ; then
|
|
|
|
+ echo "error: cannot determine ksym provides of $f - missing ksym-povides tool." >&2
|
|
|
|
+ else
|
|
|
|
+ nm "$f" \
|
|
|
|
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+done \
|
|
|
|
+| sort -u
|
|
|
|
--- ./scripts/find-requires.ksyms.orig 2018-02-14 09:43:00.437590470 +0000
|
|
|
|
+++ ./scripts/find-requires.ksyms 2018-02-14 09:42:45.621632854 +0000
|
|
|
|
@@ -0,0 +1,29 @@
|
|
|
|
+#! /bin/bash
|
|
|
|
+
|
|
|
|
+IFS=$'\n'
|
|
|
|
+
|
2018-06-11 11:30:49 +02:00
|
|
|
+is_tumbleweed=false
|
2018-02-14 10:47:53 +01:00
|
|
|
+
|
2018-06-11 11:30:49 +02:00
|
|
|
+if test "$1" = "--suse-release"; then
|
|
|
|
+ if test "$2" -eq 0; then
|
|
|
|
+ is_tumbleweed=true
|
2018-02-14 10:47:53 +01:00
|
|
|
+ fi
|
|
|
|
+ shift 2
|
|
|
|
+fi
|
|
|
|
+
|
2018-06-11 11:30:49 +02:00
|
|
|
+if ! $is_tumbleweed && ! test -e /sbin/modprobe; then
|
2018-02-14 10:47:53 +01:00
|
|
|
+ cat > /dev/null
|
|
|
|
+ exit 0
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+for f in $(grep -E '/lib/modules/.+\.ko$' | grep -v '/lib/modules/[^/]*/kernel/'); do
|
|
|
|
+ flavor=${f#*/lib/modules/}
|
|
|
|
+ flavor=${flavor%%/*}
|
2018-06-11 11:30:49 +02:00
|
|
|
+ if $is_tumbleweed; then
|
2018-02-14 10:47:53 +01:00
|
|
|
+ echo "kernel-uname-r = $flavor"
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
|
|
+ flavor=${flavor##*-}
|
|
|
|
+ /sbin/modprobe --dump-modversions "$f" \
|
|
|
|
+ | sed -r -ne "s/^0x0*([0-9a-f]+)[[:blank:]]+(.+)/ksym($flavor:\\2) = \\1/p"
|
|
|
|
+done | sort -u
|