]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut.sh): handle out of space error for UEFI builds
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 13 Feb 2023 10:11:09 +0000 (11:11 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 13 Feb 2023 18:45:51 +0000 (18:45 +0000)
If `cp` fails, do not continue, print an error and exit, like it's already
being done for non-UEFI builds.

dracut.sh

index 3fbd087df36238f0be7f2f6ebc2103d3d1657c9c..06d3d33793c9417a2a500703f5eb9ccc3b8ef797 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -2505,6 +2505,10 @@ if [[ $uefi == yes ]]; then
         else
             if cp --reflink=auto "${uefi_outdir}/linux.efi" "$outfile"; then
                 dinfo "*** Creating UEFI image file '$outfile' done ***"
+            else
+                rm -f -- "$outfile"
+                dfatal "Creation of $outfile failed"
+                exit 1
             fi
         fi
     else