From: reuben olinsky Date: Thu, 3 Nov 2022 15:55:04 +0000 (-0700) Subject: Flush files after copying X-Git-Tag: v15~395 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1bdb61ed0ede67d6bd3d56e9ba5750db8e76a14;p=thirdparty%2Fmkosi.git Flush files after copying This resolves an issue where qemu sees an incomplete image when --ephemeral is used. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 218099b8e..9ead74089 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -616,6 +616,7 @@ def copy_file_object(oldobject: BinaryIO, newobject: BinaryIO) -> None: if e.errno not in {errno.EXDEV, errno.EOPNOTSUPP, errno.ENOTTY}: raise shutil.copyfileobj(oldobject, newobject) + newobject.flush() def copy_file(oldpath: PathString, newpath: PathString) -> None: