/* XPM */
static char * step_red_on_xpm[] = {
"21 21 180 2",
"  	c None",
". 	c #EFEFFF",
"+ 	c #EDEDFF",
"@ 	c #EBEBFF",
"# 	c #E9E9FF",
"$ 	c #E6E6FF",
"% 	c #E3E3FF",
"& 	c #F0F0FF",
"* 	c #E2E2FF",
"= 	c #DFDFFF",
"- 	c #DDDDFF",
"; 	c #D9D9FF",
"> 	c #D2D2FF",
", 	c #CFCFFF",
"' 	c #D9C1E7",
") 	c #EA9FB4",
"! 	c #DBB7DA",
"~ 	c #D6D6FF",
"{ 	c #D1D1FF",
"] 	c #E8E8FF",
"^ 	c #DCDCFF",
"/ 	c #CDCDFF",
"( 	c #CCCCFF",
"_ 	c #CECAFB",
": 	c #EBB0C4",
"< 	c #FB676C",
"[ 	c #D0A3C8",
"} 	c #CECEFF",
"| 	c #D0D0FF",
"1 	c #C0C0F1",
"2 	c #DFD4F4",
"3 	c #D2CCF9",
"4 	c #CECBFC",
"5 	c #CCCCFE",
"6 	c #DBC1E4",
"7 	c #FC999C",
"8 	c #FC4245",
"9 	c #C797BA",
"0 	c #BFBFEE",
"a 	c #A2A2CA",
"b 	c #EBABC0",
"c 	c #EAB2C7",
"d 	c #E2B4D1",
"e 	c #DDBDDF",
"f 	c #DDC1E3",
"g 	c #F3AEBB",
"h 	c #FF8181",
"i 	c #F73638",
"j 	c #CD829E",
"k 	c #C4C4F5",
"l 	c #9A9AC0",
"m 	c #E1E1FF",
"n 	c #E690A9",
"o 	c #FF6B6B",
"p 	c #FF8282",
"q 	c #FB9195",
"r 	c #FB989C",
"s 	c #FF8383",
"t 	c #FF5E5E",
"u 	c #FF3636",
"v 	c #EE5A67",
"w 	c #DAABD0",
"x 	c #D1C4F2",
"y 	c #CDCAFC",
"z 	c #C6C6F8",
"A 	c #9898BD",
"B 	c #757592",
"C 	c #DEDEFF",
"D 	c #CDC5F6",
"E 	c #D9758B",
"F 	c #FD3333",
"G 	c #FF4E4E",
"H 	c #FF5757",
"I 	c #FF4040",
"J 	c #FF3D3D",
"K 	c #FF4747",
"L 	c #F76D75",
"M 	c #ED8FA1",
"N 	c #E795AD",
"O 	c #E08CAA",
"P 	c #9C9CC3",
"Q 	c #686881",
"R 	c #DADAFF",
"S 	c #CEC0EF",
"T 	c #E76677",
"U 	c #FF3838",
"V 	c #FF3535",
"W 	c #FF3434",
"X 	c #FC3232",
"Y 	c #F33131",
"Z 	c #E62E2E",
"` 	c #D82B2B",
" .	c #C0292A",
"..	c #B55463",
"+.	c #9A9AC1",
"@.	c #5B5B71",
"#.	c #D4D4FF",
"$.	c #DFA4C4",
"%.	c #FF5858",
"&.	c #FF3F3F",
"*.	c #FF3333",
"=.	c #B42424",
"-.	c #7D1F21",
";.	c #834856",
">.	c #A382A1",
",.	c #B8A8D1",
"'.	c #8B8BAD",
").	c #525266",
"!.	c #CEC9FA",
"~.	c #ED9BAD",
"{.	c #FF6161",
"].	c #F53131",
"^.	c #EB2F2F",
"/.	c #F03030",
"(.	c #D12A2A",
"_.	c #912A2F",
":.	c #9D7792",
"<.	c #C0B6E3",
"[.	c #CCCBFE",
"}.	c #BABAE9",
"|.	c #CBCBFE",
"1.	c #D8BCE3",
"2.	c #FD696A",
"3.	c #D62B2B",
"4.	c #9A1F1F",
"5.	c #A82121",
"6.	c #CA2828",
"7.	c #C52727",
"8.	c #9C3F49",
"9.	c #BDABD5",
"0.	c #C8C8FA",
"a.	c #A7A7D1",
"b.	c #59596F",
"c.	c #BCBCEB",
"d.	c #C2C2F2",
"e.	c #CEBCE7",
"f.	c #F4616B",
"g.	c #BB2525",
"h.	c #864C5C",
"i.	c #9F7B98",
"j.	c #A67C98",
"k.	c #AC3F47",
"l.	c #BC2525",
"m.	c #A8414B",
"n.	c #C2A9D1",
"o.	c #CACAFD",
"p.	c #7B7B9A",
"q.	c #ABABD5",
"r.	c #C6A0C5",
"s.	c #C17086",
"t.	c #B396BA",
"u.	c #C5C0EF",
"v.	c #CAC8FA",
"w.	c #CBC9FB",
"x.	c #C4A5CD",
"y.	c #AF393F",
"z.	c #992A2D",
"A.	c #BC9BC1",
"B.	c #BEBEED",
"C.	c #9090B4",
"D.	c #9C97BE",
"E.	c #B5B2DE",
"F.	c #C6C5F6",
"G.	c #C096B8",
"H.	c #8E3D48",
"I.	c #A7809D",
"J.	c #8F8EB1",
"K.	c #737390",
"L.	c #7F7F9F",
"M.	c #B1B1DD",
"N.	c #B6B6E4",
"O.	c #9F9FC7",
"P.	c #72728E",
"Q.	c #55556A",
"R.	c #535368",
"S.	c #5F5F76",
"T.	c #6E6E89",
"U.	c #767693",
"V.	c #6D6D89",
"W.	c #58586E",
"                                          ",
"              . + @ # $ %                 ",
"          & . @ $ * = = = - ;             ",
"        . @ * ; > , ' ) ! ~ ~ {           ",
"      + ] ^ > / ( _ : < [ } | , 1         ",
"    # ] 2 3 4 ( 5 6 7 8 9 ( / } 0 a       ",
"    $ = b c d e f g h i j ( ( / k l       ",
"  m m ~ n o p q r s t u v w x y z A B     ",
"  C - { D E F G H G I J K L M N O P Q     ",
"  R ; , ( S T U U V W X Y Z `  ...+.@.    ",
"  ~ #./ ( ( $.%.&.*.X Z =.-.;.>.,.'.).    ",
"  { { / ( !.~.{.].^./.(._.:.<.[.}.B ).    ",
"  / / ( |.1.2.3.4.5.6.7.8.9.( 0.a.b.).    ",
"    c.d.e.f.g.h.i.j.k.l.m.n.o.}.p.).      ",
"    a.q.r.s.t.u.v.w.x.y.z.A.B.C.).).      ",
"      C.D.E.F.|.( ( [.G.H.I.J.).).        ",
"        K.L.+.M.0 k 1 N.O.P.).).          ",
"          Q.R.S.T.U.V.W.).).).            ",
"              ).).).).).).                ",
"                                          ",
"                                          "};
-systemd'>user/colin/rescue-systemd</option>
<option value='user/ennael/mga6'>user/ennael/mga6</option>
<option value='user/erwan/bug-13680'>user/erwan/bug-13680</option>
<option value='user/jibz/aarch64'>user/jibz/aarch64</option>
<option value='user/martinw/mga6'>user/martinw/mga6</option>
<option value='user/pterjan/arm64'>user/pterjan/arm64</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Mageia Installer and base platform for many utilities</td><td class='sub right'>Thierry Vignaud [tv]</td></tr></table>
<table class='tabs'><tr><td>
<a href='/software/drakx/?h=18.26'>summary</a><a href='/software/drakx/refs/?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>refs</a><a href='/software/drakx/log/perl-install/share/verify_modules.pl?h=18.26'>log</a><a class='active' href='/software/drakx/tree/perl-install/share/verify_modules.pl?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>tree</a><a href='/software/drakx/commit/perl-install/share/verify_modules.pl?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>commit</a><a href='/software/drakx/diff/perl-install/share/verify_modules.pl?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>diff</a><a href='/software/drakx/stats/perl-install/share/verify_modules.pl?h=18.26'>stats</a></td><td class='form'><form class='right' method='get' action='/software/drakx/log/perl-install/share/verify_modules.pl'>
<input type='hidden' name='h' value='18.26'/><input type='hidden' name='id' value='79e4c3a92d3ca7f21c0233b0f1c056255880280d'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/software/drakx/tree/?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>root</a>/<a href='/software/drakx/tree/perl-install?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>perl-install</a>/<a href='/software/drakx/tree/perl-install/share?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>share</a>/<a href='/software/drakx/tree/perl-install/share/verify_modules.pl?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>verify_modules.pl</a></div><div class='content'>blob: 52b6ae8fcfc015abf0828360f408ab8d43cd621b (<a href='/software/drakx/plain/perl-install/share/verify_modules.pl?h=18.26&amp;id=79e4c3a92d3ca7f21c0233b0f1c056255880280d'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
<a id='n21' href='#n21'>21</a>
<a id='n22' href='#n22'>22</a>
<a id='n23' href='#n23'>23</a>
<a id='n24' href='#n24'>24</a>
<a id='n25' href='#n25'>25</a>
<a id='n26' href='#n26'>26</a>
<a id='n27' href='#n27'>27</a>
<a id='n28' href='#n28'>28</a>
<a id='n29' href='#n29'>29</a>
<a id='n30' href='#n30'>30</a>
<a id='n31' href='#n31'>31</a>
<a id='n32' href='#n32'>32</a>
<a id='n33' href='#n33'>33</a>
<a id='n34' href='#n34'>34</a>
<a id='n35' href='#n35'>35</a>
<a id='n36' href='#n36'>36</a>
<a id='n37' href='#n37'>37</a>
<a id='n38' href='#n38'>38</a>
<a id='n39' href='#n39'>39</a>
<a id='n40' href='#n40'>40</a>
<a id='n41' href='#n41'>41</a>
<a id='n42' href='#n42'>42</a>
<a id='n43' href='#n43'>43</a>
<a id='n44' href='#n44'>44</a>
<a id='n45' href='#n45'>45</a>
<a id='n46' href='#n46'>46</a>
<a id='n47' href='#n47'>47</a>
<a id='n48' href='#n48'>48</a>
<a id='n49' href='#n49'>49</a>
<a id='n50' href='#n50'>50</a>
<a id='n51' href='#n51'>51</a>
<a id='n52' href='#n52'>52</a>
<a id='n53' href='#n53'>53</a>
<a id='n54' href='#n54'>54</a>
<a id='n55' href='#n55'>55</a>
<a id='n56' href='#n56'>56</a>
<a id='n57' href='#n57'>57</a>
<a id='n58' href='#n58'>58</a>
<a id='n59' href='#n59'>59</a>
<a id='n60' href='#n60'>60</a>
<a id='n61' href='#n61'>61</a>
<a id='n62' href='#n62'>62</a>
<a id='n63' href='#n63'>63</a>
<a id='n64' href='#n64'>64</a>
<a id='n65' href='#n65'>65</a>
<a id='n66' href='#n66'>66</a>
<a id='n67' href='#n67'>67</a>
<a id='n68' href='#n68'>68</a>
<a id='n69' href='#n69'>69</a>
<a id='n70' href='#n70'>70</a>
<a id='n71' href='#n71'>71</a>
<a id='n72' href='#n72'>72</a>
<a id='n73' href='#n73'>73</a>
<a id='n74' href='#n74'>74</a>
<a id='n75' href='#n75'>75</a>
<a id='n76' href='#n76'>76</a>
<a id='n77' href='#n77'>77</a>
<a id='n78' href='#n78'>78</a>
<a id='n79' href='#n79'>79</a>
<a id='n80' href='#n80'>80</a>
<a id='n81' href='#n81'>81</a>
<a id='n82' href='#n82'>82</a>
<a id='n83' href='#n83'>83</a>
<a id='n84' href='#n84'>84</a>
<a id='n85' href='#n85'>85</a>
<a id='n86' href='#n86'>86</a>
<a id='n87' href='#n87'>87</a>
<a id='n88' href='#n88'>88</a>
<a id='n89' href='#n89'>89</a>
<a id='n90' href='#n90'>90</a>
<a id='n91' href='#n91'>91</a>
<a id='n92' href='#n92'>92</a>
<a id='n93' href='#n93'>93</a>
<a id='n94' href='#n94'>94</a>
<a id='n95' href='#n95'>95</a>
<a id='n96' href='#n96'>96</a>
<a id='n97' href='#n97'>97</a>
<a id='n98' href='#n98'>98</a>
<a id='n99' href='#n99'>99</a>
<a id='n100' href='#n100'>100</a>
<a id='n101' href='#n101'>101</a>
<a id='n102' href='#n102'>102</a>
</pre></td>
<td class='lines'><pre><code><span class="hl slc">#!/usr/bin/perl</span>

