]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(dracut.sh): output error message for --regenerate-all
authorPavel Valena <pvalena@redhat.com>
Thu, 29 May 2025 12:47:18 +0000 (14:47 +0200)
committerBenjamin Drung <bdrung@ubuntu.com>
Mon, 11 Aug 2025 08:41:59 +0000 (10:41 +0200)
Without it, users might be confused on which initrd is failing.

dracut.sh

index 66608508a854bc955980c544a8fce0b016fadfd4..11da5c250fb314127d5f977cdc201c6d78e32def 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1061,7 +1061,11 @@ if [[ $regenerate_all == "yes" ]]; then
         for i in *; do
             [[ -f $i/modules.dep ]] || [[ -f $i/modules.dep.bin ]] || continue
             "$dracut_cmd" --kver="$i" "${dracut_args[@]}"
-            ((ret += $?))
+            _rc=$?
+            if [[ $_rc -gt 0 ]]; then
+                printf "%s\n" "dracut[F]: image generation failed for kernel '$i'." >&2
+                ((ret += _rc))
+            fi
         done
     else
         for i in *; do
@@ -1077,6 +1081,10 @@ if [[ $regenerate_all == "yes" ]]; then
                 ((ret += wst))
             fi
         done
+
+        if [[ $ret -gt 0 ]]; then
+            printf "%s\n" "dracut[F]: image generation failed." >&2
+        fi
     fi
     exit "$ret"
 fi