3 # Copyright (C) 2007-2010 by coresystems GmbH
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
18 # walk through all ACPI tables with their addresses
21 # we can not just dump the tables by their names because some
22 # machines have double ACPI tables
24 acpidump |
grep "@ 0x" |
while read line
26 NAME
=$
( echo `echo $line|cut -f1 -d@` )
27 FNAME
=$
( echo $NAME |
sed s
/\
/_
/g |
sed s
/\
!/b
/g
)
28 ADDR
=$
( echo `echo $line|cut -f2 -d@` )
29 if [ "${!FNAME}" == "" ]; then
32 eval $FNAME=$
(( ${!FNAME} + 1 ))
34 printf "Processing table \"$NAME\" at $ADDR ... "
35 printf "${!FNAME} tables of that kind found before.\n"
37 # acpidump -s ${!FNAME} --table "$NAME" > out/$FNAME-$ADDR-${!FNAME}.txt
38 acpidump
-b -s ${!FNAME} --table "$NAME" > out
/$FNAME-$ADDR-${!FNAME}.bin
39 if [ "`file -b out/$FNAME-$ADDR-${!FNAME}.bin`" != "ASCII text" ]; then
40 iasl
-d out
/$FNAME-$ADDR-${!FNAME}.bin
&>/dev
/null
42 printf "Skipping $NAME because it was not dumped correctly.\n\n"