]> git.pld-linux.org Git - packages/geninitrd.git/blame - geninitrd-svn.patch
- rel 4; fix strip to work also with compressed modules
[packages/geninitrd.git] / geninitrd-svn.patch
CommitLineData
f5aa6e2b
AM
1Index: functions
2===================================================================
4290db97 3--- functions (wersja 12390)
f5aa6e2b 4+++ functions (kopia robocza)
4290db97
AM
5@@ -189,23 +189,33 @@
6 return
7 fi
f5aa6e2b 8
f5aa6e2b
AM
9- set -- $($lspci -n | awk -vclass=$req_class '$2 == class":" {split($3, p, ":"); printf("0x0000%s 0x0000%s\n", p[1], p[2])}')
10-
4290db97
AM
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
f5aa6e2b 14- while read pci_module vendor device subvendor subdevice class class_mask driver_data; do
4290db97
AM
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
f5aa6e2b 20- # match vendor
4290db97 21- [ "$1" = "$vendor" -o "$vendor" = "$PCI_ANY_ID" ] || continue
f5aa6e2b 22- # match device, allow PCI_ANY_ID
4290db97 23- [ "$2" = "$device" -o "$device" = "$PCI_ANY_ID" ] || continue
f5aa6e2b
AM
24-
25- echo "$pci_module"
26- done < $pcimap
4290db97
AM
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 }
f5aa6e2b 56
fd9645f0
AM
57Index: 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 '
0f8a6999
AM
70Index: functions
71===================================================================
72--- functions (wersja 12392)
73+++ functions (kopia robocza)
74@@ -189,7 +189,7 @@
75 return
76 fi
77
78- lspci -p "$pcimap" -kvmmn | awk -vreq_class="${req_class}" '
79+ LC_ALL=C lspci -p "$pcimap" -kvmmn | awk -vreq_class="${req_class}" '
80 BEGIN { skip_modules[1]=""; modules[1]=""; xhci=""; ehci=""; ohci=""; uhci="" }
81 /^Slot:/ { found=0 }
82 /^Class:/ { if (req_class == $2) { found=1 } }
b3aaeca7
AM
83Index: geninitrd
84===================================================================
d174cb31 85--- geninitrd (wersja 12380)
b3aaeca7
AM
86+++ geninitrd (kopia robocza)
87@@ -18,6 +18,7 @@
88 # list of geninitrd modules which need setup routine after commandline args parsing
89 GENINITRD_MODS=""
90 COMPRESS=yes
d174cb31 91+STRIP=strip
b3aaeca7
AM
92 target=""
93 kernel=""
94 force=""
95@@ -47,6 +48,7 @@
96 echo "Usage: $PROGRAM [--version] [-v] [-f] [--ifneeded] [--preload <module>]"
97 echo " [--with=<module>] [--image-version] [--fstab=<fstab>] [--nocompress]"
98 echo " [--compress=yes|xz|lzma|bzip2|gzip|lzo]"
d174cb31 99+ echo " [--nostrip ] [--strip PATH/strip] [--strip=PATH/strip]"
b3aaeca7
AM
100 echo " [--initrdfs=rom|initramfs|ext2|cram] [--modules-conf=<modules.conf>]"
101 echo " [--with-bootsplash] [--without-bootsplash]"
102 echo " [--with-fbsplash] [--without-fbsplash]"
d174cb31 103@@ -630,6 +632,10 @@
b3aaeca7
AM
104 inst_d "/lib/modules/$kernel/$MODULEDIR"
105 cp -a "/lib/modules/$kernel/$mod" "$DESTDIR/lib/modules/$kernel/$mod"
106 gunzip "$DESTDIR/lib/modules/$kernel/$mod" 2> /dev/null
d174cb31
AM
107+ if [ "$STRIP" ] ; then
108+ mod_nocomp=${mod%.gz}
109+ $STRIP --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack "$DESTDIR/lib/modules/$kernel/$mod_nocomp"
b3aaeca7
AM
110+ fi
111 done
112 }
113
d174cb31 114@@ -1017,6 +1023,16 @@
b3aaeca7
AM
115 --nocompress)
116 COMPRESS=no
117 ;;
118+ --nostrip)
d174cb31
AM
119+ STRIP=
120+ ;;
121+ --strip=*)
122+ STRIP="${1#--strip=}"
123+ ;;
124+ --strip)
125+ STRIP=$2
126+ shift
b3aaeca7
AM
127+ ;;
128 --ifneeded)
129 ifneeded=1
130 ;;
This page took 0.053636 seconds and 4 git commands to generate.