]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - dracut-init.sh
Fix 98dracut-systemd/dracut-emergency.sh
[thirdparty/dracut.git] / dracut-init.sh
index e8a705ec76421e6a562ac28117a27cb5e2eb4ec1..50d23e2d110dd1f220eb134e7a5cb5adf3211277 100644 (file)
@@ -261,6 +261,24 @@ inst_script() {
     (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-f} "$@" || :
 }
 
+inst_fsck_help() {
+    local _helper="/run/dracut/fsck/fsck_help_$1.txt"
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
+}
+
+# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
+# If hosotnly mode is set to "strict", hostonly restrictions will still
+# be applied, else will ignore hostonly mode and try to install all
+# given modules.
+optional_hostonly() {
+    if [[ $hostonly_mode = "strict" ]]; then
+        printf -- "$hostonly"
+    else
+        printf ""
+    fi
+}
+
 mark_hostonly() {
     for i in "$@"; do
         echo "$i" >> "$initdir/lib/dracut/hostonly-files"
@@ -936,7 +954,7 @@ for_each_kmod_dep() {
 
 dracut_kernel_post() {
     for _f in modules.builtin.bin modules.builtin modules.order; do
-        [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+        [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
     done
 
     # generate module dependencies for the initrd
@@ -975,6 +993,10 @@ instmods() {
         set -- "${args[@]}"
     fi
 
+    if (($# == 0)); then
+        return 0
+    fi
+
     $DRACUT_INSTALL \
         ${initdir:+-D "$initdir"} \
         ${loginstall:+-L "$loginstall"} \