]> git.pld-linux.org Git - packages/geninitrd.git/blob - geninitrd-git.patch
- rel 5; add fixes from git
[packages/geninitrd.git] / geninitrd-git.patch
1 commit 43d2f37d89034a2e409bb4f66cca1a64b12130b8
2 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
3 Date:   Mon Nov 25 20:15:24 2019 +0100
4
5     Accept d/D symbols, too (ffffffff825ca52c D __initramfs_start) as noticed in recent 4.19.85-1 kernel.
6
7 diff --git a/geninitrd b/geninitrd
8 index 05e290a..052f553 100755
9 --- a/geninitrd
10 +++ b/geninitrd
11 @@ -1097,7 +1097,7 @@ sym_exists() {
12                 return 1
13         fi
14  
15 -       awk -vc=1 -vsymbol="$symbol" '($2 == "T" || $2 == "t") && $3 == symbol {c = 0} END {exit c}' $mapfile
16 +       awk -vc=1 -vsymbol="$symbol" '(tolower($2) == "t" || tolower($2) == "d") && $3 == symbol {c = 0} END {exit c}' $mapfile
17  }
18  
19  # find best compressor (or forced one) for initrd
20
21 commit 04b32086569a126d5d6f9bd0ad1b0db9f142f50e
22 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
23 Date:   Sun Jul 21 21:04:05 2019 +0200
24
25     Try to detect a need for nvme driver. If you know better method then share with us.
26
27 diff --git a/geninitrd b/geninitrd
28 index b5d405a..05e290a 100755
29 --- a/geninitrd
30 +++ b/geninitrd
31 @@ -673,6 +673,11 @@ find_modules_for_devpath() {
32                 return
33         fi
34  
35 +       if [[ "$devpath" == /dev/nvme* ]]; then
36 +               find_module "nvme"
37 +               return
38 +       fi
39 +
40         if [[ "$devpath" == /dev/bcache* ]]; then
41                 find_modules_bcache "$devpath"
42                 return
43
44 commit 4de5a3333e772ad198381f157c014e452e42c129
45 Author: Elan Ruusamäe <glen@pld-linux.org>
46 Date:   Mon Jul 15 23:56:58 2019 +0300
47
48     fix indent
49
50 diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
51 index ff8f442..35543b7 100644
52 --- a/mod-usbkbd.sh
53 +++ b/mod-usbkbd.sh
54 @@ -10,22 +10,22 @@ find_modules_usbkbd() {
55  
56         local modules i module bInterfaceClass bInterfaceProtocol
57  
58 -        for i in /sys/bus/usb/devices/*-*:*; do
59 -                # standard usb keyboards
60 -                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
61 -                        bInterfaceClass=$(cat $i/bInterfaceClass)
62 -                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
63 -                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
64 -                                module=$(readlink $i/driver/module)
65 -                                module=$(basename $module)
66 +       for i in /sys/bus/usb/devices/*-*:*; do
67 +               # standard usb keyboards
68 +               if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
69 +                       bInterfaceClass=$(cat $i/bInterfaceClass)
70 +                       bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
71 +                       if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
72 +                               module=$(readlink $i/driver/module)
73 +                               module=$(basename $module)
74  
75 -                                if [ -n "$module" ]; then
76 -                                        verbose "Found USB Keyboard driver: $module"
77 -                                        modules="$modules $module"
78 -                                fi
79 -                        fi
80 -                fi
81 -        done
82 +                               if [ -n "$module" ]; then
83 +                                       verbose "Found USB Keyboard driver: $module"
84 +                                       modules="$modules $module"
85 +                               fi
86 +                       fi
87 +               fi
88 +       done
89  
90         for i in /sys/class/input/input*; do
91                 # standard usb keyboards
92
93 commit 662fd5a3adac2080640fa4eacd34d72504526175
94 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
95 Date:   Mon Jul 15 19:59:46 2019 +0200
96
97     Another way for findings usb keyboard drivers that works on newer kernels.
98
99 diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
100 index 0dd0d20..ff8f442 100644
101 --- a/mod-usbkbd.sh
102 +++ b/mod-usbkbd.sh
103 @@ -10,6 +10,23 @@ find_modules_usbkbd() {
104  
105         local modules i module bInterfaceClass bInterfaceProtocol
106  
107 +        for i in /sys/bus/usb/devices/*-*:*; do
108 +                # standard usb keyboards
109 +                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
110 +                        bInterfaceClass=$(cat $i/bInterfaceClass)
111 +                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
112 +                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
113 +                                module=$(readlink $i/driver/module)
114 +                                module=$(basename $module)
115 +
116 +                                if [ -n "$module" ]; then
117 +                                        verbose "Found USB Keyboard driver: $module"
118 +                                        modules="$modules $module"
119 +                                fi
120 +                        fi
121 +                fi
122 +        done
123 +
124         for i in /sys/class/input/input*; do
125                 # standard usb keyboards
126                 if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
127
128 commit b565e95c147bea4e68e4ccf5ad19906d51d2375b
129 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
130 Date:   Wed May 15 21:04:45 2019 +0200
131
132     Prepend cpu microcode to initrd image, so kernel will pick it up when LILO is in use.
133
134 diff --git a/geninitrd b/geninitrd
135 index 118333c..b5d405a 100755
136 --- a/geninitrd
137 +++ b/geninitrd
138 @@ -17,6 +17,7 @@ PROGRAM=${0##*/}
139  # list of geninitrd modules which need setup routine after commandline args parsing
140  GENINITRD_MODS=""
141  COMPRESS=yes
142 +LILO_MICROCODE=yes
143  STRIP=/usr/bin/strip
144  target=""
145  kernel=""
146 @@ -1186,6 +1187,16 @@ compress_image() {
147         mv -f "$tmp" "$target"
148  }
149  
150 +# prepend file to image
151 +prepend_file_to_image() {
152 +       local file="$1" target="$2" tmp
153 +       tmp=$(mktemp "$target".XXXXXX) || die "mktemp failed"
154 +
155 +       cat "$file" "$target" > "$tmp" || return $?
156 +
157 +       mv -f "$tmp" "$target"
158 +}
159 +
160  if [ -r /etc/sysconfig/geninitrd ]; then
161         . /etc/sysconfig/geninitrd
162  fi
163 @@ -1801,6 +1812,14 @@ else
164         cp -a "$IMAGE" "$target"
165  fi
166  
167 +# microcode support for lilo
168 +if ! is_no "$LILO_MICROCODE"; then
169 +       if [ -x /sbin/lilo -a -f "/boot/intel-ucode.img" ]; then
170 +               verbose "Prepending $target with microcode image /boot/intel-ucode.img for LILO"
171 +               prepend_file_to_image "/boot/intel-ucode.img" "$target"
172 +       fi
173 +fi
174 +
175  # XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
176  initrd_gen_bootsplash "$target"
177  
178 diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
179 index ccf177c..1268324 100644
180 --- a/geninitrd.sysconfig
181 +++ b/geninitrd.sysconfig
182 @@ -18,6 +18,9 @@
183  # Default is to use initramfs for >= 2.5.0.
184  #INITRDFS=initramfs
185  
186 +# Should we prepend cpu microcode when lilo is installed
187 +#LILO_MICROCODE=no
188 +
189  ## Use udev to create /dev?
190  USE_UDEV=yes
191  
192
193 commit ad5033d7e704edaf52f2be18d4aa98c378179ede
194 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
195 Date:   Fri Jan 25 20:38:24 2019 +0100
196
197     Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to that.
198
199 diff --git a/mod-luks.sh b/mod-luks.sh
200 index ff877f7..ffe87cb 100644
201 --- a/mod-luks.sh
202 +++ b/mod-luks.sh
203 @@ -162,7 +162,7 @@ luks_crypttab() {
204                         done
205                         IFS="$old_IFS"
206  
207 -                       verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
208 +                       verbose "+ cryptsetup ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
209                         add_linuxrc <<-EOF
210                         debugshell
211  
212 @@ -189,7 +189,7 @@ luks_crypttab() {
213                                 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
214                                 if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
215                                         # is inactive
216 -                                       cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
217 +                                       cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} open $crypttab_opt "\$luksdev" '$dst' <&1
218                                 fi
219                         fi
220  
221
222 commit 21ad0f7980ce6a0135e4a3c37a94472ed4f1320c
223 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
224 Date:   Tue Dec 18 14:43:20 2018 +0100
225
226     Use existing mechanism for installing udev apps but install regular variants, too if initrd-variants don't exist.
227
228 diff --git a/mod-udev.sh b/mod-udev.sh
229 index a2491ee..87f4b68 100644
230 --- a/mod-udev.sh
231 +++ b/mod-udev.sh
232 @@ -44,8 +44,6 @@ initrd_gen_udev() {
233         inst_d /sbin /etc/udev /lib/udev
234         inst_exec $udevd /sbin/udevd
235         inst_exec $udevadm /sbin/udevadm
236 -       inst_exec /lib/udev/ata_id  /lib/udev/ata_id
237 -       inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
238         inst /etc/udev/udev.conf /etc/udev/udev.conf
239         # standard udev rules
240         inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
241 @@ -57,6 +55,8 @@ initrd_gen_udev() {
242         for e in ata_id cdrom_id collect firmware scsi_id v4l_id; do
243                 if [ -e "$initrd_dir/udev/$e" ]; then
244                         inst_exec $initrd_dir/udev/$e /lib/udev/$e
245 +               elif [ -e "/lib/udev/$e" ]; then
246 +                       inst_exec /lib/udev/$e /lib/udev/$e
247                 fi
248         done
249  
250
251 commit 3d81f1cd0bc557ad9a1f157b403f0396866c648c
252 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
253 Date:   Tue Dec 18 14:38:55 2018 +0100
254
255     udevd uses ata_id and scsi_id, so install these.
256
257 diff --git a/mod-udev.sh b/mod-udev.sh
258 index 422ef3e..a2491ee 100644
259 --- a/mod-udev.sh
260 +++ b/mod-udev.sh
261 @@ -41,9 +41,11 @@ setup_mod_udev() {
262  initrd_gen_udev() {
263         verbose "Setting up udev..."
264  
265 -       inst_d /sbin /etc/udev
266 +       inst_d /sbin /etc/udev /lib/udev
267         inst_exec $udevd /sbin/udevd
268         inst_exec $udevadm /sbin/udevadm
269 +       inst_exec /lib/udev/ata_id  /lib/udev/ata_id
270 +       inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
271         inst /etc/udev/udev.conf /etc/udev/udev.conf
272         # standard udev rules
273         inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
274
275 commit dc5ca733ed6fe57dfa39d4598a6586069e41d0b0
276 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
277 Date:   Tue Dec 18 14:34:38 2018 +0100
278
279     Install mdadm in /sbin because udevd expects it to be there.
280
281 diff --git a/mod-md.sh b/mod-md.sh
282 index 2b6f587..a358517 100644
283 --- a/mod-md.sh
284 +++ b/mod-md.sh
285 @@ -133,7 +133,7 @@ initrd_gen_md() {
286         fi
287         verbose "Setting up mdadm..."
288  
289 -       inst_exec $mdadm /bin/mdadm
290 +       inst_exec $mdadm /sbin/mdadm
291  
292         echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
293  
294 @@ -181,7 +181,7 @@ initrd_gen_md() {
295  
296         echo "wait_for_files $cr_dev_list" | add_linuxrc
297         add_linuxrc <<-'EOF'
298 -       mdadm --assemble --scan
299 +       /sbin/mdadm --assemble --scan
300  
301         if [ "$DEBUGINITRD" ]; then
302                 [ -e /proc/mdstat ] && echo "/proc/mdstat contents:" && cat /proc/mdstat
303
304 commit 33cc4751b8f80fc3b800928b9ad93866b2569915
305 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
306 Date:   Tue Dec 18 14:33:12 2018 +0100
307
308     Install blkid in /sbin because udevd expects it to be there.
309
310 diff --git a/geninitrd b/geninitrd
311 index a79b9c3..118333c 100755
312 --- a/geninitrd
313 +++ b/geninitrd
314 @@ -1530,7 +1530,7 @@ chmod a+rx "$RCFILE"
315  ln -s linuxrc $DESTDIR/init
316  
317  # create dirs that we really need
318 -inst_d /{lib,bin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
319 +inst_d /{lib,bin,sbin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
320  
321  modules_install "$MODULES"
322  
323 diff --git a/mod-blkid.sh b/mod-blkid.sh
324 index 8ee2a48..92df9ae 100644
325 --- a/mod-blkid.sh
326 +++ b/mod-blkid.sh
327 @@ -22,12 +22,12 @@ initrd_gen_blkid() {
328         fi
329         verbose "Adding BLKID support to initrd"
330  
331 -       inst_exec $blkid /bin/blkid
332 +       inst_exec $blkid /sbin/blkid
333         initrd_gen_devices
334         add_linuxrc <<-'EOF'
335                 # if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
336                 if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
337 -                       blkid="$(/bin/blkid -t $ROOT -o device -l)"
338 +                       blkid="$(/sbin/blkid -t $ROOT -o device -l)"
339                         if [ -n "$blkid" ]; then
340                                 ROOT=$blkid
341                         fi
This page took 0.060942 seconds and 4 git commands to generate.