From c01bf72289fa1a66cc45b25e915e74c72eb67598 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 23 Feb 2025 16:20:53 +0100 Subject: [PATCH] Specify --suppress-sync when running package managers Package managers tend to make sure of sync() and friends to ensure that any files they write are actually written to disk. This is important when a package manager is used to do system package upgrades, but is unnecessary when using package managers to build OS images. So let's make sync() and friends a noop when we invoke package managers Replaces #3544 --- mkosi/installer/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mkosi/installer/__init__.py b/mkosi/installer/__init__.py index bc912dfec..43912cd8c 100644 --- a/mkosi/installer/__init__.py +++ b/mkosi/installer/__init__.py @@ -106,6 +106,7 @@ class PackageManager: *(apivfs_options() if apivfs else []), "--become-root", "--suppress-chown", + "--suppress-sync", # Make sure /etc/machine-id is not overwritten by any package manager post install scripts. "--ro-bind-try", Path(root) / "etc/machine-id", "/buildroot/etc/machine-id", # Nudge gpg to create its sockets in /run by making sure /run/user/0 exists. -- 2.47.2