Fix BIOS crashing

This commit is contained in:
Augusto Gunsch 2021-08-10 10:08:34 -03:00
parent b7021341fa
commit d65bfb3cee
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,12 @@ quiet() {
DUMMY=$($@ 2>&1 > /dev/null) DUMMY=$($@ 2>&1 > /dev/null)
} }
testif() {
set +e
quiet $@
set -e
}
### FORCE ROOT ### ### FORCE ROOT ###
[ $(whoami) != "root" ] && echo "Please run as root" && exit 1 [ $(whoami) != "root" ] && echo "Please run as root" && exit 1
@ -50,7 +56,7 @@ echo -e "$AVAILABLE_PLATFORMS"
### SYSTEM ### ### SYSTEM ###
DISTRO=$(cat /etc/os-release | sed -nE 's/^ID=(.*)/\1/p') DISTRO=$(cat /etc/os-release | sed -nE 's/^ID=(.*)/\1/p')
INIT_SYS=$(basename $(readlink /bin/init)) INIT_SYS=$(basename $(readlink /bin/init))
quiet ls /sys/firmware/efi/efivars testif ls /sys/firmware/efi/efivars
[ $? -eq 0 ] && UEFI=1 || UEFI=0 [ $? -eq 0 ] && UEFI=1 || UEFI=0
readonly DISTRO readonly DISTRO
readonly INIT_SYS readonly INIT_SYS