Fix BIOS crashing
This commit is contained in:
parent
b7021341fa
commit
d65bfb3cee
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue