feat: make efibootmgr and sbsign optional dependencies

This commit is contained in:
Adrian Wannenmacher 2021-06-19 15:17:59 +02:00
parent c4dc5fdc0a
commit 16c3dc6b66
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5
1 changed files with 13 additions and 3 deletions

View File

@ -7,10 +7,8 @@ end
function check_deps -d "checks if all dependencies are available" function check_deps -d "checks if all dependencies are available"
set -l dependencies \ set -l dependencies \
"efibootmgr" \
"jq" \ "jq" \
"rg" \ "rg" \
"sbsign" \
"sed" \ "sed" \
"snapper" \ "snapper" \
@ -21,6 +19,18 @@ function check_deps -d "checks if all dependencies are available"
error "missing depenency: $dep" error "missing depenency: $dep"
end end
end end
which "efibootmgr" >/dev/null 2>/dev/null
if test $status != "0" -a $CFG_EFI = "yes"
set -g CFG_EFI "no"
echo "CFG_EFI overwriten to \"no\": 'efibootmgr' not available"
end
which "sbsign" >/dev/null 2>/dev/null
if test $status != "0" -a $CFG_EFI = "yes"
set -g CFG_SECUREBOOT "no"
echo "CFG_SECUREBOOT overwriten to \"no\": 'sbsign' not available"
end
end end
function find_tasks -d "finds out what the program needs to do" function find_tasks -d "finds out what the program needs to do"
@ -122,9 +132,9 @@ end
function main function main
# prepare for execution # prepare for execution
check_deps
source "/etc/snap-pac-uki/config.fish" source "/etc/snap-pac-uki/config.fish"
config config
check_deps
switch $argv[1] switch $argv[1]
case "snapshots" case "snapshots"