]> git.pld-linux.org Git - packages/geninitrd.git/commitdiff
- rel 2; module-init-tools needs old find_modules_by_class version auto/th/geninitrd-12517-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 28 Mar 2012 08:23:32 +0000 (08:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    geninitrd-svn.patch -> 2.14
    geninitrd.spec -> 2.203

geninitrd-svn.patch
geninitrd.spec

index 758120328ba5e64fcccb5c2923bc09f8db99fded..a2efb9f569c9797630515e257f160d35b5186376 100644 (file)
@@ -1,15 +1,85 @@
-Index: geninitrd
+Index: functions
 ===================================================================
---- geninitrd  (wersja 12474)
-+++ geninitrd  (kopia robocza)
-@@ -792,8 +792,8 @@
-                               if (c ~ "^" dev_pattern "$") partition = c;
                      }
+--- functions  (wersja 12519)
++++ functions  (kopia robocza)
+@@ -167,10 +167,21 @@
+       printf "/dev/mapper/%s" $(dm_name "$node")
+ }
  
--                      $4 ~ partition { maj = $1; min = $2; }
--                      $1 ~ maj && $2 ~ min { partition = $4; }
-+                      $4 == partition { maj = $1; min = $2; }
-+                      $1 == maj && $2 == min { partition = $4; }
+-# find modules by class eg
++# find modules by class
+ # find_modules_by_class 0106 - finds modules for SATA devices in the system
+ # find_modules_by_class 0c03 - finds modules for USB controllers
+ find_modules_by_class() {
++      if (modprobe --version | grep -q "^kmod"); then
++              find_modules_by_class_kmod $@
++      else
++              find_modules_by_class_mit $@
++      fi
++}
++
++# find modules by class (kmod version)
++# find_modules_by_class 0106 - finds modules for SATA devices in the system
++# find_modules_by_class 0c03 - finds modules for USB controllers
++find_modules_by_class_kmod() {
+       local req_class="$1" i j modaliases
  
-                       END {
-                               if (maj >= 0 && min >= 0) {
+       if [ ! -d "/sys/devices" ]; then
+@@ -206,3 +217,56 @@
+               }
+       '
+ }
++
++# find modules by class (module-init-tools version)
++# find_modules_by_class 0106 - finds modules for SATA devices in the system
++# find_modules_by_class 0c03 - finds modules for USB controllers
++find_modules_by_class_mit() {
++      local req_class="$1"
++
++      pcimap="/lib/modules/$kernel/modules.pcimap"
++
++      lspci=$(find_tool /sbin/lspci)
++      if [ ! -x "$lspci" ]; then
++              warn "Failed to execute lspci. Is pciutils package installed?"
++      fi
++
++      # no pcimap, nothing to lookup from
++      if [ ! -f "$pcimap" ]; then
++                      warn "No $pcimap file. Cannot find modules for desired class!"
++              return
++      fi
++
++      if [ -z "$lspci" ]; then
++              return
++      fi
++
++      LC_ALL=C lspci -p "$pcimap" -kvmmn | awk -vreq_class="${req_class}" '
++                                      BEGIN      { skip_modules[notexisting_module]=""; modules[1]=""; xhci=""; ehci=""; ohci=""; uhci="" }
++                                      /^Slot:/   { found=0 }
++                                      /^Class:/  { if (req_class == $2) { found=1 } }
++                                      /^Driver:/ { if (found) {
++                                                              module=$2;
++                                                              if (module == "xhci_hcd") {
++                                                                      xhci="xhci_hcd"
++                                                              } else if (module == "ehci_hcd") {
++                                                                      ehci="ehci_hcd"
++                                                              } else if (module == "ohci_hcd") {
++                                                                      ohci="ohci_hcd"
++                                                              } else if (module == "uhci_hcd") {
++                                                                      uhci="uhci_hcd"
++                                                              } else if (!(module in skip_modules)) {
++                                                                      modules[cnt]=module
++                                                              }
++                                                              skip_modules[module]=1;
++                                                 };
++                                                 found=0
++                                      }
++                                      END { 
++                                                 # xhci/ehci/ohci/uhci hack to preserve such order
++                                                 printf "%s %s %s %s ", xhci, ehci, ohci, uhci;
++                                                 for (i in modules) { printf "%s ", modules[i]; };
++                                      }
++      '
++}
++
+
index dd2e588d8350661c617c4ebddfc9f440a38e5927..e080937f64284ee0850fc2e6a309048208b70c97 100644 (file)
@@ -7,7 +7,7 @@ Summary:        Creates an initial ramdisk image for preloading modules
 Summary(pl.UTF-8):     Narzędzie do tworzenia inicjalnego ramdysku używanego przy starcie systemu
 Name:          geninitrd
 Version:       12517
-Release:       1
+Release:       2
 License:       GPL
 Group:         Applications/System
 Source0:       %{name}-%{version}.tar.gz
@@ -96,7 +96,7 @@ bieżących informacji zawartych w /etc/modules.conf.
 %patch0 -p1
 %patch1 -p1
 %endif
-#%patch2 -p0
+%patch2 -p0
 
 %build
 %{__make}
This page took 0.111033 seconds and 4 git commands to generate.