Index: trunk/ChameleonPrefPane/ChameleonPrefPane.xcodeproj/project.pbxproj =================================================================== --- trunk/ChameleonPrefPane/ChameleonPrefPane.xcodeproj/project.pbxproj (revision 278) +++ trunk/ChameleonPrefPane/ChameleonPrefPane.xcodeproj/project.pbxproj (revision 279) @@ -48,6 +48,7 @@ 01B0E8271108B89100ACF21B /* CREDITS in Resources */ = {isa = PBXBuildFile; fileRef = 01B0E8261108B89100ACF21B /* CREDITS */; }; 01B0E8291108B89D00ACF21B /* version in Resources */ = {isa = PBXBuildFile; fileRef = 01B0E8281108B89D00ACF21B /* version */; }; 01E0E9511108F9ED004EF6E8 /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 01E0E9501108F9ED004EF6E8 /* TODO */; }; + 61A9E7B21389404D00043B27 /* extractAcpi.sh in Resources */ = {isa = PBXBuildFile; fileRef = 61A9E7B11389404D00043B27 /* extractAcpi.sh */; }; 8D202CEA0486D31800D8A456 /* StartupPrefPane_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCFA20370C41700C91783 /* StartupPrefPane_Prefix.pch */; }; 8D202CEF0486D31800D8A456 /* Chameleon.xib in Resources */ = {isa = PBXBuildFile; fileRef = F506C042013D9D8C01CA16C8 /* Chameleon.xib */; }; 8D202CF30486D31800D8A456 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; @@ -143,6 +144,7 @@ 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 32DBCFA20370C41700C91783 /* StartupPrefPane_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StartupPrefPane_Prefix.pch; sourceTree = ""; }; + 61A9E7B11389404D00043B27 /* extractAcpi.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = extractAcpi.sh; path = Resources/extractAcpi.sh; sourceTree = ""; }; 8D202CF70486D31800D8A456 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; B316F45B111C604B007EFE5E /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = French; path = Chameleon.strings; sourceTree = ""; }; B316F45D111C604B007EFE5E /* French */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = French; path = Chameleon.xib; sourceTree = ""; }; @@ -288,6 +290,7 @@ 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( + 61A9E7B11389404D00043B27 /* extractAcpi.sh */, B3F3522D1125C0290051DFA5 /* Spanish.lproj */, B316F508111C632B007EFE5E /* Images */, B316F47A111C6087007EFE5E /* English.lproj */, @@ -571,6 +574,7 @@ B3F352341125C0290051DFA5 /* Chameleon.strings in Resources */, B3F352351125C0290051DFA5 /* Chameleon.xib in Resources */, B3F352361125C0290051DFA5 /* Localizable.strings in Resources */, + 61A9E7B21389404D00043B27 /* extractAcpi.sh in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; Index: branches/iFabio/ChameleonPrefPane/Resources/extractAcpi.sh =================================================================== --- branches/iFabio/ChameleonPrefPane/Resources/extractAcpi.sh (revision 0) +++ branches/iFabio/ChameleonPrefPane/Resources/extractAcpi.sh (revision 279) @@ -0,0 +1,40 @@ +#/bin/sh +set -e +set -u +ACPI_DIR="${HOME}/Desktop/ACPI" +ioreg= +if [[ $# -eq 1 && -f "$1" ]]; then + ioreg="$(grep ' "ACPI Tables" =' "$1")" +else + ioreg="$(ioreg -lw0 | grep ' "ACPI Tables" =')" +fi + +ioreg=${ioreg#*\{} +ioreg=${ioreg%\}*} + +declare -a tables +ioreg="${ioreg//,/ }" + +tables=($ioreg) + +echo "Number of ACPI tables: ${#tables[@]}" +re='"([^"]+)"=<([^>]+)>' +dumped=0 +for t in "${tables[@]}"; do + #echo Table: $t + if [[ $t =~ $re ]]; then + [[ $dumped = 0 ]] && mkdir -p ${ACPI_DIR} + ((++dumped)) + echo + echo "Dumping table: ${BASH_REMATCH[1]}" + #echo "Content: ${BASH_REMATCH[2]}" + echo "${BASH_REMATCH[2]}" | xxd -r -p > "${ACPI_DIR}/${BASH_REMATCH[1]}".aml + echo "AML code dumped to \"${ACPI_DIR}/${BASH_REMATCH[1]}.aml\"" + type -p iasl &>/dev/null && iasl -d "${ACPI_DIR}/${BASH_REMATCH[1]}".aml \ + && echo "DSL code decompiled to \"${ACPI_DIR}/${BASH_REMATCH[1]}.dsl\"" + echo + fi +done +#if [[ $dumped -gt 0 ]]; then +# zip -r ACPI.zip ACPI && echo "Zipped your ACPI tables in file \"ACPI.zip\"" +#fi Property changes on: branches/iFabio/ChameleonPrefPane/Resources/extractAcpi.sh ___________________________________________________________________ Added: svn:executable + *