<span class="hl kwa">use</span> lib <span class="hl str">&quot;..&quot;</span><span class="hl opt">;</span>
<span class="hl kwa">use</span> common<span class="hl opt">;</span>
<span class="hl kwa">use</span> modules<span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">$all</span> <span class="hl opt">=</span> <span class="hl kwb">$ARGV</span><span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">]</span> <span class="hl kwc">eq</span> <span class="hl str">&apos;-a&apos;</span><span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">%modules</span> <span class="hl opt">=</span> <span class="hl kwc">map</span> <span class="hl opt">{</span>
    <span class="hl kwc">chomp</span><span class="hl opt">;</span>
    <span class="hl kwc">my</span> <span class="hl kwb">&#64;l</span> <span class="hl opt">=</span> <span class="hl kwc">split</span> <span class="hl str">&quot;</span><span class="hl esc">\t</span><span class="hl str">&quot;</span><span class="hl opt">;</span>
    <span class="hl kwc">my</span> <span class="hl kwb">$mod</span> <span class="hl opt">=</span> <span class="hl kwb">$l</span><span class="hl opt">[-</span><span class="hl num">2</span><span class="hl opt">];</span>
    <span class="hl kwb">$mod</span> <span class="hl opt">=~</span> <span class="hl kwd">s/&quot;(.*)&quot;/$1/</span><span class="hl opt">;</span>
    if_<span class="hl opt">(!</span><span class="hl kwd">/^\s*#/</span> <span class="hl opt">&amp;&amp;</span> <span class="hl kwb">$mod</span> <span class="hl opt">!~</span> <span class="hl kwd">/:/</span> <span class="hl opt">&amp;&amp;</span> <span class="hl kwb">$mod</span> <span class="hl kwc">ne</span> <span class="hl str">&apos;unknown&apos;</span><span class="hl opt">,</span> <span class="hl kwb">$mod</span> <span class="hl opt">=&gt;</span> <span class="hl kwb">$l</span><span class="hl opt">[-</span><span class="hl num">1</span><span class="hl opt">])</span>
<span class="hl opt">}</span> <span class="hl kwc">map</span> <span class="hl opt">{</span> cat_<span class="hl opt">(</span><span class="hl str">&quot;/usr/share/ldetect-lst/</span><span class="hl ipl">$_</span><span class="hl str">&quot;</span><span class="hl opt">) }</span> <span class="hl str">&apos;pcitable&apos;</span><span class="hl opt">,</span> <span class="hl str">&apos;usbtable&apos;</span><span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">%l</span><span class="hl opt">;</span>
<span class="hl kwc">my</span> <span class="hl kwb">$kernel</span> <span class="hl opt">=</span> <span class="hl kwb">$all</span> ? <span class="hl str">&apos;/lib/modules&apos;</span> <span class="hl opt">:</span> <span class="hl str">&apos;../../kernel&apos;</span><span class="hl opt">;</span>
<span class="hl kwa">foreach</span> <span class="hl opt">(</span><span class="hl str">`find</span> <span class="hl ipl">$kernel</span> <span class="hl str">-name &quot;*.o&quot; -o -name &quot;*.o.gz&quot;`</span><span class="hl opt">) {</span>
    s<span class="hl opt">|.*</span><span class="hl kwd">/lib/modul</span>es<span class="hl kwd">/.*?/</span><span class="hl opt">||;</span>
    s<span class="hl opt">|</span>kernel<span class="hl kwd">/drivers/</span><span class="hl opt">||;</span>
    m<span class="hl opt">|(.*)/(.*)</span>\<span class="hl opt">.</span>o<span class="hl opt">(</span>\<span class="hl opt">.</span>gz<span class="hl opt">)</span>?<span class="hl opt">$|;</span>
    <span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$2</span><span class="hl opt">} =</span> <span class="hl kwb">$1</span><span class="hl opt">;</span>
