packages: geninitrd/geninitrd.spec, geninitrd/geninitrd-svn.patch - rel 2; =?UTF-8?Q?=20?=...

arekm arekm at pld-linux.org
Wed Mar 28 10:23:37 CEST 2012


Author: arekm                        Date: Wed Mar 28 08:23:37 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 2; module-init-tools needs old find_modules_by_class version

---- Files affected:
packages/geninitrd:
   geninitrd.spec (2.202 -> 2.203) , geninitrd-svn.patch (2.13 -> 2.14) 

---- Diffs:

================================================================
Index: packages/geninitrd/geninitrd.spec
diff -u packages/geninitrd/geninitrd.spec:2.202 packages/geninitrd/geninitrd.spec:2.203
--- packages/geninitrd/geninitrd.spec:2.202	Mon Mar 26 20:48:25 2012
+++ packages/geninitrd/geninitrd.spec	Wed Mar 28 10:23:32 2012
@@ -8,7 +8,7 @@
 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
@@ -97,7 +97,7 @@
 %patch0 -p1
 %patch1 -p1
 %endif
-#%patch2 -p0
+%patch2 -p0
 
 %build
 %{__make}
@@ -131,6 +131,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 2.203  2012/03/28 08:23:32  arekm
+- rel 2; module-init-tools needs old find_modules_by_class version
+
 Revision 2.202  2012/03/26 18:48:25  arekm
 - up to 12517
 

================================================================
Index: packages/geninitrd/geninitrd-svn.patch
diff -u packages/geninitrd/geninitrd-svn.patch:2.13 packages/geninitrd/geninitrd-svn.patch:2.14
--- packages/geninitrd/geninitrd-svn.patch:2.13	Thu Feb 16 11:05:59 2012
+++ packages/geninitrd/geninitrd-svn.patch	Wed Mar 28 10:23:32 2012
@@ -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]; };
++					}
++	'
++}
++
+
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/geninitrd/geninitrd.spec?r1=2.202&r2=2.203
    http://cvs.pld-linux.org/packages/geninitrd/geninitrd-svn.patch?r1=2.13&r2=2.14



More information about the pld-cvs-commit mailing list