summaryrefslogtreecommitdiff
path: root/ubuntu/scripts/acpi-check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ubuntu/scripts/acpi-check.sh')
-rwxr-xr-xubuntu/scripts/acpi-check.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/ubuntu/scripts/acpi-check.sh b/ubuntu/scripts/acpi-check.sh
new file mode 100755
index 0000000..467d773
--- /dev/null
+++ b/ubuntu/scripts/acpi-check.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+DSDTPASS=
+
+echo -n "Testing presence of /sys/firmware/acpi: "
+if [ -d /sys/firmware/acpi ]; then
+ echo PASS
+else
+ echo FAIL
+fi
+
+echo -n "Testing presence of /sys/firmware/acpi/tables/DSDT: "
+if [ -f /sys/firmware/acpi/tables/DSDT ]; then
+ echo PASS
+ DSDTPASS=pass
+else
+ echo FAIL
+fi
+
+echo -n "Can decompile DSDT: "
+if [ -x /usr/bin/iasl -a -n "$DSDTPASS" ]; then
+ cp /sys/firmware/acpi/tables/DSDT /tmp/
+ ERROR=`/usr/bin/iasl -d /tmp/DSDT 2>&1 | grep DSDT.dsl`
+ if [ -n "$ERROR" ]; then
+ echo PASS
+ else
+ echo FAIL
+ fi
+ rm /tmp/DSDT /tmp/DSDT.dsl
+else
+ echo SKIP
+fi
+