From d65ca8d789134ead8182aca80e302a0c44d34561 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 16 Jan 2014 12:12:41 -0800 Subject: [PATCH] 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 --- src/pylorax/imgutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py index 94dda5af..5a974e88 100644 --- a/src/pylorax/imgutils.py +++ b/src/pylorax/imgutils.py @@ -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,