flush data to disk after mkfsimage (#1052175)

Make sure the data is written before we do anything else with the disk
image. This shouldn't be needed, umount should take care of it, but it
also can't hurt.

Resolves: rhbz#1052175
This commit is contained in:
Brian C. Lane 2014-01-16 12:12:41 -08:00
parent 0ae9e79a72
commit 1f8aa84c5f

View File

@ -326,6 +326,9 @@ def mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=[], mountargs="", gr
copytree(rootdir, mnt, preserve)
do_grafts(graft, mnt, preserve)
# Make absolutely sure that the data has been written
runcmd(["sync"])
# convenience functions with useful defaults
def mkdosimg(rootdir, outfile, size=None, label="", mountargs="shortname=winnt,umask=0077", graft={}):
mkfsimage("msdos", rootdir, outfile, size, mountargs=mountargs,