]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(base): fallback when shell-interpreter is not included
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 22 Nov 2024 19:50:18 +0000 (14:50 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 23 Nov 2024 00:17:51 +0000 (19:17 -0500)
Follow-up to e139edb

When dracut is invoked with -m and shell-interpreter is not listed,
than shell interpreter is not included.

The base module is the only module that is absolutely mandatory
(and its dependencies).

shell-intrepreter dracut module is optional - the same way e.g.
dash module is optional.

modules.d/99base/module-setup.sh

index 19d209de75ce566f9c488e6c9b761fabe6fe114a..5627edf6b3f435bba2dc03560ec4b4ad7a887dc8 100755 (executable)
@@ -19,6 +19,9 @@ install() {
     ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
     ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
 
+    # fallback when shell-interpreter is not included
+    [ ! -e "${initdir}/bin/sh" ] && inst_simple "${initdir}/bin/sh" "/bin/sh"
+
     # add common users in /etc/passwd, it will be used by nfs/ssh currently
     # use password for hostonly images to facilitate secure sulogin in emergency console
     [[ $hostonly ]] && pwshadow='x'