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 <ankit@linux.vnet.ibm.com>
master
Ankit Kumar 2017-08-07 12:13:53 +05:30 committed by Harald Hoyer
parent 5abd692fe4
commit e316ae0e43
1 changed files with 6 additions and 0 deletions

View File

@ -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