]> git.pld-linux.org Git - packages/geninitrd.git/blobdiff - geninitrd-git.patch
- rel 5; add fixes from git
[packages/geninitrd.git] / geninitrd-git.patch
index 172bc1fa097a0ce0d462024bd4f91b544ef94252..2287221318db329aa5305681c9dda2c5fc2e35c7 100644 (file)
-commit a16a1beafe3929b47bc28208c375520771c84b08
+commit 43d2f37d89034a2e409bb4f66cca1a64b12130b8
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Wed Jan 20 21:57:53 2016 +0100
+Date:   Mon Nov 25 20:15:24 2019 +0100
 
-    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.
+    Accept d/D symbols, too (ffffffff825ca52c D __initramfs_start) as noticed in recent 4.19.85-1 kernel.
 
 diff --git a/geninitrd b/geninitrd
-index 7b962b5..a4de196 100755
+index 05e290a..052f553 100755
 --- a/geninitrd
 +++ b/geninitrd
-@@ -1103,8 +1103,7 @@ sym_exists() {
- # find best compressor (or forced one) for initrd
- find_compressor() {
-       local mode="$1"
--      # fastest initrd decompression speed is first
--      local compressors='lzo gzip xz lzma bzip2'
-+      local compressors='xz lzma bzip2 gzip lzo'
-       # a specified one, take it
-       if ! is_yes "$mode"; then
-
-commit a52ae08eef1036b833da1cbecf27f04782a1d473
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Sun Jan 31 17:00:15 2016 +0100
-
-    Always include partitions and containers when starting mdadm array.
-
-diff --git a/mod-md.sh b/mod-md.sh
-index a0cd7aa..1c5c60c 100644
---- a/mod-md.sh
-+++ b/mod-md.sh
-@@ -139,6 +139,8 @@ initrd_gen_md() {
+@@ -1097,7 +1097,7 @@ sym_exists() {
+               return 1
+       fi
  
-       inst_exec $mdassemble /bin/mdassemble
+-      awk -vc=1 -vsymbol="$symbol" '($2 == "T" || $2 == "t") && $3 == symbol {c = 0} END {exit c}' $mapfile
++      awk -vc=1 -vsymbol="$symbol" '(tolower($2) == "t" || tolower($2) == "d") && $3 == symbol {c = 0} END {exit c}' $mapfile
+ }
  
-+      echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
-+
-       # LVM on RAID case
-       local dev_list_extra ex_dev
-       dev_list_extra=$(awk '/^DEVICE / { for (i=2; i<=NF; i++) { printf "%s ", $i; }; } ' /etc/mdadm.conf | xargs)
-
-commit 44c13508fd5b62e82335bea903690609a35de913
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Sun Jan 31 17:03:18 2016 +0100
-
-    Allow containers in ex devices.
-
-diff --git a/mod-md.sh b/mod-md.sh
-index 1c5c60c..d9093d4 100644
---- a/mod-md.sh
-+++ b/mod-md.sh
-@@ -146,8 +146,8 @@ initrd_gen_md() {
-       dev_list_extra=$(awk '/^DEVICE / { for (i=2; i<=NF; i++) { printf "%s ", $i; }; } ' /etc/mdadm.conf | xargs)
-       new_dev_list_extra=""
-       for ex_dev in $dev_list_extra; do
--              if [ "$ex_dev" = "partitions" ]; then
--                      echo "DEVICE partitions" >> "$DESTDIR/etc/mdadm.conf"
-+              if [ "$ex_dev" = "partitions" -o "$ex_dev" = "containers" ]; then
-+                      echo "DEVICE $ex_dev" >> "$DESTDIR/etc/mdadm.conf"
-                       # FIXME: find and copy partition devices from /proc/partitions
-                       #        - best if done at runtime, now initrd gen time
-                       continue
+ # find best compressor (or forced one) for initrd
 
-commit fee61d3f4dd96bfdca441a8ab524d9928309559e
+commit 04b32086569a126d5d6f9bd0ad1b0db9f142f50e
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Fri Feb 26 18:15:14 2016 +0100
+Date:   Sun Jul 21 21:04:05 2019 +0200
 
-    Check if kernel supports specified INITRDFS (tested with initramfs and romfs only though)
+    Try to detect a need for nvme driver. If you know better method then share with us.
 
 diff --git a/geninitrd b/geninitrd
-index a4de196..92a519d 100755
+index b5d405a..05e290a 100755
 --- a/geninitrd
 +++ b/geninitrd
-@@ -1097,7 +1097,7 @@ sym_exists() {
-               return 1
+@@ -673,6 +673,11 @@ find_modules_for_devpath() {
+               return
        fi
  
--      awk -vc=1 -vsymbol="$symbol" '$2 == "T" && $3 == symbol {c = 0} END {exit c}' $mapfile
-+      awk -vc=1 -vsymbol="$symbol" '($2 == "T" || $2 == "t") && $3 == symbol {c = 0} END {exit c}' $mapfile
- }
- # find best compressor (or forced one) for initrd
-@@ -1400,24 +1400,46 @@ if [ -z "$INITRDFS" ]; then
-       fi
- fi
--case "$INITRDFS" in
--  ext2)
--      [ -x /sbin/mke2fs ] || die "/sbin/mke2fs is missing"
--      ;;
--  rom|romfs)
--      [ -x /sbin/genromfs ] || die "/sbin/genromfs is missing"
--      ;;
--  cram|cramfs)
--      [ -x /sbin/mkcramfs ] || die "/sbin/mkcramfs is missing"
--      ;;
--  initramfs)
--      [ -x /bin/cpio ] || die "/bin/cpio is missing"
--      [ -x /usr/bin/find ] || die "/usr/bin/find is missing"
--      ;;
--  *)
--      die "Filesystem $INITRDFS on initrd is not supported"
--      ;;
--esac
-+check_initrd_fs() {
-+      local s sfound sym p prog map=/boot/System.map-$kernel
-+      case "$INITRDFS" in
-+              ext2)
-+                      # TODO: symbols to check in case of ext2 used via ext3/4 subsystem
-+                      sym=init_ext2_fs
-+                      prog=/sbin/mke2fs
-+                      ;;
-+              rom|romfs)
-+                      sym=init_romfs_fs
-+                      prog=/sbin/genromfs
-+                      ;;
-+              cram|cramfs)
-+                      sym=init_cramfs_fs
-+                      prog=/sbin/mkcramfs
-+                      ;;
-+              initramfs)
-+                      sym=__initramfs_start
-+                      prog="/bin/cpio /usr/bin/find"
-+                      ;;
-+              *)
-+                      die "Filesystem $INITRDFS on initrd is not supported by geninitrd"
-+                      ;;
-+      esac
-+
-+      # only one is needed (for cases like ext2 via ext2 or via ext3 or via ext4 subsysytem)
-+      sfound=0
-+      for s in $sym; do
-+              sym_exists $map $s && sfound=1
-+              break
-+      done
-+      if [ "$sfound" -eq "0" ]; then
-+              die "Filesystem $INITRDFS on initrd is not supported by kernel"
++      if [[ "$devpath" == /dev/nvme* ]]; then
++              find_module "nvme"
++              return
 +      fi
 +
