Hello community, here is the log from the commit of package module-init-tools for openSUSE:Factory checked in at Fri Jan 23 23:44:19 CET 2009. -------- --- module-init-tools/module-init-tools.changes 2009-01-06 13:39:29.000000000 +0100 +++ /mounts/work_src_done/STABLE/module-init-tools/module-init-tools.changes 2009-01-23 16:40:37.000000000 +0100 @@ -1,0 +2,8 @@ +Fri Jan 23 16:38:58 CET 2009 - mmarek@suse.cz + +- weak-modules2: + - check if symbol checksums match (it turns out that depmod + doesn't do this) (bnc#467902) + - fixed a syntax error (bnc#467790) + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ module-init-tools.spec ++++++ --- /var/tmp/diff_new_pack.h22921/_old 2009-01-23 23:44:05.000000000 +0100 +++ /var/tmp/diff_new_pack.h22921/_new 2009-01-23 23:44:05.000000000 +0100 @@ -21,7 +21,7 @@ Name: module-init-tools BuildRequires: zlib-devel Version: 3.4 -Release: 61 +Release: 63 License: GPL v2 or later Group: System/Kernel # for grepping /etc/SUSE-release @@ -171,6 +171,11 @@ /etc/modprobe.d %changelog +* Fri Jan 23 2009 mmarek@suse.cz +- weak-modules2: + - check if symbol checksums match (it turns out that depmod + doesn't do this) (bnc#467902) + - fixed a syntax error (bnc#467790) * Tue Jan 06 2009 mmarek@suse.cz - do not automatically mount binfmt_misc on module load, it causes a mount deadlock when the kernel autoloads binfmt_misc when the ++++++ weak-modules2 ++++++ --- /var/tmp/diff_new_pack.h22921/_old 2009-01-23 23:44:06.000000000 +0100 +++ /var/tmp/diff_new_pack.h22921/_new 2009-01-23 23:44:06.000000000 +0100 @@ -104,6 +104,75 @@ )" } +# Compute the kernel release of a module. +krel_of_module() { + declare module=$1 + set -- $(/sbin/modinfo -F vermagic "$module") + echo "$1" +} + +NM= +if command -v nm >/dev/null; then + NM=nm +elif command -v eu-nm >/dev/null; then + NM=eu-nm +else + echo "ERROR: nm not found" >&2 + exit 1 +fi + +# Check if MODULE is compatible with kernel release KREL. +module_is_compatible() { + local module=$1 krel=$2 basedir=$3 + local module_krel=$(krel_of_module "$module") + + # Symbols exported by the kernel itself + if [ ! -e $tmpdir/symvers-$krel ]; then + if [ -e /boot/symvers-$krel.gz ]; then + zcat /boot/symvers-$krel.gz \ + | sed -r -ne 's:^0x0*([0-9a-f]+\t[0-9a-zA-Z_]+)\t.*:\1:p' + fi > $tmpdir/symvers-$krel + fi + + # Symbols exported by KMPs + for dir in $basedir/lib/modules/$krel/{updates,extra,weak-updates}; do + test -d "$dir" || continue + find "$dir" -name '*.ko' | while read f; do + test "$f" -ef "$module" && continue + $NM -B "$f" + done | sed -nre 's:^0*([0-9a-f]+) A __crc_(.*):\1 \2:p' + done > $tmpdir/extra-symvers + + sort -u $tmpdir/symvers-$krel $tmpdir/extra-symvers > $tmpdir/all-symvers + + # If the module does not have modversions enabled, $tmpdir/modvers + # will be empty. + /sbin/modprobe --dump-modversions "$module" \ + | sed -r -e 's:^0x0*([0-9a-f]+\t.*):\1:' \ + | sort -u \ + > $tmpdir/modvers + + # Only include lines of the second file in the output that don't + # match lines in the first file. (The default separator is + # <space>, so we are matching the whole line.) + join -j 1 -v 2 $tmpdir/all-symvers $tmpdir/modvers > $tmpdir/join + + if [ ! -s $tmpdir/modvers ]; then + echo "Warning: Module ${module##*/} from kernel $module_krel has no" \ + "modversions, so it cannot be reused for kernel $krel" >&2 + elif [ -s $tmpdir/join ]; then + [ -n "$verbose" ] && + echo "Module ${module##*/} from kernel $module_krel is not compatible" \ + "with kernel $krel in symbols:" $(sed -e 's:.* ::' $tmpdir/join) + elif [ "$krel" != "$module_krel" ]; then + [ -n "$verbose" ] && + echo "Module ${module##*/} from kernel $module_krel is compatible" \ + "with kernel $krel" + return 0 + fi + return 1 +} + # Check for unresolved symbols has_unresolved_symbols() { local krel=$1 basedir=$2 output status @@ -117,9 +186,18 @@ fi if [ $status -ne 0 ]; then return 0 - else - return 1 fi + + # HACK HACK HACK - depmod doesn't check symbol _versions_, so check + # modules in weak-updates the old way (nm and symvers files) + # The proper fix is to teach depmod about modversions of course + while read module; do + if ! module_is_compatible "$module" "$krel" "$basedir"; then + return 0 + fi + done < <(find "$basedir/lib/modules/$krel/weak-updates" -name '*.ko') + + return 1 } # KMPs can only be added if none of the module basenames overlap @@ -225,7 +303,7 @@ [ "${old_kmp%-*-*}" != "${new_kmp%-*-*}" ] || return # The other kmp must be older [ "$(grep -n "$old_kmp" $tmpdir/kmps)" -gt \ - "$(grep -n "$new_kmp" $tmpdir/kmps)"] || return + "$(grep -n "$new_kmp" $tmpdir/kmps)" ] || return done < $tmpdir/modules-$new_kmp echo "$old_kmp" } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org