blob: f378ec31486136a2dfb5f8835f2a2d5217c204ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/sh
provideslist=`sed "s/['\"]/\\\&/g"`
modulelist=$(echo "$provideslist" | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.gz)?$')
echo $modulelist | xargs -r /sbin/modinfo | \
perl -lne '
$name = $1 if m!^filename:.*\b([^/]+)\.k?o!;
$ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/;
if (/^srcversion:/) {
print "kmod\($name\) = $ver" if $name && $ver;
undef $name, $ver;
}
'
|