-+      for p in $prog; do
-+              [ ! -x "$p" ] && die "$prog is missing"
+       if [[ "$devpath" == /dev/bcache* ]]; then
+               find_modules_bcache "$devpath"
+               return
+
+commit 4de5a3333e772ad198381f157c014e452e42c129
+Author: Elan Ruusamäe <glen@pld-linux.org>
+Date:   Mon Jul 15 23:56:58 2019 +0300
+
+    fix indent
+
+diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
+index ff8f442..35543b7 100644
+--- a/mod-usbkbd.sh
++++ b/mod-usbkbd.sh
+@@ -10,22 +10,22 @@ find_modules_usbkbd() {
+       local modules i module bInterfaceClass bInterfaceProtocol
+-        for i in /sys/bus/usb/devices/*-*:*; do
+-                # standard usb keyboards
+-                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
+-                        bInterfaceClass=$(cat $i/bInterfaceClass)
+-                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
+-                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
+-                                module=$(readlink $i/driver/module)
+-                                module=$(basename $module)
++      for i in /sys/bus/usb/devices/*-*:*; do
++              # standard usb keyboards
++              if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
++                      bInterfaceClass=$(cat $i/bInterfaceClass)
++                      bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
++                      if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
++                              module=$(readlink $i/driver/module)
++                              module=$(basename $module)
+-                                if [ -n "$module" ]; then
+-                                        verbose "Found USB Keyboard driver: $module"
+-                                        modules="$modules $module"
+-                                fi
+-                        fi
+-                fi
+-        done
++                              if [ -n "$module" ]; then
++                                      verbose "Found USB Keyboard driver: $module"
++                                      modules="$modules $module"
++                              fi
++                      fi
++              fi
 +      done
-+}
-+check_initrd_fs
  
- if [ -L "$target" ]; then
-       target=$(readlink -f "$target")
+       for i in /sys/class/input/input*; do
+               # standard usb keyboards
 
-commit 985c7aef65f1fd4a704ded7218fb2df010153080
+commit 662fd5a3adac2080640fa4eacd34d72504526175
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Sat May 7 12:34:33 2016 +0200
-
-    Use uevent feature of new busybox instead of pure and racy mdev via hotplug
-
-diff --git a/mod-udev.sh b/mod-udev.sh
-index 30114cd..422ef3e 100644
---- a/mod-udev.sh
-+++ b/mod-udev.sh
-@@ -115,8 +115,9 @@ initrd_gen_stop_udevd() {
- initrd_gen_mdev() {
-       debug "Setting up mdev..."
--      busybox_applet mdev
-+      busybox_applet mdev uevent
-       ln -s busybox $DESTDIR/bin/mdev
-+      ln -s busybox $DESTDIR/bin/uevent
-       cat > $DESTDIR/etc/mdev.conf    <<-'EOF'
- # Provide user, group, and mode information for devices.  If a regex matches
-@@ -157,13 +158,13 @@ hd[a-z]* 0:6 660
-       add_linuxrc     <<-'EOF'
-               # \n needed in mdev.seq
-               echo > /dev/mdev.seq
--              echo /bin/mdev > /proc/sys/kernel/hotplug
-+              uevent mdev &
-               mdev -s
-       EOF
- }
- initrd_gen_stop_mdev() {
-       add_linuxrc     <<-'EOF'
--              killall mdev > /dev/null 2>&1
-+              killall uevent > /dev/null 2>&1
-       EOF
- }
+Date:   Mon Jul 15 19:59:46 2019 +0200
+
+    Another way for findings usb keyboard drivers that works on newer kernels.
+
+diff --git a/mod-usbkbd.sh b/mod-usbkbd.sh
+index 0dd0d20..ff8f442 100644
+--- a/mod-usbkbd.sh
++++ b/mod-usbkbd.sh
+@@ -10,6 +10,23 @@ find_modules_usbkbd() {
+       local modules i module bInterfaceClass bInterfaceProtocol
++        for i in /sys/bus/usb/devices/*-*:*; do
++                # standard usb keyboards
++                if [ -f $i/bInterfaceClass -a -f $i/bInterfaceProtocol ]; then
++                        bInterfaceClass=$(cat $i/bInterfaceClass)
++                        bInterfaceProtocol=$(cat $i/bInterfaceProtocol)
++                        if [ "$bInterfaceClass" = "03" -a "$bInterfaceProtocol" = "01" ]; then
++                                module=$(readlink $i/driver/module)
++                                module=$(basename $module)
++
++                                if [ -n "$module" ]; then
++                                        verbose "Found USB Keyboard driver: $module"
++                                        modules="$modules $module"
++                                fi
++                        fi
++                fi
++        done
++
+       for i in /sys/class/input/input*; do
+               # standard usb keyboards
+               if [ -f $i/device/bInterfaceClass -a -f $i/device/bInterfaceProtocol ]; then
 
-commit 11202855dbaee5bc32209913df1ae8738c210c39
+commit b565e95c147bea4e68e4ccf5ad19906d51d2375b
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Sat May 14 00:36:02 2016 +0200
+Date:   Wed May 15 21:04:45 2019 +0200
 
-    Make rootdev fallback work.
+    Prepend cpu microcode to initrd image, so kernel will pick it up when LILO is in use.
 
 diff --git a/geninitrd b/geninitrd
-index 92a519d..771245e 100755
+index 118333c..b5d405a 100755
 --- a/geninitrd
 +++ b/geninitrd
-@@ -1004,7 +1004,11 @@ initrd_gen_initramfs_switchroot() {
+@@ -17,6 +17,7 @@ PROGRAM=${0##*/}
+ # list of geninitrd modules which need setup routine after commandline args parsing
+ GENINITRD_MODS=""
+ COMPRESS=yes
++LILO_MICROCODE=yes
+ STRIP=/usr/bin/strip
+ target=""
+ kernel=""
+@@ -1186,6 +1187,16 @@ compress_image() {
+       mv -f "$tmp" "$target"
+ }
  
