Chameleon

Chameleon Svn Source Tree

Root/tags/2.0/package/Configuration/PrefPanel/Chameleon.prefPane/Contents/Resources/extractAcpi.sh

  • Property svn:executable set to *
Source at commit 1551 created 12 years 10 months ago.
By ifabio, Added Macedonian Language Add 1280x768 Resolution choice (pkg) Update all the language Renamed postinstall.in in postinstall correct it also into buildpkg.sh
1#/bin/sh
2set -e
3set -u
4ACPI_DIR="${HOME}/Desktop/ACPI"
5ioreg=
6if [[ $# -eq 1 && -f "$1" ]]; then
7 ioreg="$(grep ' "ACPI Tables" =' "$1")"
8else
9 ioreg="$(ioreg -lw0 | grep ' "ACPI Tables" =')"
10fi
11
12ioreg=${ioreg#*\{}
13ioreg=${ioreg%\}*}
14
15declare -a tables
16ioreg="${ioreg//,/ }"
17
18tables=($ioreg)
19
20echo "Number of ACPI tables: ${#tables[@]}"
21re='"([^"]+)"=<([^>]+)>'
22dumped=0
23for t in "${tables[@]}"; do
24 #echo Table: $t
25 if [[ $t =~ $re ]]; then
26 [[ $dumped = 0 ]] && mkdir -p ${ACPI_DIR}
27 ((++dumped))
28 echo
29 echo "Dumping table: ${BASH_REMATCH[1]}"
30 #echo "Content: ${BASH_REMATCH[2]}"
31 echo "${BASH_REMATCH[2]}" | xxd -r -p > "${ACPI_DIR}/${BASH_REMATCH[1]}".aml
32 echo "AML code dumped to \"${ACPI_DIR}/${BASH_REMATCH[1]}.aml\""
33 type -p iasl &>/dev/null && iasl -d "${ACPI_DIR}/${BASH_REMATCH[1]}".aml \
34 && echo "DSL code decompiled to \"${ACPI_DIR}/${BASH_REMATCH[1]}.dsl\""
35 echo
36 fi
37done
38#if [[ $dumped -gt 0 ]]; then
39# zip -r ACPI.zip ACPI && echo "Zipped your ACPI tables in file \"ACPI.zip\""
40#fi
41

Archive Download this file

Revision: 1551