PortValhalla/scripts/Arch/Config/SecureBoot/install.sh

25 lines
588 B
Bash
Raw Normal View History

2023-05-06 23:22:17 +00:00
#!/bin/bash
EFI_BOOT_DIR="${EFI_BOOT_DIR:-"/boot"}";
BOOTLOADER_ID=${BOOTLOADER_ID:-"Arch"};
bootNums="$(efibootmgr | sed "/$BOOTLOADER_ID/{ s/^.*Boot\([[:digit:]]\+\)\*.*$/\1/; p; }; d")";
2023-05-06 23:22:17 +00:00
yay --noconfirm -Syu secureboot-grub;
for bootNum in $bootNums;
do
sudo efibootmgr --delete-bootnum --bootnum "$bootNum"
done;
2023-05-06 23:22:17 +00:00
sudo sed -i \
-e "/esp=/{" \
-e "a esp=\"$EFI_BOOT_DIR\"" \
-e "d" \
-e "}" \
-e "/bootloader_id=/{" \
-e "a bootloader_id=\"$BOOTLOADER_ID\"" \
-e "d" \
-e "}" \
2023-05-06 23:22:17 +00:00
/etc/secureboot.conf;
sudo secure-grub-install;