<span class="hl opt">}</span>

<span class="hl kwa">foreach</span> <span class="hl opt">(</span><span class="hl kwc">keys</span> <span class="hl kwb">%modules</span><span class="hl opt">) {</span>
    <span class="hl kwc">my</span> <span class="hl kwb">$ktype</span> <span class="hl opt">=</span> <span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">};</span>
    <span class="hl kwc">my</span> <span class="hl kwb">$dtype</span> <span class="hl opt">=</span> <span class="hl kwb">$modules</span><span class="hl opt">::</span>drivers<span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">};</span>
    <span class="hl kwa">if</span> <span class="hl opt">(!</span><span class="hl kwb">$ktype</span> <span class="hl opt">&amp;&amp; !</span><span class="hl kwb">$dtype</span><span class="hl opt">) {</span>
	<span class="hl kwc">print</span> <span class="hl str">&quot;unused module</span> <span class="hl ipl">$_</span> <span class="hl str">(descr</span> <span class="hl ipl">$modules</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">}) (not in modules.pm nor in the kernel)</span><span class="hl esc">\n</span><span class="hl str">&quot;</span><span class="hl opt">;</span>
    <span class="hl opt">}</span> <span class="hl kwa">elsif</span> <span class="hl opt">(!</span><span class="hl kwb">$dtype</span><span class="hl opt">) {</span>
	<span class="hl kwb">$missing</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} =</span> <span class="hl kwb">$ktype</span><span class="hl opt">;</span>
    <span class="hl opt">}</span> <span class="hl kwa">elsif</span> <span class="hl opt">(!</span><span class="hl kwb">$ktype</span><span class="hl opt">) {</span>
	<span class="hl kwb">$unused</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} =</span> <span class="hl kwb">$dtype</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">}</span> 
	  <span class="hl kwa">if</span> <span class="hl opt">!</span>member<span class="hl opt">(</span><span class="hl kwb">$dtype</span><span class="hl opt">-&gt;{</span>type<span class="hl opt">},</span> <span class="hl str">&apos;sound&apos;</span><span class="hl opt">);</span>
    <span class="hl opt">}</span>