-               # XXX hack, fallback to rootdev from geninitrd time
-               if [ ! -e "$device" ]; then
-+      EOF
-+      add_linuxrc <<-EOF
-                       device="$rootdev"
-+      EOF
-+      add_linuxrc <<-'EOF'
-                       echo "DEVICE set to $device based on fstab entry from initrd gen time"
-               fi
++# prepend file to image
++prepend_file_to_image() {
++      local file="$1" target="$2" tmp
++      tmp=$(mktemp "$target".XXXXXX) || die "mktemp failed"
++
++      cat "$file" "$target" > "$tmp" || return $?
++
++      mv -f "$tmp" "$target"
++}
++
+ if [ -r /etc/sysconfig/geninitrd ]; then
+       . /etc/sysconfig/geninitrd
+ fi
+@@ -1801,6 +1812,14 @@ else
+       cp -a "$IMAGE" "$target"
+ fi
  
-
-commit 583a7f5f8783fb1f92b75ca9f651d675df016b73
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Jun 7 08:30:46 2016 +0200
-
-    Mount /run with 0755.
-
-diff --git a/geninitrd b/geninitrd
-index 771245e..62e47ee 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -273,7 +273,7 @@ mount_run() {
-       fi
++# microcode support for lilo
++if ! is_no "$LILO_MICROCODE"; then
++      if [ -x /sbin/lilo -a -f "/boot/intel-ucode.img" ]; then
++              verbose "Prepending $target with microcode image /boot/intel-ucode.img for LILO"
++              prepend_file_to_image "/boot/intel-ucode.img" "$target"
++      fi
++fi
++
+ # XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
+ initrd_gen_bootsplash "$target"
  
-       run_mounted=yes
--      echo "mount -t tmpfs run /run" | add_linuxrc
-+      echo "mount -t tmpfs run /run -o mode=0755" | add_linuxrc
- }
+diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
+index ccf177c..1268324 100644
+--- a/geninitrd.sysconfig
++++ b/geninitrd.sysconfig
+@@ -18,6 +18,9 @@
+ # Default is to use initramfs for >= 2.5.0.
+ #INITRDFS=initramfs
++# Should we prepend cpu microcode when lilo is installed
++#LILO_MICROCODE=no
++
+ ## Use udev to create /dev?
+ USE_UDEV=yes
  
- # unmount all mountpoints mounted by geninitrd
 
-commit 8c1bff4fcc5f9c5c60aea7ab168a96c7d6e93470
+commit ad5033d7e704edaf52f2be18d4aa98c378179ede
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Jun 7 08:36:48 2016 +0200
+Date:   Fri Jan 25 20:38:24 2019 +0100
 
-    cryptsetup: Use 120s timeout when asking for password.
+    Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to that.
 
 diff --git a/mod-luks.sh b/mod-luks.sh
-index 09e31d3..8e9bc46 100644
+index ff877f7..ffe87cb 100644
 --- a/mod-luks.sh
 +++ b/mod-luks.sh
