36 lines
961 B
Fish
36 lines
961 B
Fish
|
#!/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
|