]> git.pld-linux.org Git - packages/geninitrd.git/blob - geninitrd-svn.patch
space for separation
[packages/geninitrd.git] / geninitrd-svn.patch
1 Index: functions
2 ===================================================================
3 --- functions   (wersja 12390)
4 +++ functions   (kopia robocza)
5 @@ -189,23 +189,33 @@
6                 return
7         fi
8  
9 -       set -- $($lspci -n | awk -vclass=$req_class '$2 == class":" {split($3, p, ":"); printf("0x0000%s 0x0000%s\n", p[1], p[2])}')
10 -
11 -       req_class="0x${req_class}00"
12 -
13 -       local PCI_ANY_ID=0xffffffff pci_module vendor device subvendor subdevice class class_mask driver_data
14 -       while read pci_module vendor device subvendor subdevice class class_mask driver_data; do
15 -               # ignore program interface (last two digits) - we want any
16 -               class_mask=$(($class_mask & 0xffffff00))
17 -               # some devices (like hcd) have very specific class
18 -               class=$(($class & $class_mask))
19 -               [ "$(($req_class & $class_mask))" = "$class" ] || continue
20 -               # match vendor
21 -               [ "$1" = "$vendor" -o "$vendor" = "$PCI_ANY_ID" ] || continue
22 -               # match device, allow PCI_ANY_ID
23 -               [ "$2" = "$device" -o "$device" = "$PCI_ANY_ID" ] || continue
24 -
25 -               echo "$pci_module"
26 -       done < $pcimap
27 +       lspci -p "$pcimap" -kvmmn | awk -vreq_class="${req_class}" '
28 +                                       BEGIN      { skip_modules[1]=""; modules[1]=""; xhci=""; ehci=""; ohci=""; uhci="" }
29 +                                       /^Slot:/   { found=0 }
30 +                                       /^Class:/  { if (req_class == $2) { found=1 } }
31 +                                       /^Driver:/ { if (found) {
32 +                                                               module=$2;
33 +                                                               if (module == "xhci_hcd") {
34 +                                                                       xhci="xhci_hcd"
35 +                                                               } else if (module == "ehci_hcd") {
36 +                                                                       ehci="ehci_hcd"
37 +                                                               } else if (module == "ohci_hcd") {
38 +                                                                       ohci="ohci_hcd"
39 +                                                               } else if (module == "uhci_hcd") {
40 +                                                                       uhci="uhci_hcd"
41 +                                                               } else if (!(module in skip_modules)) {
42 +                                                                       modules[cnt]=module
43 +                                                               }
44 +                                                               skip_modules[cnt]=module;
45 +                                                               cnt++;
46 +                                                  };
47 +                                                  found=0
48 +                                       }
49 +                                       END { 
50 +                                                  # xhci/ehci/ohci/uhci hack to preserve such order
51 +                                                  printf "%s %s %s %s", xhci, ehci, ohci, uhci;
52 +                                                  for (i in modules) { printf "%s ", modules[i]; };
53 +                                       }
54 +       '
55  }
56  
57 Index: functions
58 ===================================================================
59 --- functions   (wersja 12391)
60 +++ functions   (kopia robocza)
61 @@ -213,7 +213,7 @@
62                                         }
63                                         END { 
64                                                    # xhci/ehci/ohci/uhci hack to preserve such order
65 -                                                  printf "%s %s %s %s", xhci, ehci, ohci, uhci;
66 +                                                  printf "%s %s %s %s ", xhci, ehci, ohci, uhci;
67                                                    for (i in modules) { printf "%s ", modules[i]; };
68                                         }
69         '
This page took 0.111684 seconds and 3 git commands to generate.