Skip to contentSkip to conversation

Sync initramfs after creation

PATCH In review Ankit Kumar 2 participants 2 messages Aug 7, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Sync initramfs after creation

If we trigger crash just after creating initramfs, sometimes it is observed that initramfs is not written to disk causing the subsequent boot to fail. A sync should resolve this.

---
 dracut.sh | 6 ++++++
 1 file changed, 6 insertions(+)
dracut.sh +6 -0
index 70dc79d..81e1562 100755
@@ -1806,4 +1806,10 @@ fi
 
 command -v restorecon &>/dev/null && restorecon -- "$outfile"
 
+sync $outfile 2> /dev/null
+if [ $? -ne 0 ] ; then
+    dinfo "dracut: sync operartion on newly created initramfs $outfile failed"
+    exit 1
+fi
+
 exit 0
Signature · 1 line
2.7.4

A message that is not in the archive (sent off-list or not yet received): 1502088233-10139-1-git-send-email-ankit-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org