Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15
rpm.9967
findksyms.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File findksyms.diff of Package rpm.9967
diff -urN ./scripts/Makefile.am ./scripts/Makefile.am --- ./scripts/Makefile.am 2018-12-22 12:20:02.610172159 +0100 +++ ./scripts/Makefile.am 2018-12-22 12:23:16.393499927 +0100 @@ -19,6 +19,7 @@ tgpg vpkg-provides.sh \ 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 \ pkgconfigdeps.sh libtooldeps.sh metainfo.prov \ @@ -37,6 +38,7 @@ find-lang.sh find-requires find-provides \ perl.prov perl.req pythondeps.sh pythondistdeps.py \ python-macro-helper \ + find-requires.ksyms find-provides.ksyms \ metainfo.prov \ mono-find-requires mono-find-provides \ pkgconfigdeps.sh libtooldeps.sh \ --- ./scripts/find-provides.ksyms 1970-01-01 01:00:00.000000000 +0100 +++ ./scripts/find-provides.ksyms 2018-12-22 12:23:44.013974187 +0100 @@ -0,0 +1,94 @@ +#! /bin/bash + +IFS=$'\n' + +is_tumbleweed=false + +if test "$1" = "--tumbleweed"; then + if test "$2" -gt 0; then + is_tumbleweed=true + fi + shift 2 +fi + +if ! $is_tumbleweed; 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} + version=${flavor} + inst_prefix="$(dirname $f)" + inst_prefix="$(dirname $inst_prefix)" + echo "kernel-uname-r = $version" + builtin="$inst_prefix/lib/modules/$version/modules.builtin" + if [ -e "$builtin" ] ; then + while read mod ; do + echo "kmod($(basename "$mod" .ko))" + done < "$builtin" + else + echo "Builtin modules for $f not available in $builtin" >&2 + fi + flavor=${flavor##*-} + ;; + */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz) + is_module="1" + modname="${f%%.gz}" + modname="$(basename "$modname" .ko)" + echo "kmod($modname)" + ;; + *) + continue + esac + if $is_tumbleweed; 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 diff -urN ./scripts/find-requires.ksyms ./scripts/find-requires.ksyms --- ./scripts/find-requires.ksyms 1970-01-01 01:00:00.000000000 +0100 +++ ./scripts/find-requires.ksyms 2018-12-22 12:23:16.365499446 +0100 @@ -0,0 +1,76 @@ +#! /bin/bash + +IFS=$'\n' + +case "$1" in +kernel-module-*) ;; # Fedora kernel module package names start with + # kernel-module. +kernel*) is_kernel_package=1 ;; +esac + +is_tumbleweed=false + +if test "$1" = "--tumbleweed"; then + if test "$2" -gt 0; then + is_tumbleweed=true + fi + shift 2 +fi + +if [ -n "$is_kernel_package" ] || ! test -e /sbin/modprobe || ! test -e /sbin/modinfo ; then + cat > /dev/null + exit 0 +fi + +modules=($(grep -E '/lib/modules/.+\.ko$')) +if $is_tumbleweed; then + for module in "${modules[@]}"; do + flavor=${module#*/lib/modules/} + flavor=${flavor%%/*} + flavor=${flavor##*-} + echo "kernel-uname-r = $flavor" + done + exit 0 +fi + +all_provides() { + for module in "${modules[@]}"; do + nm "$module" + done \ + | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):\1\t\2:p' \ + | sort -t $'\t' -k2 -u +} + +all_requires() { + for module in "${modules[@]}"; do + set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q) + /sbin/modprobe --dump-modversions "$module" \ + | sed -r -e 's:^0x0*::' -e 's:$:\t'"$1"':' + done \ + | sort -t $'\t' -k2 -u +} + +if [ ${#modules[@]} -gt 0 ]; then + symset_table=$(mktemp -t ${0##*/}.XXXXX) + /usr/lib/rpm/symset-table | sort -t $'\t' -k 1,1 > $symset_table + + 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 } + ' \ + | sort -t $'\t' -k 1,1 -u) \ + | sort -u \ + | awk ' + { FS = "\t" ; OFS = "\t" } + { split($1, arr, "/") + flavor = gensub(/.*-/, "", "", arr[1]) } + NF == 3 { print "kernel(" flavor ":" $2 ") = " $3 + next } + { print "ksym(" flavor ":" arr[3] ") = " arr[2] } + ' +fi
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor