(post-update): UKI + Secure Boot with sbctl on ArchLinux: systemd-boot walkthrough

Pacman hooks Exec are not run in a shell so bash syntax is not supported. Using /bin/sh -c '...' is the way to go.
This commit is contained in:
Eduard Tolosa 2025-03-06 18:32:37 +00:00
parent c643bcf0e9
commit 30c14f482e

View file

@ -171,7 +171,7 @@ Target = systemd
[Action]
Description = Gracefully upgrading systemd-boot...
When = PostTransaction
Exec = /usr/bin/sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi && /usr/bin/systemctl restart systemd-boot-update.service
Exec = /bin/sh -c '/usr/bin/sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi && /usr/bin/systemctl restart systemd-boot-update.service'
```
This hook will sign the boot loader whenever systemd is installed or upgraded. You can trigger it manually by reinstalling systemd: