]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Don't require extra trees and initrds to exist if Format=none
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 10 Jul 2024 06:39:47 +0000 (08:39 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 10 Jul 2024 08:28:45 +0000 (10:28 +0200)
We don't use these if Format=none so let's not check if they exist.

mkosi/__init__.py

index 2ba97a922e7274f9b1236e7d4980520cf923e619..ec09a9634c82cca5b4bc98ccf94ca9910832a572 100644 (file)
@@ -2803,9 +2803,15 @@ def check_inputs(config: Config) -> None:
     if config.tools_tree and not config.tools_tree.exists():
         die(f"Tools tree {config.tools_tree} not found")
 
-    for name, trees in (("skeleton", config.skeleton_trees),
-                        ("package manager", config.package_manager_trees),
-                        ("extra", config.extra_trees)):
+    trees = [
+        ("skeleton", config.skeleton_trees),
+        ("package manager", config.package_manager_trees),
+    ]
+
+    if config.output_format != OutputFormat.none:
+        trees += [("extra", config.extra_trees)]
+
+    for name, trees in trees:
         for tree in trees:
             if not tree.source.exists():
                 die(f"{name.capitalize()} tree {tree.source} not found")
@@ -2813,7 +2819,7 @@ def check_inputs(config: Config) -> None:
             if tree.source.is_file() and tree.source.suffix == ".raw" and not tree.target and os.getuid() != 0:
                 die(f"Must run as root to use disk images in {name} trees")
 
-    if config.bootable != ConfigFeature.disabled:
+    if config.output_format != OutputFormat.none and config.bootable != ConfigFeature.disabled:
         for p in config.initrds:
             if not p.exists():
                 die(f"Initrd {p} not found")