]> git.pld-linux.org Git - packages/geninitrd.git/blame - geninitrd-git.patch
- rel 10; update from git
[packages/geninitrd.git] / geninitrd-git.patch
CommitLineData
7dbbcc6f
AM
1commit a16a1beafe3929b47bc28208c375520771c84b08
2Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
3Date: Wed Jan 20 21:57:53 2016 +0100
4
5 Reorder compressors, so best (smallest image) is used first. Using best compression to avoid a need to play with kernel options to load bigger ramdisks.
6
4c880565
AM
7diff --git a/geninitrd b/geninitrd
8index 7b962b5..a4de196 100755
9--- a/geninitrd
10+++ b/geninitrd
11@@ -1103,8 +1103,7 @@ sym_exists() {
12 # find best compressor (or forced one) for initrd
13 find_compressor() {
14 local mode="$1"
15- # fastest initrd decompression speed is first
16- local compressors='lzo gzip xz lzma bzip2'
17+ local compressors='xz lzma bzip2 gzip lzo'
18
19 # a specified one, take it
20 if ! is_yes "$mode"; then
7dbbcc6f
AM
21
22commit a52ae08eef1036b833da1cbecf27f04782a1d473
23Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
24Date: Sun Jan 31 17:00:15 2016 +0100
25
26 Always include partitions and containers when starting mdadm array.
27
4c880565 28diff --git a/mod-md.sh b/mod-md.sh
7dbbcc6f 29index a0cd7aa..1c5c60c 100644
4c880565
AM
30--- a/mod-md.sh
31+++ b/mod-md.sh
7dbbcc6f 32@@ -139,6 +139,8 @@ initrd_gen_md() {
4c880565
AM
33
34 inst_exec $mdassemble /bin/mdassemble
35
36+ echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
37+
38 # LVM on RAID case
39 local dev_list_extra ex_dev
40 dev_list_extra=$(awk '/^DEVICE / { for (i=2; i<=NF; i++) { printf "%s ", $i; }; } ' /etc/mdadm.conf | xargs)
7dbbcc6f
AM
41
42commit 44c13508fd5b62e82335bea903690609a35de913
43Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
44Date: Sun Jan 31 17:03:18 2016 +0100
45
46 Allow containers in ex devices.
47
48diff --git a/mod-md.sh b/mod-md.sh
49index 1c5c60c..d9093d4 100644
50--- a/mod-md.sh
51+++ b/mod-md.sh
52@@ -146,8 +146,8 @@ initrd_gen_md() {
53 dev_list_extra=$(awk '/^DEVICE / { for (i=2; i<=NF; i++) { printf "%s ", $i; }; } ' /etc/mdadm.conf | xargs)
4c880565
AM
54 new_dev_list_extra=""
55 for ex_dev in $dev_list_extra; do
56- if [ "$ex_dev" = "partitions" ]; then
57- echo "DEVICE partitions" >> "$DESTDIR/etc/mdadm.conf"
58+ if [ "$ex_dev" = "partitions" -o "$ex_dev" = "containers" ]; then
59+ echo "DEVICE $ex_dev" >> "$DESTDIR/etc/mdadm.conf"
60 # FIXME: find and copy partition devices from /proc/partitions
61 # - best if done at runtime, now initrd gen time
62 continue
7dbbcc6f
AM
63
64commit fee61d3f4dd96bfdca441a8ab524d9928309559e
65Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
66Date: Fri Feb 26 18:15:14 2016 +0100
67
68 Check if kernel supports specified INITRDFS (tested with initramfs and romfs only though)
69
70diff --git a/geninitrd b/geninitrd
71index a4de196..92a519d 100755
72--- a/geninitrd
73+++ b/geninitrd
74@@ -1097,7 +1097,7 @@ sym_exists() {
75 return 1
76 fi
77
78- awk -vc=1 -vsymbol="$symbol" '$2 == "T" && $3 == symbol {c = 0} END {exit c}' $mapfile
79+ awk -vc=1 -vsymbol="$symbol" '($2 == "T" || $2 == "t") && $3 == symbol {c = 0} END {exit c}' $mapfile
80 }
81
82 # find best compressor (or forced one) for initrd
83@@ -1400,24 +1400,46 @@ if [ -z "$INITRDFS" ]; then
84 fi
85 fi
86
87-case "$INITRDFS" in
88- ext2)
89- [ -x /sbin/mke2fs ] || die "/sbin/mke2fs is missing"
90- ;;
91- rom|romfs)
92- [ -x /sbin/genromfs ] || die "/sbin/genromfs is missing"
93- ;;
94- cram|cramfs)
95- [ -x /sbin/mkcramfs ] || die "/sbin/mkcramfs is missing"
96- ;;
97- initramfs)
98- [ -x /bin/cpio ] || die "/bin/cpio is missing"
99- [ -x /usr/bin/find ] || die "/usr/bin/find is missing"
100- ;;
101- *)
102- die "Filesystem $INITRDFS on initrd is not supported"
103- ;;
104-esac
105+check_initrd_fs() {
106+ local s sfound sym p prog map=/boot/System.map-$kernel
107+ case "$INITRDFS" in
108+ ext2)
109+ # TODO: symbols to check in case of ext2 used via ext3/4 subsystem
110+ sym=init_ext2_fs
111+ prog=/sbin/mke2fs
112+ ;;
113+ rom|romfs)
114+ sym=init_romfs_fs
115+ prog=/sbin/genromfs
116+ ;;
117+ cram|cramfs)
118+ sym=init_cramfs_fs
119+ prog=/sbin/mkcramfs
120+ ;;
121+ initramfs)
122+ sym=__initramfs_start
123+ prog="/bin/cpio /usr/bin/find"
124+ ;;
125+ *)
126+ die "Filesystem $INITRDFS on initrd is not supported by geninitrd"
127+ ;;
128+ esac
129+
130+ # only one is needed (for cases like ext2 via ext2 or via ext3 or via ext4 subsysytem)
131+ sfound=0
132+ for s in $sym; do
133+ sym_exists $map $s && sfound=1
134+ break
135+ done
136+ if [ "$sfound" -eq "0" ]; then
137+ die "Filesystem $INITRDFS on initrd is not supported by kernel"
138+ fi
139+
140+ for p in $prog; do
141+ [ ! -x "$p" ] && die "$prog is missing"
142+ done
143+}
144+check_initrd_fs
145
146 if [ -L "$target" ]; then
147 target=$(readlink -f "$target")
148
149commit 985c7aef65f1fd4a704ded7218fb2df010153080
150Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
151Date: Sat May 7 12:34:33 2016 +0200
152
153 Use uevent feature of new busybox instead of pure and racy mdev via hotplug
154
155diff --git a/mod-udev.sh b/mod-udev.sh
156index 30114cd..422ef3e 100644
157--- a/mod-udev.sh
158+++ b/mod-udev.sh
159@@ -115,8 +115,9 @@ initrd_gen_stop_udevd() {
160 initrd_gen_mdev() {
161 debug "Setting up mdev..."
162
163- busybox_applet mdev
164+ busybox_applet mdev uevent
165 ln -s busybox $DESTDIR/bin/mdev
166+ ln -s busybox $DESTDIR/bin/uevent
167
168 cat > $DESTDIR/etc/mdev.conf <<-'EOF'
169 # Provide user, group, and mode information for devices. If a regex matches
170@@ -157,13 +158,13 @@ hd[a-z]* 0:6 660
171 add_linuxrc <<-'EOF'
172 # \n needed in mdev.seq
173 echo > /dev/mdev.seq
174- echo /bin/mdev > /proc/sys/kernel/hotplug
175+ uevent mdev &
176 mdev -s
177 EOF
178 }
179
180 initrd_gen_stop_mdev() {
181 add_linuxrc <<-'EOF'
182- killall mdev > /dev/null 2>&1
183+ killall uevent > /dev/null 2>&1
184 EOF
185 }
186
f9045633
AM
187commit 11202855dbaee5bc32209913df1ae8738c210c39
188Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
189Date: Sat May 14 00:36:02 2016 +0200
190
191 Make rootdev fallback work.
192
193diff --git a/geninitrd b/geninitrd
194index 92a519d..771245e 100755
195--- a/geninitrd
196+++ b/geninitrd
197@@ -1004,7 +1004,11 @@ initrd_gen_initramfs_switchroot() {
198
199 # XXX hack, fallback to rootdev from geninitrd time
200 if [ ! -e "$device" ]; then
201+ EOF
202+ add_linuxrc <<-EOF
203 device="$rootdev"
204+ EOF
205+ add_linuxrc <<-'EOF'
206 echo "DEVICE set to $device based on fstab entry from initrd gen time"
207 fi
208
7dbbcc6f 209
95e49aad
AM
210commit 583a7f5f8783fb1f92b75ca9f651d675df016b73
211Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
212Date: Tue Jun 7 08:30:46 2016 +0200
213
214 Mount /run with 0755.
215
216diff --git a/geninitrd b/geninitrd
217index 771245e..62e47ee 100755
218--- a/geninitrd
219+++ b/geninitrd
220@@ -273,7 +273,7 @@ mount_run() {
221 fi
222
223 run_mounted=yes
224- echo "mount -t tmpfs run /run" | add_linuxrc
225+ echo "mount -t tmpfs run /run -o mode=0755" | add_linuxrc
226 }
227
228 # unmount all mountpoints mounted by geninitrd
7dbbcc6f
AM
229
230commit 8c1bff4fcc5f9c5c60aea7ab168a96c7d6e93470
231Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
232Date: Tue Jun 7 08:36:48 2016 +0200
233
234 cryptsetup: Use 120s timeout when asking for password.
235
236diff --git a/mod-luks.sh b/mod-luks.sh
237index 09e31d3..8e9bc46 100644
238--- a/mod-luks.sh
239+++ b/mod-luks.sh
240@@ -157,7 +157,7 @@ luks_crypttab() {
241 done
242 IFS="$old_IFS"
243
244- verbose "+ cryptsetup ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
245+ verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
246 add_linuxrc <<-EOF
247 debugshell
248
249@@ -184,7 +184,7 @@ luks_crypttab() {
250 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
251 if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
252 # is inactive
253- cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
254+ cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
255 fi
256 fi
257
258
259commit 7e3c63ed836b899d5217506e408b35284b6a00bc
260Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
261Date: Tue Jun 7 16:52:17 2016 +0200
262
263 Also mount /run as noexec,nosuid,nodev (as suggested by qboosh).
264
265diff --git a/geninitrd b/geninitrd
266index 62e47ee..e94ca12 100755
267--- a/geninitrd
268+++ b/geninitrd
269@@ -273,7 +273,7 @@ mount_run() {
270 fi
271
272 run_mounted=yes
273- echo "mount -t tmpfs run /run -o mode=0755" | add_linuxrc
274+ echo "mount -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev" | add_linuxrc
275 }
276
277 # unmount all mountpoints mounted by geninitrd
278
279commit b13c409df04d048f45d246603a779e39f2fed2b4
280Author: Elan Ruusamäe <glen@delfi.ee>
281Date: Wed Jun 29 22:48:43 2016 +0300
282
283 accept rootfs= kernel commandline argument
284
285diff --git a/geninitrd b/geninitrd
286index e94ca12..432999c 100755
287--- a/geninitrd
288+++ b/geninitrd
289@@ -1580,6 +1580,9 @@ add_linuxrc <<-'EOF'
290 if [ "${arg##root=}" != "${arg}" ]; then
291 ROOT=${arg##root=}
292 fi
293+ if [ "${arg##rootfs=}" != "${arg}" ]; then
294+ ROOTFS=${arg##rootfs=}
295+ fi
296 if [ "${arg##rootflags=}" != "${arg}" ]; then
297 ROOTFLAGS=${arg##rootflags=}
298 fi
299
300commit 16e8a388f3184e59475429cf3fb7e69dd281045d
301Author: Elan Ruusamäe <glen@delfi.ee>
302Date: Wed Jun 29 22:55:58 2016 +0300
303
304 use git-for-each-ref to find last tag
305
306 omits two commands from pipeline
307
308diff --git a/make-tag.sh b/make-tag.sh
309index 6f54325..87aba64 100755
310--- a/make-tag.sh
311+++ b/make-tag.sh
312@@ -1,7 +1,8 @@
313 #!/bin/sh
314 set -e
315 rev=$(git rev-parse HEAD)
316-last_tag=$(git tag -l | grep -E '^[0-9]+' | sort -V | tail -n1)
317+ref=$(git for-each-ref 'refs/tags' --format='%(refname)' --sort=taggerdate | tail -n1)
318+last_tag=${ref#refs/tags/}
319
320 if [ -n "$1" ]; then
321 tag="$1"
322
323commit ce3a6bd6821fad3e6e60fb35a8153f95128e7160
324Author: Elan Ruusamäe <glen@delfi.ee>
325Date: Wed Jun 29 22:58:16 2016 +0300
326
327 git tag -l
328
329 "git tags" was my local alias i didn't even realize it's not git builtin :)
330
331diff --git a/RELEASE b/RELEASE
332index 4f71b51..3c7639a 100644
333--- a/RELEASE
334+++ b/RELEASE
335@@ -2,7 +2,7 @@ HOW TO MAKE A RELEASE
336
337 before making a release:
338
339-- run make dist, create package with resulting tarball to check that code is
340+- run "make dist", create package with resulting tarball to check that code is
341 stable enough for a release
342
343 to make a release:
344@@ -14,7 +14,7 @@ in short:
345 in details:
346 - run 'make tag'
347 - fill git shortlog into annotate tag commit message:
348- $ git shortlog $(git tags | sort -nr | head -n1)..HEAD
349+ $ git shortlog $(git tag -l | sort -nr | head -n1)..HEAD
350 - run 'make dist'
351 - verify produced tarball with updating geninitrd.spec:master
352 - push tarball to distfiles
353
354commit ac6b67a86f7eb4c2d5758920bd9101e863655970
355Author: Tomasz Pala <gotar@pld-linux.org>
356Date: Sun Aug 14 12:03:51 2016 +0200
357
358 newer platforms use xHCI, newer kernels require PCI over HCD modules
359 https://marc.info/?l=git-commits-head&m=141276811802511&w=2
360
361diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
362index e141a0a..e88cda5 100644
363--- a/geninitrd.sysconfig
364+++ b/geninitrd.sysconfig
365@@ -3,7 +3,7 @@
366 #BASICMODULES="-tuxonice_compress"
367
368 ## Basic modules to include USB keyboard
369-#BASICMODULES="usbhid ehci-hcd uhci-hcd ohci-hcd"
370+#BASICMODULES="usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
371
372 ## Modules that should be loaded before anything (i.e. jbd for ext3)
373 #PREMODS=""
374
375commit 9e77ea77b2359a828325983e58c8a4b39c8b6648
376Author: Tomasz Pala <gotar@pld-linux.org>
377Date: Sun Aug 14 17:54:37 2016 +0200
378
379 hid-generic required as well
380
381diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
382index e88cda5..ccf177c 100644
383--- a/geninitrd.sysconfig
384+++ b/geninitrd.sysconfig
385@@ -3,7 +3,7 @@
386 #BASICMODULES="-tuxonice_compress"
387
388 ## Basic modules to include USB keyboard
389-#BASICMODULES="usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
390+#BASICMODULES="hid-generic usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
391
392 ## Modules that should be loaded before anything (i.e. jbd for ext3)
393 #PREMODS=""
394
395commit 0d9c261f8a81bbe23bb097ae14002dce0fcaaa41
396Author: Tomasz Pala <gotar@pld-linux.org>
397Date: Sun Aug 14 20:10:24 2016 +0200
398
399 save precious scrollback buffer contents when data can be fetched later
400
401diff --git a/geninitrd b/geninitrd
402index 432999c..0b838e6 100755
403--- a/geninitrd
404+++ b/geninitrd
405@@ -992,7 +992,7 @@ initrd_gen_initramfs_switchroot() {
406 ' /proc/partitions)"
407
408 if [ -z "$device" ]; then
409- if [ "$DEBUGINITRD" ]; then
410+ if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
411 cat /proc/partitions
412 fi
413 device=$ROOT
414@@ -1041,7 +1041,7 @@ initrd_gen_initramfs_switchroot() {
415 busybox_applet dmesg
416 busybox_applet tail
417 add_linuxrc <<-'EOF'
418- if [ "$DEBUGINITRD" ]; then
419+ if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
420 echo "Last 20 lines of dmesg:"
421 dmesg | tail -n 20
422 fi
423
424commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b
425Author: Tomasz Pala <gotar@pld-linux.org>
426Date: Sun Aug 14 22:01:15 2016 +0200
427
428 save 19 lines of debug output (debugrd)
429
430diff --git a/geninitrd b/geninitrd
431index 0b838e6..d152eec 100755
432--- a/geninitrd
433+++ b/geninitrd
434@@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
435 add_linuxrc <<-'EOF'
436 device=
437 eval "$(busybox awk -v root="$ROOT" '
438- # http://9fans.net/archive/2006/09/261
439- function h2d(str, hstr, res, num, n, digit, i) {
440- hstr = "0123456789abdcef";
441- res = 0;
442+ function h2d(str, hstr, res, num, n, digit, i) { # http://9fans.net/archive/2006/09/261
443+ hstr = "0123456789abdcef"; res = 0;
444 n = split(tolower(str), digit, "");
445
446 for (i = 1; i <= n; i++) {
447 num = index(hstr, digit[i]) - 1;
448 res = res + (num * 16 ^ (n - i));
449 }
450-
451 return res;
452 }
453 BEGIN {
454-
455 num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
456 num_pattern = "[0-9a-fA-F]" num_pattern_short;
457 dev_pattern = "[hms][a-z][a-z]([0-9])+";
458- partition = "";
459- min = -1; maj = -1;
460-
461- # see if we have /dev/hdX or hdX, we can just take partition name
462- if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
463- partition = root
464- sub("^/dev/", "", partition);
465-
466- } else {
467- # unify values first
468- if (root ~ "^" num_pattern_short "$") {
469- # change "303" => "0x0303"
470+ partition = ""; min = -1; maj = -1;
471+
472+ if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") { # see if we have /dev/hdX or hdX, we can just take partition name
473+ partition = root; sub("^/dev/", "", partition);
474+ } else { # unify values first
475+ if (root ~ "^" num_pattern_short "$") { # change "303" => "0x0303"
476 root = "0x0" root
477- } else if (root ~ "^" num_pattern "$") {
478- # change "0303" => "0x0303"
479+ } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
480 root = "0x" root
481 }
482-
483 maj = h2d(substr(root, 3, 2));
484 min = h2d(substr(root, 5, 2));
485 }
486 }
487-
488 partition && $4 == partition { maj = $1; min = $2; }
489 $1 == maj && $2 == min { partition = $4; }
490-
491 END {
492- if (maj >= 0 && min >= 0) {
493- printf("maj=%s; min=%s;\n", maj, min);
494- }
495- if (partition) {
496- printf("device=/dev/%s;\n", partition);
497- }
498- }
499- ' /proc/partitions)"
500+ if (maj >= 0 && min >= 0) { printf("maj=%s; min=%s;\n", maj, min); }
501+ if (partition) { printf("device=/dev/%s;\n", partition); }
502+ }' /proc/partitions)"
503
504 if [ -z "$device" ]; then
505 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
506
507commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef
508Author: Elan Ruusamäe <glen@delfi.ee>
509Date: Mon Aug 15 23:43:06 2016 +0300
510
511 revert bogus commit
512
513 no actual change recorded, instead some formatting fuckup
514
515 Revert "save 19 lines of debug output (debugrd)"
516
517 This reverts commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b.
518
519diff --git a/geninitrd b/geninitrd
520index d152eec..0b838e6 100755
521--- a/geninitrd
522+++ b/geninitrd
523@@ -937,40 +937,59 @@ initrd_gen_initramfs_switchroot() {
524 add_linuxrc <<-'EOF'
525 device=
526 eval "$(busybox awk -v root="$ROOT" '
527- function h2d(str, hstr, res, num, n, digit, i) { # http://9fans.net/archive/2006/09/261
528- hstr = "0123456789abdcef"; res = 0;
529+ # http://9fans.net/archive/2006/09/261
530+ function h2d(str, hstr, res, num, n, digit, i) {
531+ hstr = "0123456789abdcef";
532+ res = 0;
533 n = split(tolower(str), digit, "");
534
535 for (i = 1; i <= n; i++) {
536 num = index(hstr, digit[i]) - 1;
537 res = res + (num * 16 ^ (n - i));
538 }
539+
540 return res;
541 }
542 BEGIN {
543+
544 num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
545 num_pattern = "[0-9a-fA-F]" num_pattern_short;
546 dev_pattern = "[hms][a-z][a-z]([0-9])+";
547- partition = ""; min = -1; maj = -1;
548-
549- if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") { # see if we have /dev/hdX or hdX, we can just take partition name
550- partition = root; sub("^/dev/", "", partition);
551- } else { # unify values first
552- if (root ~ "^" num_pattern_short "$") { # change "303" => "0x0303"
553+ partition = "";
554+ min = -1; maj = -1;
555+
556+ # see if we have /dev/hdX or hdX, we can just take partition name
557+ if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
558+ partition = root
559+ sub("^/dev/", "", partition);
560+
561+ } else {
562+ # unify values first
563+ if (root ~ "^" num_pattern_short "$") {
564+ # change "303" => "0x0303"
565 root = "0x0" root
566- } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
567+ } else if (root ~ "^" num_pattern "$") {
568+ # change "0303" => "0x0303"
569 root = "0x" root
570 }
571+
572 maj = h2d(substr(root, 3, 2));
573 min = h2d(substr(root, 5, 2));
574 }
575 }
576+
577 partition && $4 == partition { maj = $1; min = $2; }
578 $1 == maj && $2 == min { partition = $4; }
579+
580 END {
581- if (maj >= 0 && min >= 0) { printf("maj=%s; min=%s;\n", maj, min); }
582- if (partition) { printf("device=/dev/%s;\n", partition); }
583- }' /proc/partitions)"
584+ if (maj >= 0 && min >= 0) {
585+ printf("maj=%s; min=%s;\n", maj, min);
586+ }
587+ if (partition) {
588+ printf("device=/dev/%s;\n", partition);
589+ }
590+ }
591+ ' /proc/partitions)"
592
593 if [ -z "$device" ]; then
594 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
595
596commit 512f35991fc4b3f9c12469094f6c52c56e0309dd
597Author: Tomasz Pala <gotar@pld-linux.org>
598Date: Mon Aug 29 19:31:57 2016 +0200
599
600 Revert "revert bogus commit"
601
602 This 'formatting fuckup' was the point for saving scrollback buffer.
603 As you probably don't put it together, issuing debuginitrd throws all that function
604 contents to your face during boot.
605
606 This reverts commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef.
607
608diff --git a/geninitrd b/geninitrd
609index 0b838e6..d152eec 100755
610--- a/geninitrd
611+++ b/geninitrd
612@@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
613 add_linuxrc <<-'EOF'
614 device=
615 eval "$(busybox awk -v root="$ROOT" '
616- # http://9fans.net/archive/2006/09/261
617- function h2d(str, hstr, res, num, n, digit, i) {
618- hstr = "0123456789abdcef";
619- res = 0;
620+ function h2d(str, hstr, res, num, n, digit, i) { # http://9fans.net/archive/2006/09/261
621+ hstr = "0123456789abdcef"; res = 0;
622 n = split(tolower(str), digit, "");
623
624 for (i = 1; i <= n; i++) {
625 num = index(hstr, digit[i]) - 1;
626 res = res + (num * 16 ^ (n - i));
627 }
628-
629 return res;
630 }
631 BEGIN {
632-
633 num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
634 num_pattern = "[0-9a-fA-F]" num_pattern_short;
635 dev_pattern = "[hms][a-z][a-z]([0-9])+";
636- partition = "";
637- min = -1; maj = -1;
638-
639- # see if we have /dev/hdX or hdX, we can just take partition name
640- if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
641- partition = root
642- sub("^/dev/", "", partition);
643-
644- } else {
645- # unify values first
646- if (root ~ "^" num_pattern_short "$") {
647- # change "303" => "0x0303"
648+ partition = ""; min = -1; maj = -1;
649+
650+ if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") { # see if we have /dev/hdX or hdX, we can just take partition name
651+ partition = root; sub("^/dev/", "", partition);
652+ } else { # unify values first
653+ if (root ~ "^" num_pattern_short "$") { # change "303" => "0x0303"
654 root = "0x0" root
655- } else if (root ~ "^" num_pattern "$") {
656- # change "0303" => "0x0303"
657+ } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
658 root = "0x" root
659 }
660-
661 maj = h2d(substr(root, 3, 2));
662 min = h2d(substr(root, 5, 2));
663 }
664 }
665-
666 partition && $4 == partition { maj = $1; min = $2; }
667 $1 == maj && $2 == min { partition = $4; }
668-
669 END {
670- if (maj >= 0 && min >= 0) {
671- printf("maj=%s; min=%s;\n", maj, min);
672- }
673- if (partition) {
674- printf("device=/dev/%s;\n", partition);
675- }
676- }
677- ' /proc/partitions)"
678+ if (maj >= 0 && min >= 0) { printf("maj=%s; min=%s;\n", maj, min); }
679+ if (partition) { printf("device=/dev/%s;\n", partition); }
680+ }' /proc/partitions)"
681
682 if [ -z "$device" ]; then
683 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
684
685commit dfc0f1befd64d2c3864d5a279110d76bb680d1c2
686Author: Tomasz Pala <gotar@pld-linux.org>
687Date: Mon Aug 29 22:32:32 2016 +0200
688
689 warn about btrfs not fully supported by geninitrd
690
691 Before mounting multidevice btrfs filesystem, `btrfs device scan' needs to
692 be executed, otherwise filesystem won't mount. Without the btrfs binary,
693 one might instruct kernel in command line insted, but this is also not
694 supported (blkid finds single device only). Since there is dracut, just
695 notice user about this shortcoming, so he could properly configure
696 bootloader by manually appending appropriate devices when needed.
697
698diff --git a/geninitrd b/geninitrd
699index d152eec..1649787 100755
700--- a/geninitrd
701+++ b/geninitrd
702@@ -432,6 +432,7 @@ find_depmod() {
703 smodule=$(basename_module $modpath)
704 case "$smodule" in
705 btrfs)
706+ warn "mounting multidevice btrfs volume requires rootfsflags=device=/dev/...,device=/dev/... kernel option"
707 find_depmod "-libcrc32c"
708 ;;
709 crc-t10dif)
710
711commit 60086bea663782db0e65205f248683620f7ece5f
712Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
713Date: Mon Nov 13 10:29:41 2017 +0100
714
715 Add support for zstd(.spec) compression.
716
717diff --git a/geninitrd b/geninitrd
718index 1649787..0a18298 100755
719--- a/geninitrd
720+++ b/geninitrd
721@@ -46,7 +46,7 @@ proc_partitions=no
722 usage() {
723 echo "Usage: $PROGRAM [--version] [-v] [-f] [--ifneeded] [--preload <module>]"
724 echo " [--with=<module>] [--image-version] [--fstab=<fstab>] [--nocompress]"
725- echo " [--compress=yes|xz|lzma|bzip2|gzip|lzo]"
726+ echo " [--compress=yes|zstd|xz|lzma|bzip2|gzip|lzo]"
727 echo " [--nostrip ] [--strip PATH/strip] [--strip=PATH/strip]"
728 echo " [--initrdfs=rom|initramfs|ext2|cram] [--modules-conf=<modules.conf>]"
729 echo " [--with-bootsplash] [--without-bootsplash]"
730@@ -1089,7 +1089,7 @@ sym_exists() {
731 # find best compressor (or forced one) for initrd
732 find_compressor() {
733 local mode="$1"
734- local compressors='xz lzma bzip2 gzip lzo'
735+ local compressors='zstd xz lzma bzip2 gzip lzo'
736
737 # a specified one, take it
738 if ! is_yes "$mode"; then
739@@ -1121,6 +1121,10 @@ find_compressor() {
740 sym=unlzo
741 prog=/usr/bin/lzop
742 ;;
743+ zstd)
744+ sym=zstd
745+ prog=/usr/bin/zstd
746+ ;;
747 none|no)
748 # any existing sym will work
749 sym=initrd_load
750@@ -1163,6 +1167,9 @@ compress_image() {
751 lzo)
752 lzop -9 < "$IMAGE" > "$tmp" || return $?
753 ;;
754+ zstd)
755+ zstd -9 < "$IMAGE" > "$tmp" || return $?
756+ ;;
757 none|no)
758 cat < "$IMAGE" > "$tmp" || return $?
759 ;;
760
59e121d4
AM
761commit b5a01dda8ca06f88b1210f806f3ac6da7c0019f0
762Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
763Date: Fri May 4 15:50:18 2018 +0200
764
765 ext4 can use crc32 but has it in softdep only
766
767diff --git a/geninitrd b/geninitrd
768index 0a18298..c75c22b 100755
769--- a/geninitrd
770+++ b/geninitrd
771@@ -435,6 +435,9 @@ find_depmod() {
772 warn "mounting multidevice btrfs volume requires rootfsflags=device=/dev/...,device=/dev/... kernel option"
773 find_depmod "-libcrc32c"
774 ;;
775+ ext4)
776+ find_depmod "-libcrc32c"
777+ ;;
778 crc-t10dif)
779 find_depmod "-crct10dif-pclmul"
780 find_depmod "-crct10dif"
7dbbcc6f 781
ce25c101
AM
782commit 256e0bedb591a982ce87fb2ca1b38e1353d5b33a
783Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
784Date: Fri Aug 10 10:40:59 2018 +0200
785
786 ramdisk_size warning makes no sense for initramfs.
787
788diff --git a/geninitrd b/geninitrd
789index c75c22b..025674d 100755
790--- a/geninitrd
791+++ b/geninitrd
792@@ -1759,14 +1759,16 @@ case "$INITRDFS" in
793 die "Filesystem $INITRDFS not supported by $PROGRAM"
794 esac
795
796-CONFIG_BLK_DEV_RAM_SIZE=$(ikconfig | awk -F= '/^CONFIG_BLK_DEV_RAM_SIZE/{print $2}')
797-if [ -z "$CONFIG_BLK_DEV_RAM_SIZE" ]; then
798- CONFIG_BLK_DEV_RAM_SIZE=4096
799- warn "No CONFIG_BLK_DEV_RAM_SIZE detected, fallback to $CONFIG_BLK_DEV_RAM_SIZE"
800-fi
801+if [ "$INITRDFS" != "initramfs" ]; then
802+ CONFIG_BLK_DEV_RAM_SIZE=$(ikconfig | awk -F= '/^CONFIG_BLK_DEV_RAM_SIZE/{print $2}')
803+ if [ -z "$CONFIG_BLK_DEV_RAM_SIZE" ]; then
804+ CONFIG_BLK_DEV_RAM_SIZE=4096
805+ warn "No CONFIG_BLK_DEV_RAM_SIZE detected, fallback to $CONFIG_BLK_DEV_RAM_SIZE"
806+ fi
807
808-if [ "$IMAGESIZE" -gt $CONFIG_BLK_DEV_RAM_SIZE ]; then
809- warn "Your image size is larger than $CONFIG_BLK_DEV_RAM_SIZE, Be sure to boot kernel with ramdisk_size=$IMAGESIZE!"
810+ if [ "$IMAGESIZE" -gt $CONFIG_BLK_DEV_RAM_SIZE ]; then
811+ warn "Your image size is larger than $CONFIG_BLK_DEV_RAM_SIZE, Be sure to boot kernel with ramdisk_size=$IMAGESIZE!"
812+ fi
813 fi
814
815 if ! is_no "$COMPRESS"; then
7dbbcc6f
AM
816
817commit 7d4fa91c4a63900ed829b088d2513a60ac764ddd
818Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
819Date: Mon Aug 13 22:49:31 2018 +0200
820
821 Drop forced luks type as latest tools support luks2, too. Leave it for cryptsetup autodetection.
822
823diff --git a/mod-luks.sh b/mod-luks.sh
824index 8e9bc46..99ff4a6 100644
825--- a/mod-luks.sh
826+++ b/mod-luks.sh
827@@ -157,7 +157,7 @@ luks_crypttab() {
828 done
829 IFS="$old_IFS"
830
831- verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
832+ verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
833 add_linuxrc <<-EOF
834 debugshell
835
836@@ -184,7 +184,7 @@ luks_crypttab() {
837 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
838 if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
839 # is inactive
840- cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
841+ cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
842 fi
843 fi
844
845
846commit 042e65b6bf2018ce17fcc275b0f4da26ef2de2ff
847Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
848Date: Tue Aug 14 13:09:55 2018 +0200
849
850 libpthread dlopens libgcc_s.so.1, so install it.
851
852diff --git a/geninitrd b/geninitrd
853index 025674d..50be081 100755
854--- a/geninitrd
855+++ b/geninitrd
856@@ -538,15 +538,20 @@ inst_exec() {
857
858 inst "$@" $dest
859
860- local obj lib libs libdir
861+ local obj lib libs libs_additional libdir
862 for obj in "$@"; do
863 case "$obj" in
864 /lib/ld-linux.so.2 | /lib64/ld-linux-x86-64.so.2 | /libx32/ld-linux-x32.so.2)
865 continue
866+ ;;
867+ /lib/libpthread.so* | /lib64/libpthread.so* | /libx32/libpthread.so*)
868+ libs_additional="${obj%/libpthread*}/libgcc_s.so.1"
869+ ;;
870 esac
871
872+
873 libs=$(ldd "$obj" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
874- for lib in $libs; do
875+ for lib in $libs $libs_additional; do
876 libdir=$(cd $(dirname "$lib"); pwd)
877 if [ ! -f "$DESTDIR/$lib" ]; then
878 inst_d $libdir
879
880commit 99634b923a68cb279eae5fd72286dcb9e52f8f25
881Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
882Date: Tue Aug 14 13:32:41 2018 +0200
883
884 cryptsetup needs /var/run/cryptsetup dir.
885
886diff --git a/mod-luks.sh b/mod-luks.sh
887index 99ff4a6..4a93aa7 100644
888--- a/mod-luks.sh
889+++ b/mod-luks.sh
890@@ -89,6 +89,7 @@ initrd_gen_luks() {
891
892 inst_d /bin
893 inst_exec $cryptsetup /bin/cryptsetup
894+ inst_d /var/run/cryptsetup
895
896 mount_dev
897 mount_sys
898
899commit 32b9509df0d88c0814a0dfef2465a46ade008b28
900Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
901Date: Tue Aug 14 13:57:58 2018 +0200
902
903 Include more modules for luks. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809686#10
904
905diff --git a/mod-luks.sh b/mod-luks.sh
906index 4a93aa7..9fbf583 100644
907--- a/mod-luks.sh
908+++ b/mod-luks.sh
909@@ -67,6 +67,10 @@ find_modules_luks() {
910 # TODO: autodetect
911 find_module "aes"
912 find_module "cbc"
913+ find_module "-af-alg"
914+ find_module "-algif_hash"
915+ find_module "-algif_skcipher"
916+ find_module "-loop"
917
918 # recurse
919 dev=$(awk -vLUKSNAME="$LUKSNAME" '$1 == LUKSNAME { print $2 }' /etc/crypttab)
920
921commit 4fa03792dc42a77bfa98449828c87b3d23fd0a17
922Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
923Date: Tue Aug 14 14:08:52 2018 +0200
924
925 Fix condition for --debug mode which adds additional text after 'inactive' text.
926
927diff --git a/mod-luks.sh b/mod-luks.sh
928index 9fbf583..ff877f7 100644
929--- a/mod-luks.sh
930+++ b/mod-luks.sh
931@@ -187,7 +187,7 @@ luks_crypttab() {
932
933 if [ -e "\$luksdev" ]; then
934 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
935- if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
936+ if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
937 # is inactive
938 cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
939 fi
This page took 0.161102 seconds and 4 git commands to generate.