<span class="hl opt">}</span>

<span class="hl kwa">foreach</span> <span class="hl opt">(</span><span class="hl kwc">sort keys</span> <span class="hl kwb">%missing</span><span class="hl opt">) {</span>
    <span class="hl kwc">print</span> <span class="hl str">&quot;missing</span> <span class="hl ipl">$_</span> <span class="hl str">in modules.pm (type</span> <span class="hl ipl">$missing</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">}, descr</span> <span class="hl ipl">$modules</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">})</span><span class="hl esc">\n</span><span class="hl str">&quot;</span><span class="hl opt">;</span>
<span class="hl opt">}</span>
<span class="hl kwa">foreach</span> <span class="hl opt">(</span><span class="hl kwc">sort keys</span> <span class="hl kwb">%unused</span><span class="hl opt">) {</span>
    <span class="hl kwc">print</span> <span class="hl str">&quot;unused module</span> <span class="hl ipl">$_</span> <span class="hl str">(type</span> <span class="hl ipl">$unused</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">}) (not in the kernel)</span><span class="hl esc">\n</span><span class="hl str">&quot;</span><span class="hl opt">;</span>
<span class="hl opt">}</span>

__END__
<span class="hl kwc">my</span> <span class="hl kwb">%m</span> <span class="hl opt">=</span> <span class="hl kwb">%l</span><span class="hl opt">;</span>
<span class="hl kwc">my</span> <span class="hl opt">(</span><span class="hl kwb">%missing, %missing2</span><span class="hl opt">);</span>
<span class="hl kwa">while</span> <span class="hl opt">(</span><span class="hl kwc">my</span> <span class="hl opt">(</span><span class="hl kwb">$k, $v</span><span class="hl opt">) =</span> <span class="hl kwc">each</span> <span class="hl kwb">%pci_probing</span><span class="hl opt">::</span>pcitable<span class="hl opt">::</span>ids<span class="hl opt">) {</span>
    <span class="hl kwa">next if</span> <span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">] =~</span> <span class="hl kwd">/^(unknown$|ignore$|Card:|Server:|Bad:)/</span><span class="hl opt">;</span>

    <span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">]}</span> <span class="hl kwc">or</span> <span class="hl kwb">$missing</span><span class="hl opt">{</span><span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">]} =</span> <span class="hl num">1</span><span class="hl opt">;</span>
    <span class="hl kwb">$modules</span><span class="hl opt">::</span>drivers<span class="hl opt">{</span><span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">]}</span> <span class="hl kwc">or push</span> <span class="hl opt">&#64;{</span><span class="hl kwb">$missing2</span><span class="hl opt">{</span><span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">]}},</span> <span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">0</span><span class="hl opt">];</span>
    <span class="hl kwc">delete</span> <span class="hl kwb">$m</span><span class="hl opt">{</span><span class="hl kwb">$v</span><span class="hl opt">-&gt;[</span><span class="hl num">1</span><span class="hl opt">]};</span>
