Skip to content

Instantly share code, notes, and snippets.

@Tosainu
Last active December 15, 2018 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tosainu/bdd9d77e2c7494528b3c7e735658bb08 to your computer and use it in GitHub Desktop.
Save Tosainu/bdd9d77e2c7494528b3c7e735658bb08 to your computer and use it in GitHub Desktop.
[Trigger]
Type = Package
Operation = Upgrade
Target = systemd
[Action]
Description = Updating systemd-boot
When = PostTransaction
Exec = /usr/bin/sh -c '/usr/bin/bootctl update && for f in $(/usr/bin/bootctl -p)/EFI/{BOOT/BOOTX64.EFI,systemd/systemd-bootx64.efi}; do /usr/bin/sbsign --key /root/secure-boot/db.key --cert /root/secure-boot/db.crt --output "$f" "$f"; done'
[Trigger]
Operation = Install
Operation = Upgrade
Type = File
Target = boot/vmlinuz-*
[Action]
Description = Signing Kernel for SecureBoot
When = PostTransaction
Exec = /usr/bin/sh -c 'while read -r f; do if ! /usr/bin/sbverify --list "$f" 2>/dev/null | /usr/bin/grep -q "signature certificates"; then /usr/bin/sbsign --key /root/secure-boot/db.key --cert /root/secure-boot/db.crt --output "$f" "$f"; fi done'
Depends = sbsigntools
Depends = grep
NeedsTargets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment