Skip to content

Instantly share code, notes, and snippets.

@joshskidmore
Last active September 15, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshskidmore/cf1f84d70d276615576850f494c12f9c to your computer and use it in GitHub Desktop.
Save joshskidmore/cf1f84d70d276615576850f494c12f9c to your computer and use it in GitHub Desktop.
p2max-dsdt-check.sh
#!/usr/bin/env bash
_dmesg=$(dmesg)
bios_version=$(echo -e "$_dmesg" | grep GPD | awk '{ print $9 }')
echo "You are running GPD P2 BIOS version $bios_version"
if [[ "$_dmesg" =~ "20190816" ]]; then
echo "You have the DSDT for v0.23 loaded (joshwiththegoodhair version)"
[[ "$bios_version" == "0.23" ]] && echo "Congrats! This is the proper version for your BIOS. Touchscreen should be working."
[[ "$bios_version" != "0.23" ]] && echo "ERROR: You've loaded the wrong version of the DSDT override for your BIOS. Try loading PeterCxy's version: https://github.com/PeterCxy/gpd_p2_max_acpi/releases/download/20190825/acpi_override"
elif [[ "$_dmesg" =~ "20190703" ]]; then
echo "You have the DSDT for < v0.23 loaded (PeterCxy version)"
[[ "$bios_version" != "0.23" ]] && echo "This *should* be the proper DSDT to match your BIOS."
[[ "$bios_version" == "0.23" ]] && echo "ERROR: You need to upgrade your DSDT override to match BIOS version v0.23. Load this override instead: http://josh.sh/acpi_override_23"
elif ! [[ "$_dmesg" =~ "Phsical table override" ]]; then
echo "Error: You have no DSDT override loaded! Visit https://gpdsupport.com/t/touchscreen-issue-resolved/132/67 and use the override for BIOS version $bios_version"
else
echo "Unable to determine whether DSDT has been loaded"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment