From fdb82b8e1335d6dbe49658d26aec0ae1605edcf9 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 2 Jul 2022 13:31:50 -0600 Subject: [PATCH] installer.py: Use Copy on Write for tmp Credit to @flagersgit for suggestion --- resources/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/installer.py b/resources/installer.py index 70d988586..6ef8a2c79 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -354,8 +354,8 @@ def generate_installer_creation_script(tmp_location, installer_path, disk): if (Path(file) / Path("Contents/Resources/createinstallmedia")).exists(): subprocess.run(["rm", "-rf", file]) - # Copy installer to tmp - subprocess.run(["cp", "-R", installer_path, tmp_location]) + # Copy installer to tmp (use CoW to avoid extra disk writes) + subprocess.run(["cp", "-cR", installer_path, tmp_location]) # Adjust installer_path to point to the copied installer installer_path = Path(tmp_location) / Path(Path(installer_path).name)