]> git.pld-linux.org Git - packages/geninitrd.git/blob - geninitrd-svn.patch
- rel 4; fix strip to work also with compressed modules
[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         '
70 Index: 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 } }
83 Index: geninitrd
84 ===================================================================
85 --- geninitrd   (wersja 12380)
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
91 +STRIP=strip
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]"
99 +       echo "       [--nostrip ] [--strip PATH/strip] [--strip=PATH/strip]"
100         echo "       [--initrdfs=rom|initramfs|ext2|cram] [--modules-conf=<modules.conf>]"
101         echo "       [--with-bootsplash] [--without-bootsplash]"
102         echo "       [--with-fbsplash] [--without-fbsplash]"
103 @@ -630,6 +632,10 @@
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
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"
110 +               fi
111         done
112  }
113  
114 @@ -1017,6 +1023,16 @@
115         --nocompress)
116                 COMPRESS=no
117                 ;;
118 +       --nostrip)
119 +               STRIP=
120 +               ;;
121 +       --strip=*)
122 +               STRIP="${1#--strip=}"
123 +               ;;
124 +       --strip)
125 +               STRIP=$2
126 +               shift
127 +               ;;
128         --ifneeded)
129                 ifneeded=1
130                 ;;
This page took 0.066424 seconds and 3 git commands to generate.