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 1562dbe6ef
commit d65ca8d789
1 changed files with 3 additions and 0 deletions

View File

@ -318,6 +318,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,