2007-12-09 23:32:17 +03:00
|
|
|
#!/bin/sh
|
2009-01-18 16:55:31 +03:00
|
|
|
# $NetBSD: genwakecode.sh,v 1.3 2009/01/18 13:55:31 hans Exp $
|
|
|
|
|
|
|
|
AWK=${AWK:=awk}
|
|
|
|
HEXDUMP=${HEXDUMP:=hexdump}
|
|
|
|
SED=${SED:=sed}
|
2007-12-09 23:32:17 +03:00
|
|
|
|
|
|
|
P='/WAKEUP_/ { printf("#define\t%s%s\t%s\n", $2, length($2) < 16 ? "\t" : "", $1); }'
|
2009-01-18 16:55:31 +03:00
|
|
|
${AWK} "$P" < acpi_wakecode.bin.map
|
2007-12-09 23:32:17 +03:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo 'static const unsigned char wakecode[] = {';
|
2009-01-18 16:55:31 +03:00
|
|
|
${HEXDUMP} -v -e '"\t" 8/1 "0x%02x, " "\n"' < acpi_wakecode.bin | ${SED} 's/0x /0x00/g'
|
2007-12-09 23:32:17 +03:00
|
|
|
echo '};'
|
|
|
|
|
|
|
|
exit 0
|