You are not logged in.

#1 2024-10-23 18:49:37

opotonil
Member
Registered: 2009-09-12
Posts: 39

Pacman hook to copy "systemd-bootx64.efi" to "grubx64.efi"

Since my Dell firmware seems to be incorrectly passing arguments to the bootloader, I have created a pacman hook to copy "systemd-bootx64.efi" to "grubx64.efi".

/etc/pacman.d/hooks/80-secure-boot.hook

[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/lib/fwupd/efi/*.efi
Target = usr/lib/systemd/boot/efi/*.efi

[Action]
Description = Signing EFI binary for Secure Boot
When = PostTransaction
Exec = /etc/pacman.d/scripts/secure-boot
Depends = sbsigntools
NeedsTargets

/etc/pacman.d/scripts/secure-boot

#!/usr/bin/env bash

sbkey="/boot/secure-boot.key"
sbcrt="/boot/secure-boot.crt"

while read -r target; do
	sbsign --key "$sbkey" --cert "$sbcrt" "$target"
	if [[ "$target" == */systemd-bootx64.efi ]]; then
		cp -- "${target}.signed" /boot/EFI/Systemd/grubx64.efi
	fi
done

My question is if this line is correct:

cp -- "${target}.signed" /boot/EFI/Systemd/grubx64.efi

Or the source path of the cp command should start with a "/":

cp -- "/${target}.signed" /boot/EFI/Systemd/grubx64.efi

Offline

Board footer

Powered by FluxBB