-
Notifications
You must be signed in to change notification settings - Fork 0
/
KERN__ListModules_Details.sh
136 lines (112 loc) · 2.91 KB
/
KERN__ListModules_Details.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/sh
TMP=/tmp/`basename "$0" ".sh" `.tmp
Filt=0
showMin=0
showAlias=0
showSignature=0
showBasic=0
doSrch=0
sParm=""
while [ $# -gt 0 ]
do
case $1 in
--min ) Filt=1 ; showMin=1 ; showSignature=0 ; showBasic=0 ; shift ;;
--alias ) Filt=1 ; showAlias=1 ; shift ;;
--sign ) Filt=1 ; showSignature=1 ; showBasic=0 ; shift ;;
--basic ) Filt=1 ; showBasic=1 ; showMin=1 ; showSignature=0 ; shift ;;
--search ) doSrch=1 ; sParm="$2" ; shift ; shift ;;
* ) echo "\n\t Invalid option used on command line. Unable to proceed.\n Bye!\n" ; exit 1 ;;
esac
done
#alias:
#Bit
#firmware:
infoAll()
{
modinfo ${module}
}
infoFiltered()
{
modinfo ${module} 2>&1 | awk -v mMin="${showMin}" -v mBasic="${showBasic}" -v mSign="${showSignature}" -v mAlias="${showAlias}" -v gSrc="${doSrch}" -v sP="${sParm}" '{
if( $1 == "name:" ){
print $0 ;
mdString=$2 ;
} ;
if( $1 == "filename:" ){
print $0 ;
fnString=$2 ;
} ;
if( $1 == "version:" ){ print $0 ; } ;
if( $1 == "description:" ){
print $0 ;
dsString=substr($0,17) ;
} ;
if( mBasic == 1 ){
if( $1 == "author:" ){ print $0 ; } ;
if( $1 == "license:" ){ print $0 ; } ;
if( $1 == "srcversion:" ){ print $0 ; } ;
if( $1 == "depends:" ){ print $0 ; } ;
if( $1 == "retpoline:" ){ print $0 ; } ;
if( $1 == "intree:" ){ print $0 ; } ;
if( $1 == "vermagic:" ){ print $0 ; } ;
if( $1 == "parm:" ){ print $0 ; } ;
} ;
if( mSign == 1 ){
if( $1 == "sig_id:" ){ print $0 ; } ;
if( $1 == "signer:" ){ print $0 ; } ;
if( $1 == "sig_key:" ){ print $0 ; } ;
if( $1 == "sig_hashalgo:" ){ print $0 ; } ;
if( $1 == "signature:" ){ print $0 ; } ;
dat=substr($1,3,1) ;
if( dat == ":" ){
print $0 ;
} ;
} ;
if( mAlias == 1 ){
if( $1 == "alias:" ){ print $0 ; } ;
} ;
if( $1 != "filename:" && $1 != "description:" && $1 == "version:" && $1 != "author:" && $1 != "license:" && $1 != "srcversion:" && $1 != "depends:" && $1 != "retpoline:" && $1 != "intree:" && $1 != "name:" && $1 != "vermagic:" && $1 == "parm:" && $1 != "sig_id:" && $1 != "signer:" && $1 != "sig_key:" && $1 != "sig_hashalgo:" && $1 != "signature:" && $1 != "parm:" && $1 != "alias:" ){
dat=substr($1,3,1) ;
if( dat != ":" ){
print $0 ;
} ;
} ;
}END{
if( gSrc == 1 ){
if ( index(fnString,sP) != 0 || index(dsString,sP) != 0 ){
printf("MATCH[%s]%s\nMATCH[%s]%s\n\n", mdString , fnString , mdString, dsString ) | "cat 1>&2" ;
} ;
} ;
}'
}
### sed -e 's/^[ \t]*//'
for module in `lsmod | awk '{print $1 }' | tail -n +2 | sort `
do
echo "\n========================================\n${module}|MODULE"
if [ ${Filt} -eq 1 ]
then
infoFiltered
else
infoAll
fi
done
#done | awk '{ print $1 }' | grep -v '^[0-9A-F][0-9A-F]:' | sort | uniq
exit 0
exit 0
exit 0
#filename:
#description:
#author:
#license:
#srcversion:
#depends:
#retpoline:
#intree:
#name:
#vermagic:
#sig_id:
#signer:
#sig_key:
#sig_hashalgo:
#signature:
#parm: