]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
debian/ubuntu: Handle scenario where systemd-boot is a split package 1017/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Jun 2022 12:28:31 +0000 (14:28 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Jun 2022 12:32:50 +0000 (14:32 +0200)
Recent version of systemd in Debian/Ubuntu made systemd-boot a split
package. Let's make sure we handle this case correctly.

mkosi/__init__.py

index ff957161f281cd413701564fc082b898f0123cea..69b5ae4e11df840bfe52058ba94aa2a9551be56e 100644 (file)
@@ -2932,6 +2932,12 @@ def install_debian_or_ubuntu(args: MkosiArgs, root: Path, *, do_run_build_script
     install_skeleton_trees(args, root, False, late=True)
 
     invoke_apt(args, do_run_build_script, root, "update", [])
+
+    if args.bootable and not do_run_build_script and args.get_partition(PartitionIdentifier.esp):
+        if run_workspace_command(args, root, ["apt-cache", "search", "--names-only", "^systemd-boot$"],
+                                 capture_stdout=True).stdout.strip() != "":
+            add_packages(args, extra_packages, "systemd-boot")
+
     invoke_apt(args, do_run_build_script, root, "install", ["--no-install-recommends", *extra_packages])
 
     policyrcd.unlink()