]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
repart: use --append-fstab=auto if available
authorAlberto Planas <aplanas@suse.com>
Thu, 24 Apr 2025 13:57:56 +0000 (15:57 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 22 May 2025 11:23:03 +0000 (13:23 +0200)
When generating images there is a chance that a pre-existent /etc/fstab
is present in the mkosi buildroot.  systemd-repart can merge the already
existing fstab with the one generated, separating the sections in a way
that the systemd-repart can be reused several times.

Signed-off-by: Alberto Planas <aplanas@suse.com>
mkosi/__init__.py

index 17de7060300766e331092c90ad84a1c3e4caf61b..5f97fa64214388f064545eb7d7bfeb64a5c800d7 100644 (file)
@@ -3401,6 +3401,8 @@ def make_image(
             "--generate-fstab=/etc/fstab",
             "--generate-crypttab=/etc/crypttab",
         ]
+    if tabs and systemd_tool_version("systemd-repart", sandbox=context.sandbox) >= 258:
+        cmdline += ["--append-fstab=auto"]
 
     for d in definitions:
         cmdline += ["--definitions", workdir(d)]