]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make sure not all subimages depend on default-initrd subimage main
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Sun, 5 Oct 2025 12:57:13 +0000 (14:57 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Sun, 5 Oct 2025 18:03:20 +0000 (20:03 +0200)
Subimages should only depend on the default initrd if they need one.

mkosi/config.py

index 5ec6bac1028aab8c676d0f19cc8002aa99a3fa79..cf465716aa2f8dc87e24ffbd163472ef67863e76 100644 (file)
@@ -5425,10 +5425,14 @@ def parse_config(
             )
 
         subimages = [
-            dataclasses.replace(
-                image,
-                initrds=[*image.initrds, initrd.output_dir_or_cwd() / initrd.output],
-                dependencies=image.dependencies + [initrd.image],
+            (
+                dataclasses.replace(
+                    image,
+                    initrds=[*image.initrds, initrd.output_dir_or_cwd() / initrd.output],
+                    dependencies=image.dependencies + [initrd.image],
+                )
+                if want_default_initrd(image)
+                else image
             )
             for image in subimages
         ]