Skip to contentSkip to conversation

remove the incomplete .img file

PATCH In review Chao Fan 3 participants 3 messages Jul 21, 2015 – Sep 2, 2015 1 message not in the archive

lore
Share & tools
lore

Chao Fan

author
#0 lore raw

PATCH 1/1 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.

---
 dracut.sh | 1 +
 1 file changed, 1 insertion(+)
dracut.sh +1 -0
index ee0a039..122ae0c 100755
@@ -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 ***"
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1437470322-992-1-git-send-email-cfan-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#3 lore raw
In reply to a message not in the archive
Quoted 20 lines · Chao Fan

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.

---
 dracut.sh | 1 +
 1 file changed, 1 insertion(+)
dracut.sh +0 -0
index ee0a039..122ae0c 100755

dracut.sh if ! ( · line 1657

Quoted 7 lines
dracut.sh +1 -0
@@ -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 ***"

Thanks! Merged, despite the <tab>.