2009-01-29 22:24:24 +01:00
|
|
|
Index: scripts/find-supplements.ksyms
|
|
|
|
===================================================================
|
2006-12-19 00:17:44 +01:00
|
|
|
--- scripts/find-supplements.ksyms
|
2006-12-19 00:17:44 +01:00
|
|
|
+++ scripts/find-supplements.ksyms
|
2006-12-19 00:17:44 +01:00
|
|
|
@@ -1,5 +1,6 @@
|
2006-12-19 00:17:44 +01:00
|
|
|
#! /bin/sh
|
|
|
|
|
2006-12-19 00:17:44 +01:00
|
|
|
+RPM_SOURCE_DIR=/usr/src/packages/SOURCES
|
2006-12-19 00:17:44 +01:00
|
|
|
IFS=$'\n'
|
|
|
|
|
|
|
|
case "$1" in
|
2006-12-19 00:17:44 +01:00
|
|
|
@@ -46,11 +47,43 @@ combine_modaliases() {
|
2009-01-29 22:24:24 +01:00
|
|
|
print_modaliases "$class" "$variants" "$pos"
|
2006-12-19 00:17:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
-for module in $(grep -E '/lib/modules/.+\.ko$'); do
|
|
|
|
- vermagic=$(/sbin/modinfo -F vermagic "$module")
|
|
|
|
- krel=${vermagic%% *}
|
|
|
|
- /sbin/modinfo -F alias "$module" \
|
|
|
|
- | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
|
|
|
|
-done \
|
|
|
|
+aliases_of_filelist() {
|
|
|
|
+ for module in $(grep -E '/lib/modules/.+\.ko$'); do
|
|
|
|
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
|
|
|
|
+ krel=${vermagic%% *}
|
|
|
|
+ /sbin/modinfo -F alias "$module" \
|
2006-12-19 00:17:44 +01:00
|
|
|
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
|
2006-12-19 00:17:44 +01:00
|
|
|
+ done
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+aliases_of_specfile_macro() {
|
|
|
|
+ declare regex
|
|
|
|
+
|
|
|
|
+ regex=$(
|
|
|
|
+ set -o noglob
|
|
|
|
+ set -- $(sed -ne 's:^%supplements_kernel_module[ \t]::p' \
|
2006-12-19 00:17:44 +01:00
|
|
|
+ $RPM_SOURCE_DIR/$1.spec)
|
2006-12-19 00:17:44 +01:00
|
|
|
+ while [ $# -ge 1 ]; do
|
|
|
|
+ regex=$(echo "$1" \
|
|
|
|
+ | sed -e 's:[.]:\\.:g' \
|
|
|
|
+ -e 's:?:.:g' \
|
|
|
|
+ -e 's:\*:.*:g' \
|
|
|
|
+ -e 's:\\:\\\\:g')
|
|
|
|
+ echo -n "^$regex\$"
|
|
|
|
+ [ $# -ge 2 ] && echo -n "|"
|
|
|
|
+ shift
|
|
|
|
+ done
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ if [ -n "$regex" ]; then
|
|
|
|
+ awk '
|
|
|
|
+ $1 == "alias" && $3 ~ regex { print $2 }
|
|
|
|
+ ' regex="$regex" /lib/modules/*/modules.alias
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+( aliases_of_filelist
|
|
|
|
+ aliases_of_specfile_macro "$1"
|
|
|
|
+) \
|
|
|
|
| sort -u \
|
|
|
|
| combine_modaliases
|