From: Daan De Meyer Date: Sun, 23 Feb 2025 15:20:53 +0000 (+0100) Subject: Specify --suppress-sync when running package managers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3545%2Fhead;p=thirdparty%2Fmkosi.git 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 --- 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.