Fix incorrect reboot flag when toggling GL driver on Pi 4

This commit is contained in:
Simon Long 2020-07-06 08:18:41 +01:00
parent 147daa3e5b
commit bc5a153c02

View File

@ -1580,16 +1580,28 @@ do_gldriver() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
case "$GLOPT" in case "$GLOPT" in
G1*) G1*)
if grep -q -E "^dtoverlay=vc4-f?kms-v3d" $CONFIG; then if is_pifour ; then
ASK_TO_REBOOT=1 if grep -q -E "^dtoverlay=vc4-f?kms-v3d" $CONFIG; then
ASK_TO_REBOOT=1
fi
else
if sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q -E "^dtoverlay=vc4-f?kms-v3d" ; then
ASK_TO_REBOOT=1
fi
fi fi
sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g" sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g"
sed $CONFIG -i -e "s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g" sed $CONFIG -i -e "s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g"
STATUS="The GL driver is disabled." STATUS="The GL driver is disabled."
;; ;;
G2*) G2*)
if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-fkms-v3d" ; then if is_pifour ; then
ASK_TO_REBOOT=1 if ! grep -q -E "^dtoverlay=vc4-fkms-v3d" $CONFIG; then
ASK_TO_REBOOT=1
fi
else
if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-fkms-v3d" ; then
ASK_TO_REBOOT=1
fi
fi fi
sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g" sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g"
sed $CONFIG -i -e "s/^#dtoverlay=vc4-fkms-v3d/dtoverlay=vc4-fkms-v3d/g" sed $CONFIG -i -e "s/^#dtoverlay=vc4-fkms-v3d/dtoverlay=vc4-fkms-v3d/g"