1 commit a16a1beafe3929b47bc28208c375520771c84b08
2 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
3 Date: Wed Jan 20 21:57:53 2016 +0100
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.
7 diff --git a/geninitrd b/geninitrd
8 index 7b962b5..a4de196 100755
11 @@ -1103,8 +1103,7 @@ sym_exists() {
12 # find best compressor (or forced one) for initrd
15 - # fastest initrd decompression speed is first
16 - local compressors='lzo gzip xz lzma bzip2'
17 + local compressors='xz lzma bzip2 gzip lzo'
19 # a specified one, take it
20 if ! is_yes "$mode"; then
22 commit a52ae08eef1036b833da1cbecf27f04782a1d473
23 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
24 Date: Sun Jan 31 17:00:15 2016 +0100
26 Always include partitions and containers when starting mdadm array.
28 diff --git a/mod-md.sh b/mod-md.sh
29 index a0cd7aa..1c5c60c 100644
32 @@ -139,6 +139,8 @@ initrd_gen_md() {
34 inst_exec $mdassemble /bin/mdassemble
36 + echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
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)
42 commit 44c13508fd5b62e82335bea903690609a35de913
43 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
44 Date: Sun Jan 31 17:03:18 2016 +0100
46 Allow containers in ex devices.
48 diff --git a/mod-md.sh b/mod-md.sh
49 index 1c5c60c..d9093d4 100644
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)
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
64 commit fee61d3f4dd96bfdca441a8ab524d9928309559e
65 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
66 Date: Fri Feb 26 18:15:14 2016 +0100
68 Check if kernel supports specified INITRDFS (tested with initramfs and romfs only though)
70 diff --git a/geninitrd b/geninitrd
71 index a4de196..92a519d 100755
74 @@ -1097,7 +1097,7 @@ sym_exists() {
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
82 # find best compressor (or forced one) for initrd
83 @@ -1400,24 +1400,46 @@ if [ -z "$INITRDFS" ]; then
89 - [ -x /sbin/mke2fs ] || die "/sbin/mke2fs is missing"
92 - [ -x /sbin/genromfs ] || die "/sbin/genromfs is missing"
95 - [ -x /sbin/mkcramfs ] || die "/sbin/mkcramfs is missing"
98 - [ -x /bin/cpio ] || die "/bin/cpio is missing"
99 - [ -x /usr/bin/find ] || die "/usr/bin/find is missing"
102 - die "Filesystem $INITRDFS on initrd is not supported"
106 + local s sfound sym p prog map=/boot/System.map-$kernel
107 + case "$INITRDFS" in
109 + # TODO: symbols to check in case of ext2 used via ext3/4 subsystem
115 + prog=/sbin/genromfs
119 + prog=/sbin/mkcramfs
122 + sym=__initramfs_start
123 + prog="/bin/cpio /usr/bin/find"
126 + die "Filesystem $INITRDFS on initrd is not supported by geninitrd"
130 + # only one is needed (for cases like ext2 via ext2 or via ext3 or via ext4 subsysytem)
133 + sym_exists $map $s && sfound=1
136 + if [ "$sfound" -eq "0" ]; then
137 + die "Filesystem $INITRDFS on initrd is not supported by kernel"
141 + [ ! -x "$p" ] && die "$prog is missing"
146 if [ -L "$target" ]; then
147 target=$(readlink -f "$target")
149 commit 985c7aef65f1fd4a704ded7218fb2df010153080
150 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
151 Date: Sat May 7 12:34:33 2016 +0200
153 Use uevent feature of new busybox instead of pure and racy mdev via hotplug
155 diff --git a/mod-udev.sh b/mod-udev.sh
156 index 30114cd..422ef3e 100644
159 @@ -115,8 +115,9 @@ initrd_gen_stop_udevd() {
161 debug "Setting up mdev..."
163 - busybox_applet mdev
164 + busybox_applet mdev uevent
165 ln -s busybox $DESTDIR/bin/mdev
166 + ln -s busybox $DESTDIR/bin/uevent
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
172 # \n needed in mdev.seq
174 - echo /bin/mdev > /proc/sys/kernel/hotplug
180 initrd_gen_stop_mdev() {
182 - killall mdev > /dev/null 2>&1
183 + killall uevent > /dev/null 2>&1
187 commit 11202855dbaee5bc32209913df1ae8738c210c39
188 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
189 Date: Sat May 14 00:36:02 2016 +0200
191 Make rootdev fallback work.
193 diff --git a/geninitrd b/geninitrd
194 index 92a519d..771245e 100755
197 @@ -1004,7 +1004,11 @@ initrd_gen_initramfs_switchroot() {
199 # XXX hack, fallback to rootdev from geninitrd time
200 if [ ! -e "$device" ]; then
205 + add_linuxrc <<-'EOF'
206 echo "DEVICE set to $device based on fstab entry from initrd gen time"
210 commit 583a7f5f8783fb1f92b75ca9f651d675df016b73
211 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
212 Date: Tue Jun 7 08:30:46 2016 +0200
214 Mount /run with 0755.
216 diff --git a/geninitrd b/geninitrd
217 index 771245e..62e47ee 100755
220 @@ -273,7 +273,7 @@ mount_run() {
224 - echo "mount -t tmpfs run /run" | add_linuxrc
225 + echo "mount -t tmpfs run /run -o mode=0755" | add_linuxrc
228 # unmount all mountpoints mounted by geninitrd
230 commit 8c1bff4fcc5f9c5c60aea7ab168a96c7d6e93470
231 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
232 Date: Tue Jun 7 08:36:48 2016 +0200
234 cryptsetup: Use 120s timeout when asking for password.
236 diff --git a/mod-luks.sh b/mod-luks.sh
237 index 09e31d3..8e9bc46 100644
240 @@ -157,7 +157,7 @@ luks_crypttab() {
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'"
249 @@ -184,7 +184,7 @@ luks_crypttab() {
250 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
251 if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
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
259 commit 7e3c63ed836b899d5217506e408b35284b6a00bc
260 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
261 Date: Tue Jun 7 16:52:17 2016 +0200
263 Also mount /run as noexec,nosuid,nodev (as suggested by qboosh).
265 diff --git a/geninitrd b/geninitrd
266 index 62e47ee..e94ca12 100755
269 @@ -273,7 +273,7 @@ mount_run() {
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
277 # unmount all mountpoints mounted by geninitrd
279 commit b13c409df04d048f45d246603a779e39f2fed2b4
280 Author: Elan Ruusamäe <glen@delfi.ee>
281 Date: Wed Jun 29 22:48:43 2016 +0300
283 accept rootfs= kernel commandline argument
285 diff --git a/geninitrd b/geninitrd
286 index e94ca12..432999c 100755
289 @@ -1580,6 +1580,9 @@ add_linuxrc <<-'EOF'
290 if [ "${arg##root=}" != "${arg}" ]; then
293 + if [ "${arg##rootfs=}" != "${arg}" ]; then
294 + ROOTFS=${arg##rootfs=}
296 if [ "${arg##rootflags=}" != "${arg}" ]; then
297 ROOTFLAGS=${arg##rootflags=}
300 commit 16e8a388f3184e59475429cf3fb7e69dd281045d
301 Author: Elan Ruusamäe <glen@delfi.ee>
302 Date: Wed Jun 29 22:55:58 2016 +0300
304 use git-for-each-ref to find last tag
306 omits two commands from pipeline
308 diff --git a/make-tag.sh b/make-tag.sh
309 index 6f54325..87aba64 100755
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/}
323 commit ce3a6bd6821fad3e6e60fb35a8153f95128e7160
324 Author: Elan Ruusamäe <glen@delfi.ee>
325 Date: Wed Jun 29 22:58:16 2016 +0300
329 "git tags" was my local alias i didn't even realize it's not git builtin :)
331 diff --git a/RELEASE b/RELEASE
332 index 4f71b51..3c7639a 100644
335 @@ -2,7 +2,7 @@ HOW TO MAKE A RELEASE
337 before making a release:
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
344 @@ -14,7 +14,7 @@ in short:
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
351 - verify produced tarball with updating geninitrd.spec:master
352 - push tarball to distfiles
354 commit ac6b67a86f7eb4c2d5758920bd9101e863655970
355 Author: Tomasz Pala <gotar@pld-linux.org>
356 Date: Sun Aug 14 12:03:51 2016 +0200
358 newer platforms use xHCI, newer kernels require PCI over HCD modules
359 https://marc.info/?l=git-commits-head&m=141276811802511&w=2
361 diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
362 index e141a0a..e88cda5 100644
363 --- a/geninitrd.sysconfig
364 +++ b/geninitrd.sysconfig
366 #BASICMODULES="-tuxonice_compress"
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"
372 ## Modules that should be loaded before anything (i.e. jbd for ext3)
375 commit 9e77ea77b2359a828325983e58c8a4b39c8b6648
376 Author: Tomasz Pala <gotar@pld-linux.org>
377 Date: Sun Aug 14 17:54:37 2016 +0200
379 hid-generic required as well
381 diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
382 index e88cda5..ccf177c 100644
383 --- a/geninitrd.sysconfig
384 +++ b/geninitrd.sysconfig
386 #BASICMODULES="-tuxonice_compress"
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"
392 ## Modules that should be loaded before anything (i.e. jbd for ext3)
395 commit 0d9c261f8a81bbe23bb097ae14002dce0fcaaa41
396 Author: Tomasz Pala <gotar@pld-linux.org>
397 Date: Sun Aug 14 20:10:24 2016 +0200
399 save precious scrollback buffer contents when data can be fetched later
401 diff --git a/geninitrd b/geninitrd
402 index 432999c..0b838e6 100755
405 @@ -992,7 +992,7 @@ initrd_gen_initramfs_switchroot() {
408 if [ -z "$device" ]; then
409 - if [ "$DEBUGINITRD" ]; then
410 + if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
414 @@ -1041,7 +1041,7 @@ initrd_gen_initramfs_switchroot() {
418 - if [ "$DEBUGINITRD" ]; then
419 + if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
420 echo "Last 20 lines of dmesg:"
424 commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b
425 Author: Tomasz Pala <gotar@pld-linux.org>
426 Date: Sun Aug 14 22:01:15 2016 +0200
428 save 19 lines of debug output (debugrd)
430 diff --git a/geninitrd b/geninitrd
431 index 0b838e6..d152eec 100755
434 @@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
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";
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, "");
446 for (i = 1; i <= n; i++) {
447 num = index(hstr, digit[i]) - 1;
448 res = res + (num * 16 ^ (n - i));
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])+";
459 - min = -1; maj = -1;
461 - # see if we have /dev/hdX or hdX, we can just take partition name
462 - if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
464 - sub("^/dev/", "", partition);
467 - # unify values first
468 - if (root ~ "^" num_pattern_short "$") {
469 - # change "303" => "0x0303"
470 + partition = ""; min = -1; maj = -1;
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"
477 - } else if (root ~ "^" num_pattern "$") {
478 - # change "0303" => "0x0303"
479 + } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
483 maj = h2d(substr(root, 3, 2));
484 min = h2d(substr(root, 5, 2));
488 partition && $4 == partition { maj = $1; min = $2; }
489 $1 == maj && $2 == min { partition = $4; }
492 - if (maj >= 0 && min >= 0) {
493 - printf("maj=%s; min=%s;\n", maj, min);
496 - printf("device=/dev/%s;\n", partition);
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)"
504 if [ -z "$device" ]; then
505 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
507 commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef
508 Author: Elan Ruusamäe <glen@delfi.ee>
509 Date: Mon Aug 15 23:43:06 2016 +0300
513 no actual change recorded, instead some formatting fuckup
515 Revert "save 19 lines of debug output (debugrd)"
517 This reverts commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b.
519 diff --git a/geninitrd b/geninitrd
520 index d152eec..0b838e6 100755
523 @@ -937,40 +937,59 @@ initrd_gen_initramfs_switchroot() {
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";
533 n = split(tolower(str), digit, "");
535 for (i = 1; i <= n; i++) {
536 num = index(hstr, digit[i]) - 1;
537 res = res + (num * 16 ^ (n - i));
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;
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"
554 + min = -1; maj = -1;
556 + # see if we have /dev/hdX or hdX, we can just take partition name
557 + if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
559 + sub("^/dev/", "", partition);
562 + # unify values first
563 + if (root ~ "^" num_pattern_short "$") {
564 + # change "303" => "0x0303"
566 - } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
567 + } else if (root ~ "^" num_pattern "$") {
568 + # change "0303" => "0x0303"
572 maj = h2d(substr(root, 3, 2));
573 min = h2d(substr(root, 5, 2));
577 partition && $4 == partition { maj = $1; min = $2; }
578 $1 == maj && $2 == min { partition = $4; }
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);
588 + printf("device=/dev/%s;\n", partition);
591 + ' /proc/partitions)"
593 if [ -z "$device" ]; then
594 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
596 commit 512f35991fc4b3f9c12469094f6c52c56e0309dd
597 Author: Tomasz Pala <gotar@pld-linux.org>
598 Date: Mon Aug 29 19:31:57 2016 +0200
600 Revert "revert bogus commit"
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.
606 This reverts commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef.
608 diff --git a/geninitrd b/geninitrd
609 index 0b838e6..d152eec 100755
612 @@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
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";
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, "");
624 for (i = 1; i <= n; i++) {
625 num = index(hstr, digit[i]) - 1;
626 res = res + (num * 16 ^ (n - i));
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])+";
637 - min = -1; maj = -1;
639 - # see if we have /dev/hdX or hdX, we can just take partition name
640 - if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
642 - sub("^/dev/", "", partition);
645 - # unify values first
646 - if (root ~ "^" num_pattern_short "$") {
647 - # change "303" => "0x0303"
648 + partition = ""; min = -1; maj = -1;
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"
655 - } else if (root ~ "^" num_pattern "$") {
656 - # change "0303" => "0x0303"
657 + } else if (root ~ "^" num_pattern "$") { # change "0303" => "0x0303"
661 maj = h2d(substr(root, 3, 2));
662 min = h2d(substr(root, 5, 2));
666 partition && $4 == partition { maj = $1; min = $2; }
667 $1 == maj && $2 == min { partition = $4; }
670 - if (maj >= 0 && min >= 0) {
671 - printf("maj=%s; min=%s;\n", maj, min);
674 - printf("device=/dev/%s;\n", partition);
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)"
682 if [ -z "$device" ]; then
683 if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
685 commit dfc0f1befd64d2c3864d5a279110d76bb680d1c2
686 Author: Tomasz Pala <gotar@pld-linux.org>
687 Date: Mon Aug 29 22:32:32 2016 +0200
689 warn about btrfs not fully supported by geninitrd
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.
698 diff --git a/geninitrd b/geninitrd
699 index d152eec..1649787 100755
702 @@ -432,6 +432,7 @@ find_depmod() {
703 smodule=$(basename_module $modpath)
706 + warn "mounting multidevice btrfs volume requires rootfsflags=device=/dev/...,device=/dev/... kernel option"
707 find_depmod "-libcrc32c"
711 commit 60086bea663782db0e65205f248683620f7ece5f
712 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
713 Date: Mon Nov 13 10:29:41 2017 +0100
715 Add support for zstd(.spec) compression.
717 diff --git a/geninitrd b/geninitrd
718 index 1649787..0a18298 100755
721 @@ -46,7 +46,7 @@ proc_partitions=no
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
734 - local compressors='xz lzma bzip2 gzip lzo'
735 + local compressors='zstd xz lzma bzip2 gzip lzo'
737 # a specified one, take it
738 if ! is_yes "$mode"; then
739 @@ -1121,6 +1121,10 @@ find_compressor() {
748 # any existing sym will work
750 @@ -1163,6 +1167,9 @@ compress_image() {
752 lzop -9 < "$IMAGE" > "$tmp" || return $?
755 + zstd -9 < "$IMAGE" > "$tmp" || return $?
758 cat < "$IMAGE" > "$tmp" || return $?
761 commit b5a01dda8ca06f88b1210f806f3ac6da7c0019f0
762 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
763 Date: Fri May 4 15:50:18 2018 +0200
765 ext4 can use crc32 but has it in softdep only
767 diff --git a/geninitrd b/geninitrd
768 index 0a18298..c75c22b 100755
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"
776 + find_depmod "-libcrc32c"
779 find_depmod "-crct10dif-pclmul"
780 find_depmod "-crct10dif"
782 commit 256e0bedb591a982ce87fb2ca1b38e1353d5b33a
783 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
784 Date: Fri Aug 10 10:40:59 2018 +0200
786 ramdisk_size warning makes no sense for initramfs.
788 diff --git a/geninitrd b/geninitrd
789 index c75c22b..025674d 100755
792 @@ -1759,14 +1759,16 @@ case "$INITRDFS" in
793 die "Filesystem $INITRDFS not supported by $PROGRAM"
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"
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"
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!"
815 if ! is_no "$COMPRESS"; then
817 commit 7d4fa91c4a63900ed829b088d2513a60ac764ddd
818 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
819 Date: Mon Aug 13 22:49:31 2018 +0200
821 Drop forced luks type as latest tools support luks2, too. Leave it for cryptsetup autodetection.
823 diff --git a/mod-luks.sh b/mod-luks.sh
824 index 8e9bc46..99ff4a6 100644
827 @@ -157,7 +157,7 @@ luks_crypttab() {
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'"
836 @@ -184,7 +184,7 @@ luks_crypttab() {
837 crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
838 if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
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
846 commit 042e65b6bf2018ce17fcc275b0f4da26ef2de2ff
847 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
848 Date: Tue Aug 14 13:09:55 2018 +0200
850 libpthread dlopens libgcc_s.so.1, so install it.
852 diff --git a/geninitrd b/geninitrd
853 index 025674d..50be081 100755
856 @@ -538,15 +538,20 @@ inst_exec() {
860 - local obj lib libs libdir
861 + local obj lib libs libs_additional libdir
864 /lib/ld-linux.so.2 | /lib64/ld-linux-x86-64.so.2 | /libx32/ld-linux-x32.so.2)
867 + /lib/libpthread.so* | /lib64/libpthread.so* | /libx32/libpthread.so*)
868 + libs_additional="${obj%/libpthread*}/libgcc_s.so.1"
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
880 commit 99634b923a68cb279eae5fd72286dcb9e52f8f25
881 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
882 Date: Tue Aug 14 13:32:41 2018 +0200
884 cryptsetup needs /var/run/cryptsetup dir.
886 diff --git a/mod-luks.sh b/mod-luks.sh
887 index 99ff4a6..4a93aa7 100644
890 @@ -89,6 +89,7 @@ initrd_gen_luks() {
893 inst_exec $cryptsetup /bin/cryptsetup
894 + inst_d /var/run/cryptsetup
899 commit 32b9509df0d88c0814a0dfef2465a46ade008b28
900 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
901 Date: Tue Aug 14 13:57:58 2018 +0200
903 Include more modules for luks. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809686#10
905 diff --git a/mod-luks.sh b/mod-luks.sh
906 index 4a93aa7..9fbf583 100644
909 @@ -67,6 +67,10 @@ find_modules_luks() {
913 + find_module "-af-alg"
914 + find_module "-algif_hash"
915 + find_module "-algif_skcipher"
916 + find_module "-loop"
919 dev=$(awk -vLUKSNAME="$LUKSNAME" '$1 == LUKSNAME { print $2 }' /etc/crypttab)
921 commit 4fa03792dc42a77bfa98449828c87b3d23fd0a17
922 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
923 Date: Tue Aug 14 14:08:52 2018 +0200
925 Fix condition for --debug mode which adds additional text after 'inactive' text.
927 diff --git a/mod-luks.sh b/mod-luks.sh
928 index 9fbf583..ff877f7 100644
931 @@ -187,7 +187,7 @@ luks_crypttab() {
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
938 cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1