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. Signed-off-by: Ankit Kumar <ankit@xxxxxxxxxxxxxxxxxx> --- dracut.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dracut.sh b/dracut.sh index 70dc79d..81e1562 100755 --- a/dracut.sh +++ b/dracut.sh @@ -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 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html