Created
January 29, 2015 00:03
-
-
Save dch/ce22b1f84dd23be6a4f7 to your computer and use it in GitHub Desktop.
OSX acpi dump script via http://stage.convertit2mac.com/forum/index.cfm?mainaction=posts&forumid=24&threadid=57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# dumpACPItables, get all Tables from Mac OS X ioreg. | |
# | |
# 06-19-2009 AlainTox714 | |
# | |
# path: /usr/local/bin | |
# | |
ACPIdir="/Users/${USER}/Desktop/ACPI_tables" | |
[ "$(whoami)" == "root" ] && ACPIdir="/Users/${SUDO_USER}/Desktop/ACPI_tables" | |
if [ ! -d ${ACPIdir} ]; then | |
mkdir "${ACPIdir}" | |
else | |
rm -rf "${ACPIdir}"/*.* | |
fi | |
# Dump ACPI Tables from ioreg | |
ACPI_Tables="$(ioreg -lw0 | grep 'ACPI Tables' | cut -f2 -d '{' | tr -d '}' | tr ',' '\012')" | |
iaslOK= | |
if [ -n "$(which iasl)" ]; then | |
iaslOK=1 | |
cd "${ACPIdir}" | |
fi | |
# Extract Tables from Dump | |
for table in ${ACPI_Tables}; do | |
tableName=$(echo $table | cut -f1 -d '=' | tr -d '"') | |
printf "${tableName} \n" | |
tableData=$(echo "$table" | cut -f2 -d '<' | tr -d '>') | |
echo "$tableData" | xxd -r -p > "${ACPIdir}/${tableName}.aml" | |
if [ -n "${iaslOK}" ]; then | |
iasl -d "${tableName}.aml" 1>/dev/null 2>&1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bash ioreg -l | grep -Ei acpi
is not returning anything in Mojave, do you know how to fix?