From 1f8aa84c5f44a2eb5132397477e8d22197ffad75 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 1fa9ab21..1a6c7884 100644 --- a/src/pylorax/imgutils.py +++ b/src/pylorax/imgutils.py @@ -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,