<span class="hl opt">}</span>
<span class="hl kwc">print</span> <span class="hl str">&quot;W: unused entry in modules.pm</span> <span class="hl ipl">$_\n</span><span class="hl str">&quot;</span> 
  <span class="hl kwa">foreach</span> <span class="hl kwc">grep</span> <span class="hl opt">{ !</span><span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} &amp;&amp; !</span><span class="hl kwb">$missing</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">}</span> <span class="hl slc">#- will be reported below</span>
	     <span class="hl opt">}</span> <span class="hl kwc">keys</span> <span class="hl kwb">%modules</span><span class="hl opt">::</span>drivers<span class="hl opt">;</span>

<span class="hl kwc">print</span> qq<span class="hl opt">|</span>W<span class="hl opt">:</span> missing entry <span class="hl kwa">in</span> modules<span class="hl opt">.</span>pm <span class="hl kwa">for</span> <span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">}</span> <span class="hl str">&quot;</span><span class="hl ipl">$_</span><span class="hl str">&quot;</span><span class="hl esc">\n</span><span class="hl opt">|</span> <span class="hl kwa">foreach</span> <span class="hl kwc">grep</span> <span class="hl opt">{ !</span><span class="hl kwb">$modules</span><span class="hl opt">::</span>drivers<span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} }</span> <span class="hl kwc">keys</span> <span class="hl kwb">%l</span><span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">%known</span><span class="hl opt">;</span> <span class="hl kwb">&#64;known</span><span class="hl opt">{</span><span class="hl str">qw(net scsi misc)</span><span class="hl opt">} = ();</span>
<span class="hl kwa">if</span> <span class="hl opt">(</span><span class="hl kwb">$ARGV</span><span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">]</span> <span class="hl kwc">eq</span> <span class="hl str">&quot;-v&quot;</span><span class="hl opt">) {</span>
    <span class="hl kwc">print</span> <span class="hl str">&quot;W: has no pci entry:</span> <span class="hl ipl">$_</span> <span class="hl str"></span><span class="hl esc">\n</span><span class="hl str">&quot;</span> <span class="hl kwa">foreach</span> <span class="hl kwc">grep</span> <span class="hl opt">{</span> <span class="hl kwc">exists</span> <span class="hl kwb">$known</span><span class="hl opt">{</span><span class="hl kwb">$m</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">}} }</span> <span class="hl kwc">keys</span> <span class="hl kwb">%m</span><span class="hl opt">;</span>
<span class="hl opt">}</span>

<span class="hl kwc">print</span> <span class="hl str">&quot;E: missing module</span> <span class="hl ipl">$_\n</span><span class="hl str">&quot;</span> 
  <span class="hl kwa">foreach</span> <span class="hl kwc">grep</span> <span class="hl opt">{</span> <span class="hl kwb">$modules</span><span class="hl opt">::</span>drivers<span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">}{</span>type<span class="hl opt">}</span> <span class="hl kwc">ne</span> <span class="hl str">&quot;sound&quot;</span> <span class="hl slc">#- don&apos;t care about sound modules</span>
	     <span class="hl opt">}</span> <span class="hl kwc">keys</span> <span class="hl kwb">%missing</span><span class="hl opt">;</span>

<span class="hl kwa">foreach</span> <span class="hl opt">(</span><span class="hl kwc">keys</span> <span class="hl kwb">%missing2</span><span class="hl opt">) {</span>
    <span class="hl kwc">print</span> qq<span class="hl opt">|</span>E<span class="hl opt">:</span> missing entry <span class="hl kwa">in</span> modules<span class="hl opt">.</span>pm <span class="hl kwa">for</span> <span class="hl kwb">$l</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">}</span> <span class="hl str">&quot;</span><span class="hl ipl">$_</span><span class="hl str">&quot;</span><span class="hl opt">|;</span>
    <span class="hl kwc">print</span> qq<span class="hl opt">| =&gt;</span> <span class="hl str">&quot;|, join(&quot;</span><span class="hl opt">&lt;&gt;</span><span class="hl str">&quot;, &#64;{</span><span class="hl ipl">$missing2</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">}}), &apos;&quot;</span><span class="hl str">&apos;;</span>
<span class="hl str">    print &quot;</span><span class="hl esc">\n</span><span class="hl str">&quot;;</span>
<span class="hl str">}</span>
<span class="hl str"></span>
<span class="hl str">#exit;</span>
<span class="hl str"></span>
<span class="hl str">my</span> <span class="hl ipl">%devices_c</span> <span class="hl str">= (</span>
<span class="hl str">  net =&gt; &quot;checkEthernetDev, DRIVER_NET, DRIVER_MINOR_ETHERNET&quot;,</span>
<span class="hl str">  scsi =&gt; &quot;checkSCSIDev, DRIVER_SCSI, DRIVER_MINOR_NONE&quot;,</span>
<span class="hl str">  disk =&gt; &quot;checkSCSIDev, DRIVER_SCSI, DRIVER_MINOR_NONE&quot;,</span>
<span class="hl str">  pcmcia =&gt; &quot;NULL, DRIVER_PCMCIA, DRIVER_MINOR_NONE&quot;,</span>
<span class="hl str">  paride =&gt; &quot;NULL, DRIVER_PARIDE, DRIVER_MINOR_NONE&quot;,</span>
<span class="hl str">  cdrom =&gt; &quot;NULL, DRIVER_CDROM, DRIVER_MINOR_NONE&quot;,</span>
<span class="hl str">);</span>
<span class="hl str">my</span> <span class="hl ipl">$devices_c</span> <span class="hl str">= join &quot;|&quot;, keys</span> <span class="hl ipl">%devices_c</span><span class="hl str">;</span>
<span class="hl str"></span>
<span class="hl str">my</span> <span class="hl ipl">%drivers</span> <span class="hl str">=</span> <span class="hl ipl">%modules</span><span class="hl str">::drivers;</span>
<span class="hl str"></span><span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">}{type} =~ /</span><span class="hl ipl">$devices_c/</span> <span class="hl str">or delete</span> <span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">} foreach keys</span> <span class="hl ipl">%drivers</span><span class="hl str">;</span>
<span class="hl str">foreach (cat_(&quot;../../install/devices.c&quot;)) {</span>
<span class="hl str">    if (/static struct driver drivers/ .. /^};/) {</span>
<span class="hl str">	/\s*{\s*&quot;[^&quot;]*&quot;\s*,\s*&quot;(.*)&quot;/ or next;</span>
<span class="hl str">	delete</span> <span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$1</span><span class="hl str">} or print qq|W: unused entry in devices.c</span> <span class="hl ipl">$1\n</span><span class="hl str">|;</span>
<span class="hl str">    }</span>
<span class="hl str">}</span>
<span class="hl str">foreach (sort {</span> <span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$a</span><span class="hl str">}{type} cmp</span> <span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$b</span><span class="hl str">}{type} } keys</span> <span class="hl ipl">%drivers</span><span class="hl str">) {</span>
<span class="hl str">    my (</span><span class="hl ipl">$m,</span> <span class="hl str"></span><span class="hl ipl">$v</span><span class="hl str">) = (</span><span class="hl ipl">$_,</span> <span class="hl str"></span><span class="hl ipl">$drivers</span><span class="hl str">{</span><span class="hl ipl">$_</span><span class="hl str">});</span>
<span class="hl str">    /^(8390|sunrpc|lockd|dummy|st)</span><span class="hl ipl">$/</span> <span class="hl str">and next;</span>
<span class="hl str"></span>
<span class="hl str">    print qq|E: missing entry in devices.c { &quot;</span><span class="hl ipl">$v</span><span class="hl str">-&gt;{text}&quot;, &quot;</span><span class="hl ipl">$m</span><span class="hl str">&quot;, 0,</span> <span class="hl ipl">$devices_c</span><span class="hl str">{</span><span class="hl ipl">$v</span><span class="hl str">-&gt;{type}} }</span><span class="hl esc">\n</span><span class="hl str">|;</span>
<span class="hl str">}</span>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.1</a> (<a href='https://git-scm.com/'>git 2.21.0</a>) at 2025-03-08 10:58:05 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>