]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
remove the incomplete .img file 91/head
authorChao Fan <cfan@redhat.com>
Tue, 21 Jul 2015 09:18:42 +0000 (17:18 +0800)
committerHarald Hoyer <harald@redhat.com>
Tue, 21 Jul 2015 10:05:42 +0000 (12:05 +0200)
If the directory where the .img file is saved has no enough space, or in
other wrong conditions, dracut will get an incomplete file xxx.img. But
sometimes this .img file will be loaded when rebooting the system. And then
some bugs will happen because this .img file is wrong.

So I think dracut should remove the incomplete file because this .img file
with problems was made by dracut. And then the wrong file will not be loaded
anymore.

Signed-off-by: Chao Fan <cfan@redhat.com>
dracut.sh

index ee0a039d3061293feb11061562e6ebc36fce3f8e..122ae0c37ca1dd208d075bd22018124c5f8207ba 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1651,6 +1651,7 @@ if ! (
             | $compress >> "$outfile"
     ); then
     dfatal "dracut: creation of $outfile failed"
+       rm -f $outfile
     exit 1
 fi
 dinfo "*** Creating initrd image file '$outfile' done ***"