]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Don't check for populated OS root if Format == none
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 19 Jan 2025 19:11:20 +0000 (20:11 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Sun, 19 Jan 2025 20:13:56 +0000 (21:13 +0100)
Let's skip checking if the OS root is populated if Format == none
so that Format=none and Distribution=custom can be used to execute
arbitrary code in a build script without actually building an image.

mkosi/__init__.py

index 3a7c03999d07f62576c5ea88d58093ed71623e93..18fd920539a104cf410da98bab52f3fe8dae83c1 100644 (file)
@@ -283,7 +283,10 @@ def remove_packages(context: Context) -> None:
 
 
 def check_root_populated(context: Context) -> None:
-    if context.config.output_format.is_extension_image():
+    if (
+        context.config.output_format == OutputFormat.none
+        or context.config.output_format.is_extension_image()
+    ):
         return
 
     """Check that the root was populated by looking for a os-release file."""