NetBSD/sys/arch/x86/acpi/genwakecode.sh

17 lines
421 B
Bash
Raw Normal View History

2007-12-09 23:32:17 +03:00
#!/bin/sh
# $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); }'
${AWK} "$P" < acpi_wakecode.bin.map
2007-12-09 23:32:17 +03:00
echo
echo 'static const unsigned char wakecode[] = {';
${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