PortValhalla/scripts/Arch/Config/SecureBoot/main.fish

36 lines
961 B
Fish
Raw Normal View History

2024-09-19 22:56:56 +00:00
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function installSW -V dir
yayinst secureboot-grub
end
function configureSW -V dir
source "$dir/../../../Common/Scripts/config.fish"
set -l label (getConfig valhalla.boot.label)
set -l efiDir (getConfig valhalla.boot.efiMountPoint)
set -l bootNums (efibootmgr | sed "/$label/{ s/^.*Boot\([[:digit:]]\+\)\*.*\$/\1/; p; }; d")
for bootNum in $bootNums
sudo efibootmgr --delete-bootnum --bootnum $bootNum
end
sudo sed -i \
-e "/esp=/{" \
-e "a esp=\"$efiDir\"" \
-e "d" \
-e "}" \
-e "/bootloader_id=/{" \
-e "a bootloader_id=\"$label\"" \
-e "d" \
-e "}" \
/etc/secureboot.conf
sudo secure-grub-install
end
runInstaller $argv
end