From: Ankit Kumar Date: Mon, 7 Aug 2017 06:43:53 +0000 (+0530) Subject: Sync initramfs after creation X-Git-Tag: 047~90^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F293%2Fhead;p=thirdparty%2Fdracut.git 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. Signed-off-by: Ankit Kumar --- diff --git a/dracut.sh b/dracut.sh index 70dc79d04..81e1562dd 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