]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Add genkey target
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 May 2024 09:24:43 +0000 (11:24 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 May 2024 10:02:31 +0000 (12:02 +0200)
Let's automatically generate keys instead of requiring developers to
do it manually.

meson.build

index e071d58e11f6356c7abe61d0e3ef0698f1e4e678..738fb0b17f5f99d98731af935ee45382cf13c5dc 100644 (file)
@@ -2620,6 +2620,12 @@ foreach executable : ['systemd-journal-remote', 'systemd-measure']
 endforeach
 
 if mkosi.found()
+        genkey = custom_target('genkey',
+                output : ['mkosi.key', 'mkosi.crt'],
+                command : [mkosi, 'genkey'],
+                depends : mkosi_depends,
+        )
+
         custom_target('mkosi',
                 build_always_stale : true,
                 build_by_default: false,
@@ -2631,10 +2637,14 @@ if mkosi.found()
                         '--output-dir', meson.current_build_dir() / 'mkosi.output',
                         '--cache-dir', meson.current_build_dir() / 'mkosi.cache',
                         '--build-dir', meson.current_build_dir() / 'mkosi.builddir',
+                        '--secure-boot-key', meson.current_build_dir() / 'mkosi.key',
+                        '--secure-boot-certificate', meson.current_build_dir() / 'mkosi.crt',
+                        '--verity-key', meson.current_build_dir() / 'mkosi.key',
+                        '--verity-certificate', meson.current_build_dir() / 'mkosi.crt',
                         '--force',
                         'build',
                 ],
-                depends : mkosi_depends,
+                depends : mkosi_depends + [genkey],
         )
 endif