[packages/dracut] - bash is *required* for dracut initramfs to work correctly, rel 3

Andrzej Zawadzki zawadaa at gmail.com
Tue Nov 2 13:00:22 CET 2021


   On 01.11.2021 23:15, Jan Rekorajski wrote:

On Sun, 31 Oct 2021, Jan Palus wrote:


On 31.10.2021 09:21, Jan Rekorajski wrote:

On Sun, 31 Oct 2021, Jan Palus wrote:


On 30.10.2021 23:23, baggins wrote:

commit 63a4b90ecfdd4ac023ab8542fd6af60f4c80516e
Author: Jan Rekorajski [1]<baggins at pld-linux.org>
Date:   Sat Oct 30 23:21:06 2021 +0200

    - bash is *required* for dracut initramfs to work correctly, rel 3

At some point dracut started to pretend mksh is supported as /bin/sh
inside initramfs but that's simply not true. Default fallback is
whatever system /bin/sh is linked which in our case is mksh hence broken
initramfs in some cases. Going back to previous default "dash" helped in
my case (lvm) -- are you sure it really needs bash? And perhaps maybe

I know for certain that mksh does not. And very silently at that. Initramfs
just doesn't detect encrypted partitions.


let's leave a possibility to customize shell and instead of hardcoding
bash use:

add_dracutmodules+=" bash "

which effectively changes default shell.

I'm not so sure. What I found in the code is that dracut first installs
/bin/sh and then shell modules (00bash, 00dash, 00mksh) as needed.
But, those modules do not create /bin/sh if it already exists, and since
that symlink is installed first it will not be re-created.

Works for me. The place where dracut installs /bin/sh -> mksh is at first
script with /bin/sh shebang:

[2]https://github.com/dracutdevs/dracut/blob/15398458685d376fef56b1bf6fe09ae7c68
324c1/src/install/dracut-install.c#L531

Hence shell modules (bash/dash/mksh) are ordered with 00 before any such
script could be installed.

Tested dash, works. Generic initramfs detected and booted off encrypted root.

   So, can I safely remove entry:

   hold = dracut*

   from my config?

   Last dracut, that works with LUKS was dracut-054. (always good to have
   PLD Rescue ;-) )

   Thanks for fix!

   --

   Andrzej Zawadzki

References

   1. mailto:baggins at pld-linux.org
   2. https://github.com/dracutdevs/dracut/blob/15398458685d376fef56b1bf6fe09ae7c68324c1/src/install/dracut-install.c#L531


More information about the pld-devel-en mailing list