1 commit 43d2f37d89034a2e409bb4f66cca1a64b12130b8
2 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
3 Date: Mon Nov 25 20:15:24 2019 +0100
5 Accept d/D symbols, too (ffffffff825ca52c D __initramfs_start) as noticed in recent 4.19.85-1 kernel.
7 diff --git a/geninitrd b/geninitrd
8 index 05e290a..052f553 100755
11 @@ -1097,7 +1097,7 @@ sym_exists() {
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
19 # find best compressor (or forced one) for initrd
21 commit 04b32086569a126d5d6f9bd0ad1b0db9f142f50e
22 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
23 Date: Sun Jul 21 21:04:05 2019 +0200
25 Try to detect a need for nvme driver. If you know better method then share with us.
27 diff --git a/geninitrd b/geninitrd
28 index b5d405a..05e290a 100755
31 @@ -673,6 +673,11 @@ find_modules_for_devpath() {
35 + if [[ "$devpath" == /dev/nvme* ]]; then
40 if [[ "$devpath" == /dev/bcache* ]]; then
41 find_modules_bcache "$devpath"
44 commit 4de5a3333e772ad198381f157c014e452e42c129
45 Author: Elan Ruusamäe <glen@pld-linux.org>
46 Date: Mon Jul 15 23:56:58 2019 +0300
50 diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
51 index ff8f442..35543b7 100644
54 @@ -10,22 +10,22 @@ find_modules_usbkbd() {
56 local modules i module bInterfaceClass bInterfaceProtocol
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)
75 - if [ -n "$module" ]; then
76 - verbose "Found USB Keyboard driver: $module"
77 - modules="$modules $module"
82 + if [ -n "$module" ]; then
83 + verbose "Found USB Keyboard driver: $module"
84 + modules="$modules $module"
90 for i in /sys/class/input/input*; do
91 # standard usb keyboards
93 commit 662fd5a3adac2080640fa4eacd34d72504526175
94 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
95 Date: Mon Jul 15 19:59:46 2019 +0200
97 Another way for findings usb keyboard drivers that works on newer kernels.
99 diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
100 index 0dd0d20..ff8f442 100644
103 @@ -10,6 +10,23 @@ find_modules_usbkbd() {
105 local modules i module bInterfaceClass bInterfaceProtocol
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)
116 + if [ -n "$module" ]; then
117 + verbose "Found USB Keyboard driver: $module"
118 + modules="$modules $module"
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
128 commit b565e95c147bea4e68e4ccf5ad19906d51d2375b
129 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
130 Date: Wed May 15 21:04:45 2019 +0200
132 Prepend cpu microcode to initrd image, so kernel will pick it up when LILO is in use.
134 diff --git a/geninitrd b/geninitrd
135 index 118333c..b5d405a 100755
138 @@ -17,6 +17,7 @@ PROGRAM=${0##*/}
139 # list of geninitrd modules which need setup routine after commandline args parsing
146 @@ -1186,6 +1187,16 @@ compress_image() {
147 mv -f "$tmp" "$target"
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"
155 + cat "$file" "$target" > "$tmp" || return $?
157 + mv -f "$tmp" "$target"
160 if [ -r /etc/sysconfig/geninitrd ]; then
161 . /etc/sysconfig/geninitrd
163 @@ -1801,6 +1812,14 @@ else
164 cp -a "$IMAGE" "$target"
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"
175 # XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
176 initrd_gen_bootsplash "$target"
178 diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
179 index ccf177c..1268324 100644
180 --- a/geninitrd.sysconfig
181 +++ b/geninitrd.sysconfig
183 # Default is to use initramfs for >= 2.5.0.
186 +# Should we prepend cpu microcode when lilo is installed
189 ## Use udev to create /dev?
193 commit ad5033d7e704edaf52f2be18d4aa98c378179ede
194 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
195 Date: Fri Jan 25 20:38:24 2019 +0100
197 Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to that.
199 diff --git a/mod-luks.sh b/mod-luks.sh
200 index ff877f7..ffe87cb 100644
203 @@ -162,7 +162,7 @@ luks_crypttab() {
207 - verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
208 + verbose "+ cryptsetup ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
212 @@ -189,7 +189,7 @@ luks_crypttab() {
213 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
214 if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
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
222 commit 21ad0f7980ce6a0135e4a3c37a94472ed4f1320c
223 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
224 Date: Tue Dec 18 14:43:20 2018 +0100
226 Use existing mechanism for installing udev apps but install regular variants, too if initrd-variants don't exist.
228 diff --git a/mod-udev.sh b/mod-udev.sh
229 index a2491ee..87f4b68 100644
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
251 commit 3d81f1cd0bc557ad9a1f157b403f0396866c648c
252 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
253 Date: Tue Dec 18 14:38:55 2018 +0100
255 udevd uses ata_id and scsi_id, so install these.
257 diff --git a/mod-udev.sh b/mod-udev.sh
258 index 422ef3e..a2491ee 100644
261 @@ -41,9 +41,11 @@ setup_mod_udev() {
263 verbose "Setting up udev..."
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 \
275 commit dc5ca733ed6fe57dfa39d4598a6586069e41d0b0
276 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
277 Date: Tue Dec 18 14:34:38 2018 +0100
279 Install mdadm in /sbin because udevd expects it to be there.
281 diff --git a/mod-md.sh b/mod-md.sh
282 index 2b6f587..a358517 100644
285 @@ -133,7 +133,7 @@ initrd_gen_md() {
287 verbose "Setting up mdadm..."
289 - inst_exec $mdadm /bin/mdadm
290 + inst_exec $mdadm /sbin/mdadm
292 echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
294 @@ -181,7 +181,7 @@ initrd_gen_md() {
296 echo "wait_for_files $cr_dev_list" | add_linuxrc
298 - mdadm --assemble --scan
299 + /sbin/mdadm --assemble --scan
301 if [ "$DEBUGINITRD" ]; then
302 [ -e /proc/mdstat ] && echo "/proc/mdstat contents:" && cat /proc/mdstat
304 commit 33cc4751b8f80fc3b800928b9ad93866b2569915
305 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
306 Date: Tue Dec 18 14:33:12 2018 +0100
308 Install blkid in /sbin because udevd expects it to be there.
310 diff --git a/geninitrd b/geninitrd
311 index a79b9c3..118333c 100755
314 @@ -1530,7 +1530,7 @@ chmod a+rx "$RCFILE"
315 ln -s linuxrc $DESTDIR/init
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}
321 modules_install "$MODULES"
323 diff --git a/mod-blkid.sh b/mod-blkid.sh
324 index 8ee2a48..92df9ae 100644
327 @@ -22,12 +22,12 @@ initrd_gen_blkid() {
329 verbose "Adding BLKID support to initrd"
331 - inst_exec $blkid /bin/blkid
332 + inst_exec $blkid /sbin/blkid
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