-@@ -157,7 +157,7 @@ luks_crypttab() {
+@@ -162,7 +162,7 @@ luks_crypttab() {
                        done
                        IFS="$old_IFS"
  
--                      verbose "+ cryptsetup ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
-+                      verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
+-                      verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
++                      verbose "+ cryptsetup ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
                        add_linuxrc <<-EOF
                        debugshell
  
-@@ -184,7 +184,7 @@ luks_crypttab() {
+@@ -189,7 +189,7 @@ luks_crypttab() {
                                crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
-                               if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
+                               if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
                                        # is inactive
--                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
-+                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
+-                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
++                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} open $crypttab_opt "\$luksdev" '$dst' <&1
                                fi
                        fi
  
 
-commit 7e3c63ed836b899d5217506e408b35284b6a00bc
+commit 21ad0f7980ce6a0135e4a3c37a94472ed4f1320c
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Jun 7 16:52:17 2016 +0200
-
-    Also mount /run as noexec,nosuid,nodev (as suggested by qboosh).
-
-diff --git a/geninitrd b/geninitrd
-index 62e47ee..e94ca12 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -273,7 +273,7 @@ mount_run() {
-       fi
-       run_mounted=yes
--      echo "mount -t tmpfs run /run -o mode=0755" | add_linuxrc
-+      echo "mount -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev" | add_linuxrc
- }
- # unmount all mountpoints mounted by geninitrd
-
-commit b13c409df04d048f45d246603a779e39f2fed2b4
-Author: Elan Ruusamäe <glen@delfi.ee>
-Date:   Wed Jun 29 22:48:43 2016 +0300
-
-    accept rootfs= kernel commandline argument
-
-diff --git a/geninitrd b/geninitrd
-index e94ca12..432999c 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -1580,6 +1580,9 @@ add_linuxrc <<-'EOF'
-               if [ "${arg##root=}" != "${arg}" ]; then
-                       ROOT=${arg##root=}
-               fi
-+              if [ "${arg##rootfs=}" != "${arg}" ]; then
-+                      ROOTFS=${arg##rootfs=}
-+              fi
-               if [ "${arg##rootflags=}" != "${arg}" ]; then
-                       ROOTFLAGS=${arg##rootflags=}
-               fi
-
-commit 16e8a388f3184e59475429cf3fb7e69dd281045d
-Author: Elan Ruusamäe <glen@delfi.ee>
-Date:   Wed Jun 29 22:55:58 2016 +0300
-
-    use git-for-each-ref to find last tag
-    
-    omits two commands from pipeline
+Date:   Tue Dec 18 14:43:20 2018 +0100
 
-diff --git a/make-tag.sh b/make-tag.sh
-index 6f54325..87aba64 100755
---- a/make-tag.sh
-+++ b/make-tag.sh
-@@ -1,7 +1,8 @@
- #!/bin/sh
- set -e
- rev=$(git rev-parse HEAD)
--last_tag=$(git tag -l | grep -E '^[0-9]+' | sort -V | tail -n1)
-+ref=$(git for-each-ref 'refs/tags' --format='%(refname)' --sort=taggerdate | tail -n1)
-+last_tag=${ref#refs/tags/}
- if [ -n "$1" ]; then
-       tag="$1"
-
-commit ce3a6bd6821fad3e6e60fb35a8153f95128e7160
-Author: Elan Ruusamäe <glen@delfi.ee>
-Date:   Wed Jun 29 22:58:16 2016 +0300
-
-    git tag -l
-    
-    "git tags" was my local alias i didn't even realize it's not git builtin :)
-
-diff --git a/RELEASE b/RELEASE
-index 4f71b51..3c7639a 100644
---- a/RELEASE
-+++ b/RELEASE
-@@ -2,7 +2,7 @@ HOW TO MAKE A RELEASE
- before making a release:
--- run make dist, create package with resulting tarball to check that code is
-+- run "make dist", create package with resulting tarball to check that code is
-   stable enough for a release
- to make a release:
-@@ -14,7 +14,7 @@ in short:
- in details:
- - run 'make tag'
-  - fill git shortlog into annotate tag commit message:
--   $ git shortlog $(git tags | sort -nr | head -n1)..HEAD
-+   $ git shortlog $(git tag -l | sort -nr | head -n1)..HEAD
- - run 'make dist'
- - verify produced tarball with updating geninitrd.spec:master
- - push tarball to distfiles
-
-commit ac6b67a86f7eb4c2d5758920bd9101e863655970
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Sun Aug 14 12:03:51 2016 +0200
-
-    newer platforms use xHCI, newer kernels require PCI over HCD modules
-    https://marc.info/?l=git-commits-head&m=141276811802511&w=2
-
-diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
-index e141a0a..e88cda5 100644
---- a/geninitrd.sysconfig
-+++ b/geninitrd.sysconfig
-@@ -3,7 +3,7 @@
- #BASICMODULES="-tuxonice_compress"
- ## Basic modules to include USB keyboard
--#BASICMODULES="usbhid ehci-hcd uhci-hcd ohci-hcd"
-+#BASICMODULES="usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
- ## Modules that should be loaded before anything (i.e. jbd for ext3)
- #PREMODS=""
+    Use existing mechanism for installing udev apps but install regular variants, too if initrd-variants don't exist.
 
-commit 9e77ea77b2359a828325983e58c8a4b39c8b6648
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Sun Aug 14 17:54:37 2016 +0200
-
-    hid-generic required as well
-
-diff --git a/geninitrd.sysconfig b/geninitrd.sysconfig
-index e88cda5..ccf177c 100644
---- a/geninitrd.sysconfig
-+++ b/geninitrd.sysconfig
-@@ -3,7 +3,7 @@
- #BASICMODULES="-tuxonice_compress"
- ## Basic modules to include USB keyboard
--#BASICMODULES="usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
-+#BASICMODULES="hid-generic usbhid xhci-pci ehci-pci ehci-hcd uhci-hcd ohci-hcd"
- ## Modules that should be loaded before anything (i.e. jbd for ext3)
- #PREMODS=""
-
-commit 0d9c261f8a81bbe23bb097ae14002dce0fcaaa41
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Sun Aug 14 20:10:24 2016 +0200
-
-    save precious scrollback buffer contents when data can be fetched later
-
-diff --git a/geninitrd b/geninitrd
-index 432999c..0b838e6 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -992,7 +992,7 @@ initrd_gen_initramfs_switchroot() {
-                       ' /proc/partitions)"
-               if [ -z "$device" ]; then
--                      if [ "$DEBUGINITRD" ]; then
-+                      if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
-                               cat /proc/partitions
-                       fi
-                       device=$ROOT
-@@ -1041,7 +1041,7 @@ initrd_gen_initramfs_switchroot() {
-       busybox_applet dmesg
-       busybox_applet tail
-       add_linuxrc <<-'EOF'
--              if [ "$DEBUGINITRD" ]; then
-+              if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
-                       echo "Last 20 lines of dmesg:"
-                       dmesg | tail -n 20
+diff --git a/mod-udev.sh b/mod-udev.sh
+index a2491ee..87f4b68 100644
+--- a/mod-udev.sh
++++ b/mod-udev.sh
+@@ -44,8 +44,6 @@ initrd_gen_udev() {
+       inst_d /sbin /etc/udev /lib/udev
+       inst_exec $udevd /sbin/udevd
+       inst_exec $udevadm /sbin/udevadm
+-      inst_exec /lib/udev/ata_id  /lib/udev/ata_id
+-      inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
+       inst /etc/udev/udev.conf /etc/udev/udev.conf
+       # standard udev rules
+       inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
+@@ -57,6 +55,8 @@ initrd_gen_udev() {
+       for e in ata_id cdrom_id collect firmware scsi_id v4l_id; do
+               if [ -e "$initrd_dir/udev/$e" ]; then
+                       inst_exec $initrd_dir/udev/$e /lib/udev/$e
++              elif [ -e "/lib/udev/$e" ]; then
++                      inst_exec /lib/udev/$e /lib/udev/$e
                fi
-
-commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Sun Aug 14 22:01:15 2016 +0200
-
-    save 19 lines of debug output (debugrd)
-
-diff --git a/geninitrd b/geninitrd
-index 0b838e6..d152eec 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
-       add_linuxrc <<-'EOF'
-               device=
-               eval "$(busybox awk -v root="$ROOT" '
--                      # http://9fans.net/archive/2006/09/261
--                      function h2d(str, hstr, res, num, n, digit, i) {
--                              hstr = "0123456789abdcef";
--                              res = 0;
-+                      function h2d(str, hstr, res, num, n, digit, i) {        # http://9fans.net/archive/2006/09/261
-+                              hstr = "0123456789abdcef"; res = 0;
-                               n = split(tolower(str), digit, "");
-                               for (i = 1; i <= n; i++) {
-                                       num = index(hstr, digit[i]) - 1;
-                                       res = res + (num * 16 ^ (n - i));
-                               }
--
-                               return res;
-                       }
-                       BEGIN {
--
-                               num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
-                               num_pattern = "[0-9a-fA-F]" num_pattern_short;
-                               dev_pattern = "[hms][a-z][a-z]([0-9])+";
--                              partition = "";
--                              min = -1; maj = -1;
--
--                              # see if we have /dev/hdX or hdX, we can just take partition name
--                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
--                                      partition = root
--                                      sub("^/dev/", "", partition);
--
--                              } else {
--                                      # unify values first
--                                      if (root ~ "^" num_pattern_short "$")  {
--                                              # change "303" => "0x0303"
-+                              partition = ""; min = -1; maj = -1;
-+
-+                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {  # see if we have /dev/hdX or hdX, we can just take partition name
-+                                      partition = root; sub("^/dev/", "", partition);
-+                              } else {        # unify values first
-+                                      if (root ~ "^" num_pattern_short "$")  {        # change "303" => "0x0303"
-                                               root = "0x0" root
--                                      } else if (root ~ "^" num_pattern "$")  {
--                                              # change "0303" => "0x0303"
-+                                      } else if (root ~ "^" num_pattern "$")  {       # change "0303" => "0x0303"
-                                               root = "0x" root
-                                       }
--
-                                       maj = h2d(substr(root, 3, 2));
-                                       min = h2d(substr(root, 5, 2));
-                               }
-                       }
--
-                       partition && $4 == partition { maj = $1; min = $2; }
-                       $1 == maj && $2 == min { partition = $4; }
--
-                       END {
--                              if (maj >= 0 && min >= 0) {
--                                      printf("maj=%s; min=%s;\n", maj, min);
--                              }
--                              if (partition) {
--                                      printf("device=/dev/%s;\n", partition);
--                              }
--                      }
--                      ' /proc/partitions)"
-+                              if (maj >= 0 && min >= 0) {     printf("maj=%s; min=%s;\n", maj, min);  }
-+                              if (partition) {                printf("device=/dev/%s;\n", partition); }
-+                      }' /proc/partitions)"
-               if [ -z "$device" ]; then
-                       if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
-
-commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef
-Author: Elan Ruusamäe <glen@delfi.ee>
-Date:   Mon Aug 15 23:43:06 2016 +0300
-
-    revert bogus commit
-    
-    no actual change recorded, instead some formatting fuckup
-    
-    Revert "save 19 lines of debug output (debugrd)"
-    
-    This reverts commit 6ed0f7b1ebdba0a6aaed765e3f4c293ac09f975b.
-
-diff --git a/geninitrd b/geninitrd
-index d152eec..0b838e6 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -937,40 +937,59 @@ initrd_gen_initramfs_switchroot() {
-       add_linuxrc <<-'EOF'
-               device=
-               eval "$(busybox awk -v root="$ROOT" '
--                      function h2d(str, hstr, res, num, n, digit, i) {        # http://9fans.net/archive/2006/09/261
--                              hstr = "0123456789abdcef"; res = 0;
-+                      # http://9fans.net/archive/2006/09/261
-+                      function h2d(str, hstr, res, num, n, digit, i) {
-+                              hstr = "0123456789abdcef";
-+                              res = 0;
-                               n = split(tolower(str), digit, "");
-                               for (i = 1; i <= n; i++) {
-                                       num = index(hstr, digit[i]) - 1;
-                                       res = res + (num * 16 ^ (n - i));
-                               }
-+
-                               return res;
-                       }
-                       BEGIN {
-+
-                               num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
-                               num_pattern = "[0-9a-fA-F]" num_pattern_short;
-                               dev_pattern = "[hms][a-z][a-z]([0-9])+";
--                              partition = ""; min = -1; maj = -1;
--
--                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {  # see if we have /dev/hdX or hdX, we can just take partition name
--                                      partition = root; sub("^/dev/", "", partition);
--                              } else {        # unify values first
--                                      if (root ~ "^" num_pattern_short "$")  {        # change "303" => "0x0303"
-+                              partition = "";
-+                              min = -1; maj = -1;
-+
-+                              # see if we have /dev/hdX or hdX, we can just take partition name
-+                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
-+                                      partition = root
-+                                      sub("^/dev/", "", partition);
-+
-+                              } else {
-+                                      # unify values first
-+                                      if (root ~ "^" num_pattern_short "$")  {
-+                                              # change "303" => "0x0303"
-                                               root = "0x0" root
--                                      } else if (root ~ "^" num_pattern "$")  {       # change "0303" => "0x0303"
-+                                      } else if (root ~ "^" num_pattern "$")  {
-+                                              # change "0303" => "0x0303"
-                                               root = "0x" root
-                                       }
-+
-                                       maj = h2d(substr(root, 3, 2));
-                                       min = h2d(substr(root, 5, 2));
-                               }
-                       }
-+
-                       partition && $4 == partition { maj = $1; min = $2; }
-                       $1 == maj && $2 == min { partition = $4; }
-+
-                       END {
--                              if (maj >= 0 && min >= 0) {     printf("maj=%s; min=%s;\n", maj, min);  }
--                              if (partition) {                printf("device=/dev/%s;\n", partition); }
--                      }' /proc/partitions)"
-+                              if (maj >= 0 && min >= 0) {
-+                                      printf("maj=%s; min=%s;\n", maj, min);
-+                              }
-+                              if (partition) {
-+                                      printf("device=/dev/%s;\n", partition);
-+                              }
-+                      }
-+                      ' /proc/partitions)"
-               if [ -z "$device" ]; then
-                       if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
-
-commit 512f35991fc4b3f9c12469094f6c52c56e0309dd
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Mon Aug 29 19:31:57 2016 +0200
-
-    Revert "revert bogus commit"
-    
-    This 'formatting fuckup' was the point for saving scrollback buffer.
-    As you probably don't put it together, issuing debuginitrd throws all that function
-    contents to your face during boot.
-    
-    This reverts commit 9d45e9b492b0114bf5a536918b5ca511e8c5dcef.
-
-diff --git a/geninitrd b/geninitrd
-index 0b838e6..d152eec 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -937,59 +937,40 @@ initrd_gen_initramfs_switchroot() {
-       add_linuxrc <<-'EOF'
-               device=
-               eval "$(busybox awk -v root="$ROOT" '
--                      # http://9fans.net/archive/2006/09/261
--                      function h2d(str, hstr, res, num, n, digit, i) {
--                              hstr = "0123456789abdcef";
--                              res = 0;
-+                      function h2d(str, hstr, res, num, n, digit, i) {        # http://9fans.net/archive/2006/09/261
-+                              hstr = "0123456789abdcef"; res = 0;
-                               n = split(tolower(str), digit, "");
-                               for (i = 1; i <= n; i++) {
-                                       num = index(hstr, digit[i]) - 1;
-                                       res = res + (num * 16 ^ (n - i));
-                               }
--
-                               return res;
-                       }
-                       BEGIN {
--
-                               num_pattern_short = "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]";
-                               num_pattern = "[0-9a-fA-F]" num_pattern_short;
-                               dev_pattern = "[hms][a-z][a-z]([0-9])+";
--                              partition = "";
--                              min = -1; maj = -1;
--
--                              # see if we have /dev/hdX or hdX, we can just take partition name
--                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {
--                                      partition = root
--                                      sub("^/dev/", "", partition);
--
--                              } else {
--                                      # unify values first
--                                      if (root ~ "^" num_pattern_short "$")  {
--                                              # change "303" => "0x0303"
-+                              partition = ""; min = -1; maj = -1;
-+
-+                              if (root ~ "^\/dev\/" dev_pattern "$" || root ~ "^" dev_pattern "$") {  # see if we have /dev/hdX or hdX, we can just take partition name
-+                                      partition = root; sub("^/dev/", "", partition);
-+                              } else {        # unify values first
-+                                      if (root ~ "^" num_pattern_short "$")  {        # change "303" => "0x0303"
-                                               root = "0x0" root
--                                      } else if (root ~ "^" num_pattern "$")  {
--                                              # change "0303" => "0x0303"
-+                                      } else if (root ~ "^" num_pattern "$")  {       # change "0303" => "0x0303"
-                                               root = "0x" root
-                                       }
--
-                                       maj = h2d(substr(root, 3, 2));
-                                       min = h2d(substr(root, 5, 2));
-                               }
-                       }
--
-                       partition && $4 == partition { maj = $1; min = $2; }
-                       $1 == maj && $2 == min { partition = $4; }
--
-                       END {
--                              if (maj >= 0 && min >= 0) {
--                                      printf("maj=%s; min=%s;\n", maj, min);
--                              }
--                              if (partition) {
--                                      printf("device=/dev/%s;\n", partition);
--                              }
--                      }
--                      ' /proc/partitions)"
-+                              if (maj >= 0 && min >= 0) {     printf("maj=%s; min=%s;\n", maj, min);  }
-+                              if (partition) {                printf("device=/dev/%s;\n", partition); }
-+                      }' /proc/partitions)"
-               if [ -z "$device" ]; then
-                       if [ "$DEBUGINITRD" -a "$DEBUGINITRD" != 'sh' ]; then
-
-commit dfc0f1befd64d2c3864d5a279110d76bb680d1c2
-Author: Tomasz Pala <gotar@pld-linux.org>
-Date:   Mon Aug 29 22:32:32 2016 +0200
-
-    warn about btrfs not fully supported by geninitrd
-    
-    Before mounting multidevice btrfs filesystem, `btrfs device scan' needs to
-    be executed, otherwise filesystem won't mount. Without the btrfs binary,
-    one might instruct kernel in command line insted, but this is also not
-    supported (blkid finds single device only). Since there is dracut, just
-    notice user about this shortcoming, so he could properly configure
-    bootloader by manually appending appropriate devices when needed.
-
-diff --git a/geninitrd b/geninitrd
-index d152eec..1649787 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -432,6 +432,7 @@ find_depmod() {
-                       smodule=$(basename_module $modpath)
-                       case "$smodule" in
-                               btrfs)
-+                                      warn "mounting multidevice btrfs volume requires rootfsflags=device=/dev/...,device=/dev/... kernel option"
-                                       find_depmod "-libcrc32c"
-                                       ;;
-                               crc-t10dif)
-
-commit 60086bea663782db0e65205f248683620f7ece5f
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Mon Nov 13 10:29:41 2017 +0100
-
-    Add support for zstd(.spec) compression.
-
-diff --git a/geninitrd b/geninitrd
-index 1649787..0a18298 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -46,7 +46,7 @@ proc_partitions=no
- usage() {
-       echo "Usage: $PROGRAM [--version] [-v] [-f] [--ifneeded] [--preload <module>]"
-       echo "       [--with=<module>] [--image-version] [--fstab=<fstab>] [--nocompress]"
--      echo "       [--compress=yes|xz|lzma|bzip2|gzip|lzo]"
-+      echo "       [--compress=yes|zstd|xz|lzma|bzip2|gzip|lzo]"
-       echo "       [--nostrip ] [--strip PATH/strip] [--strip=PATH/strip]"
-       echo "       [--initrdfs=rom|initramfs|ext2|cram] [--modules-conf=<modules.conf>]"
-       echo "       [--with-bootsplash] [--without-bootsplash]"
-@@ -1089,7 +1089,7 @@ sym_exists() {
- # find best compressor (or forced one) for initrd
- find_compressor() {
-       local mode="$1"
--      local compressors='xz lzma bzip2 gzip lzo'
-+      local compressors='zstd xz lzma bzip2 gzip lzo'
+       done
  
-       # a specified one, take it
-       if ! is_yes "$mode"; then
-@@ -1121,6 +1121,10 @@ find_compressor() {
-                       sym=unlzo
-                       prog=/usr/bin/lzop
-                       ;;
-+              zstd)
-+                      sym=zstd
-+                      prog=/usr/bin/zstd
-+                      ;;
-               none|no)
-                       # any existing sym will work
-                       sym=initrd_load
-@@ -1163,6 +1167,9 @@ compress_image() {
-       lzo)
-               lzop -9 < "$IMAGE" > "$tmp" || return $?
-               ;;
-+      zstd)
-+              zstd -9 < "$IMAGE" > "$tmp" || return $?
-+              ;;
-       none|no)
-               cat < "$IMAGE" > "$tmp" || return $?
-               ;;
 
-commit b5a01dda8ca06f88b1210f806f3ac6da7c0019f0
+commit 3d81f1cd0bc557ad9a1f157b403f0396866c648c
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Fri May 4 15:50:18 2018 +0200
+Date:   Tue Dec 18 14:38:55 2018 +0100
 
-    ext4 can use crc32 but has it in softdep only
+    udevd uses ata_id and scsi_id, so install these.
 
-diff --git a/geninitrd b/geninitrd
-index 0a18298..c75c22b 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -435,6 +435,9 @@ find_depmod() {
-                                       warn "mounting multidevice btrfs volume requires rootfsflags=device=/dev/...,device=/dev/... kernel option"
-                                       find_depmod "-libcrc32c"
-                                       ;;
-+                              ext4)
-+                                      find_depmod "-libcrc32c"
-+                                      ;;
-                               crc-t10dif)
-                                       find_depmod "-crct10dif-pclmul"
-                                       find_depmod "-crct10dif"
-
-commit 256e0bedb591a982ce87fb2ca1b38e1353d5b33a
+diff --git a/mod-udev.sh b/mod-udev.sh
+index 422ef3e..a2491ee 100644
+--- a/mod-udev.sh
++++ b/mod-udev.sh
+@@ -41,9 +41,11 @@ setup_mod_udev() {
+ initrd_gen_udev() {
+       verbose "Setting up udev..."
+-      inst_d /sbin /etc/udev
++      inst_d /sbin /etc/udev /lib/udev
+       inst_exec $udevd /sbin/udevd
+       inst_exec $udevadm /sbin/udevadm
++      inst_exec /lib/udev/ata_id  /lib/udev/ata_id
++      inst_exec /lib/udev/scsi_id /lib/udev/scsi_id
+       inst /etc/udev/udev.conf /etc/udev/udev.conf
+       # standard udev rules
+       inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
+
+commit dc5ca733ed6fe57dfa39d4598a6586069e41d0b0
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Fri Aug 10 10:40:59 2018 +0200
+Date:   Tue Dec 18 14:34:38 2018 +0100
 
-    ramdisk_size warning makes no sense for initramfs.
+    Install mdadm in /sbin because udevd expects it to be there.
 
-diff --git a/geninitrd b/geninitrd
-index c75c22b..025674d 100755
---- a/geninitrd
-+++ b/geninitrd
-@@ -1759,14 +1759,16 @@ case "$INITRDFS" in
-       die "Filesystem $INITRDFS not supported by $PROGRAM"
- esac
--CONFIG_BLK_DEV_RAM_SIZE=$(ikconfig | awk -F= '/^CONFIG_BLK_DEV_RAM_SIZE/{print $2}')
--if [ -z "$CONFIG_BLK_DEV_RAM_SIZE" ]; then
--      CONFIG_BLK_DEV_RAM_SIZE=4096
--      warn "No CONFIG_BLK_DEV_RAM_SIZE detected, fallback to $CONFIG_BLK_DEV_RAM_SIZE"
--fi
-+if [ "$INITRDFS" != "initramfs" ]; then
-+      CONFIG_BLK_DEV_RAM_SIZE=$(ikconfig | awk -F= '/^CONFIG_BLK_DEV_RAM_SIZE/{print $2}')
-+      if [ -z "$CONFIG_BLK_DEV_RAM_SIZE" ]; then
-+              CONFIG_BLK_DEV_RAM_SIZE=4096
-+              warn "No CONFIG_BLK_DEV_RAM_SIZE detected, fallback to $CONFIG_BLK_DEV_RAM_SIZE"
-+      fi
+diff --git a/mod-md.sh b/mod-md.sh
+index 2b6f587..a358517 100644
+--- a/mod-md.sh
++++ b/mod-md.sh
+@@ -133,7 +133,7 @@ initrd_gen_md() {
+       fi
+       verbose "Setting up mdadm..."
  
--if [ "$IMAGESIZE" -gt $CONFIG_BLK_DEV_RAM_SIZE ]; then
--      warn "Your image size is larger than $CONFIG_BLK_DEV_RAM_SIZE, Be sure to boot kernel with ramdisk_size=$IMAGESIZE!"
-+      if [ "$IMAGESIZE" -gt $CONFIG_BLK_DEV_RAM_SIZE ]; then
-+              warn "Your image size is larger than $CONFIG_BLK_DEV_RAM_SIZE, Be sure to boot kernel with ramdisk_size=$IMAGESIZE!"
-+      fi
- fi
+-      inst_exec $mdadm /bin/mdadm
++      inst_exec $mdadm /sbin/mdadm
  
- if ! is_no "$COMPRESS"; then
-
-commit 7d4fa91c4a63900ed829b088d2513a60ac764ddd
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Mon Aug 13 22:49:31 2018 +0200
-
-    Drop forced luks type as latest tools support luks2, too. Leave it for cryptsetup autodetection.
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index 8e9bc46..99ff4a6 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -157,7 +157,7 @@ luks_crypttab() {
-                       done
-                       IFS="$old_IFS"
+       echo "DEVICE partitions containers" >> "$DESTDIR/etc/mdadm.conf"
  
--                      verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open --type luks $crypttab_opt '$src' '$dst'"
-+                      verbose "+ cryptsetup --timeout=120 ${keyfile:+-d $keyfile} open $crypttab_opt '$src' '$dst'"
-                       add_linuxrc <<-EOF
-                       debugshell
+@@ -181,7 +181,7 @@ initrd_gen_md() {
  
-@@ -184,7 +184,7 @@ luks_crypttab() {
-                               crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
-                               if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
-                                       # is inactive
--                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open --type luks $crypttab_opt "\$luksdev" '$dst' <&1
-+                                      cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
-                               fi
-                       fi
+       echo "wait_for_files $cr_dev_list" | add_linuxrc
+       add_linuxrc <<-'EOF'
+-      mdadm --assemble --scan
++      /sbin/mdadm --assemble --scan
  
+       if [ "$DEBUGINITRD" ]; then
+               [ -e /proc/mdstat ] && echo "/proc/mdstat contents:" && cat /proc/mdstat
 
-commit 042e65b6bf2018ce17fcc275b0f4da26ef2de2ff
+commit 33cc4751b8f80fc3b800928b9ad93866b2569915
 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Aug 14 13:09:55 2018 +0200
+Date:   Tue Dec 18 14:33:12 2018 +0100
 
-    libpthread dlopens libgcc_s.so.1, so install it.
+    Install blkid in /sbin because udevd expects it to be there.
 
 diff --git a/geninitrd b/geninitrd
-index 025674d..50be081 100755
+index a79b9c3..118333c 100755
 --- a/geninitrd
 +++ b/geninitrd
-@@ -538,15 +538,20 @@ inst_exec() {
+@@ -1530,7 +1530,7 @@ chmod a+rx "$RCFILE"
+ ln -s linuxrc $DESTDIR/init
  
-       inst "$@" $dest
+ # create dirs that we really need
+-inst_d /{lib,bin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
++inst_d /{lib,bin,sbin,etc,dev{,/pts,/shm},loopfs,var,proc,run,sys,tmp}
  
--      local obj lib libs libdir
-+      local obj lib libs libs_additional libdir
-       for obj in "$@"; do
-               case "$obj" in
-                       /lib/ld-linux.so.2 | /lib64/ld-linux-x86-64.so.2 | /libx32/ld-linux-x32.so.2)
-                       continue
-+                      ;;
-+                  /lib/libpthread.so* | /lib64/libpthread.so* | /libx32/libpthread.so*)
-+                              libs_additional="${obj%/libpthread*}/libgcc_s.so.1"
-+                      ;;
-               esac
+ modules_install "$MODULES"
  
-+
-               libs=$(ldd "$obj" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u)
--              for lib in $libs; do
-+              for lib in $libs $libs_additional; do
-                       libdir=$(cd $(dirname "$lib"); pwd)
-                       if [ ! -f "$DESTDIR/$lib" ]; then
-                               inst_d $libdir
-
-commit 99634b923a68cb279eae5fd72286dcb9e52f8f25
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Aug 14 13:32:41 2018 +0200
-
-    cryptsetup needs /var/run/cryptsetup dir.
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index 99ff4a6..4a93aa7 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -89,6 +89,7 @@ initrd_gen_luks() {
-       inst_d /bin
-       inst_exec $cryptsetup /bin/cryptsetup
-+      inst_d /var/run/cryptsetup
-       mount_dev
-       mount_sys
-
-commit 32b9509df0d88c0814a0dfef2465a46ade008b28
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Aug 14 13:57:58 2018 +0200
-
-    Include more modules for luks. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809686#10
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index 4a93aa7..9fbf583 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -67,6 +67,10 @@ find_modules_luks() {
-       # TODO: autodetect
-       find_module "aes"
-       find_module "cbc"
-+      find_module "-af-alg"
-+      find_module "-algif_hash"
-+      find_module "-algif_skcipher"
-+      find_module "-loop"
-       # recurse
-       dev=$(awk -vLUKSNAME="$LUKSNAME" '$1 == LUKSNAME { print $2 }' /etc/crypttab)
-
-commit 4fa03792dc42a77bfa98449828c87b3d23fd0a17
-Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
-Date:   Tue Aug 14 14:08:52 2018 +0200
-
-    Fix condition for --debug mode which adds additional text after 'inactive' text.
-
-diff --git a/mod-luks.sh b/mod-luks.sh
-index 9fbf583..ff877f7 100644
---- a/mod-luks.sh
-+++ b/mod-luks.sh
-@@ -187,7 +187,7 @@ luks_crypttab() {
+diff --git a/mod-blkid.sh b/mod-blkid.sh
+index 8ee2a48..92df9ae 100644
+--- a/mod-blkid.sh
++++ b/mod-blkid.sh
+@@ -22,12 +22,12 @@ initrd_gen_blkid() {
+       fi
+       verbose "Adding BLKID support to initrd"
  
-                       if [ -e "\$luksdev" ]; then
-                               crypt_status=\$(cryptsetup \$cryptsetup_opt status '$dst')
--                              if [ "\${crypt_status%%is inactive.}" != "\$crypt_status" ]; then
-+                              if [ "\${crypt_status%%is inactive*}" != "\$crypt_status" ]; then
-                                       # is inactive
-                                       cryptsetup \$cryptsetup_opt ${keyfile:+-d $keyfile} --timeout 120 open $crypttab_opt "\$luksdev" '$dst' <&1
-                               fi
+-      inst_exec $blkid /bin/blkid
++      inst_exec $blkid /sbin/blkid
+       initrd_gen_devices
+       add_linuxrc <<-'EOF'
+               # if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
+               if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
+-                      blkid="$(/bin/blkid -t $ROOT -o device -l)"
++                      blkid="$(/sbin/blkid -t $ROOT -o device -l)"
+                       if [ -n "$blkid" ]; then
+                               ROOT=$blkid
+                       fi
This page took 0.833028 seconds and 4 git commands to generate.