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 <cfan@redhat.com>
master
Chao Fan 2015-07-21 17:18:42 +08:00 committed by Harald Hoyer
parent f4d64d55ea
commit 7eeaa4ab14
1 changed files with 1 additions and 0 deletions

View File

@ -1651,6 +1651,7 @@ if ! (
| $compress >> "$outfile" | $compress >> "$outfile"
); then ); then
dfatal "dracut: creation of $outfile failed" dfatal "dracut: creation of $outfile failed"
rm -f $outfile
exit 1 exit 1
fi fi
dinfo "*** Creating initrd image file '$outfile' done ***" dinfo "*** Creating initrd image file '$outfile' done ***"