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

Jan Rękorajski baggins at pld-linux.org
Sun Oct 31 09:21:53 CET 2021


On Sun, 31 Oct 2021, Jan Palus wrote:

> On 30.10.2021 23:23, baggins wrote:
> > commit 63a4b90ecfdd4ac023ab8542fd6af60f4c80516e
> > Author: Jan Rękorajski <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.

> 
> (At some point I was going to add `add_dracutmodules+=" dash "` but must
> have forgotten).

Dracut already requires and installs bash into the initramfs for its own
needs. I'd rather stick to my "fix" to make absolutely sure it's there
and as /bin/sh to avoid new surprises.

Besides /etc/dracut.conf.d/01-dist.conf is marked in package as
config(noreplace) and you may end up with .rpmnew and effectively a
noop.

-- 
Jan Rękorajski                    | PLD/Linux
SysAdm | baggins<at>pld-linux.org | http://www.pld-linux.org/


More information about the pld-devel-en mailing list