From: Chao Fan Date: Tue, 21 Jul 2015 09:18:42 +0000 (+0800) Subject: remove the incomplete .img file X-Git-Tag: 044~98^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F91%2Fhead;p=thirdparty%2Fdracut.git remove the incomplete .img file 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 --- diff --git a/dracut.sh b/dracut.sh index ee0a039d3..122ae0c37 100755 --- 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 ***"