]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Arch: Add bootctl update pacman hook 490/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 7 Aug 2020 18:55:15 +0000 (19:55 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 8 Aug 2020 11:01:49 +0000 (12:01 +0100)
mkosi

diff --git a/mkosi b/mkosi
index 7470d00bb7d4a996e388eb12b23d50f4706303aa..eb5732c6cdd26349481fe7283ac65ebc60a6b63f 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -2379,6 +2379,25 @@ def install_arch(args: CommandLineArguments, root: str, do_run_build_script: boo
 
         make_executable(kernel_remove_script)
 
+        if args.esp_partno is not None:
+            bootctl_update_hook = os.path.join(hooks_dir, "91-mkosi-bootctl-update-hook")
+            with open(bootctl_update_hook, 'w') as f:
+                f.write(
+                    dedent(
+                        """\
+                        [Trigger]
+                        Operation = Upgrade
+                        Type = Package
+                        Target = systemd
+
+                        [Action]
+                        Description = Updating systemd-boot...
+                        When = PostTransaction
+                        Exec = /usr/bin/bootctl update
+                        """
+                    )
+                )
+
     keyring = "archlinux"
     if platform.machine() == "aarch64":
         keyring += "arm"