]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Flush files after copying
authorreuben olinsky <reubeno@users.noreply.github.com>
Thu, 3 Nov 2022 15:55:04 +0000 (08:55 -0700)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 4 Nov 2022 17:06:03 +0000 (18:06 +0100)
This resolves an issue where qemu sees an incomplete image when
--ephemeral is used.

mkosi/__init__.py

index 218099b8e7c462cb114d17d61fc2e8aacabcd577..9ead74089c64f0af4aad0705d38e8a84b756e374 100644 (file)
@@ -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: