]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only check if given initrds exist if we're building a bootable image
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 May 2023 09:55:48 +0000 (11:55 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 7 May 2023 17:17:18 +0000 (19:17 +0200)
This allows disabling the initrd build without failing the final
image build that uses it.

mkosi/__init__.py

index 74b643f1d58195eaa2363882d7e53b3e0266f9c9..84eec5a0a4619422e355475d777b1cf71db4902f 100644 (file)
@@ -1132,11 +1132,12 @@ def check_inputs(config: MkosiConfig) -> None:
                      config.finalize_script):
             check_script_input(path)
 
-        for p in config.initrds:
-            if not p.exists():
-                die(f"Initrd {p} not found")
-            if not p.is_file():
-                die(f"Initrd {p} is not a file")
+        if config.bootable != ConfigFeature.disabled:
+            for p in config.initrds:
+                if not p.exists():
+                    die(f"Initrd {p} not found")
+                if not p.is_file():
+                    die(f"Initrd {p} is not a file")
 
     except OSError as e:
         die(f'{e.filename}: {e.strerror}')