simplify: use hexdump to produce the output in the desired form instead

of massaging it with sed.
This commit is contained in:
christos 2002-06-18 17:21:33 +00:00
parent 54c5e72f02
commit 48b4953ba1
1 changed files with 3 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: genwakecode.sh,v 1.2 2002/06/18 07:37:37 tshiozak Exp $
# $NetBSD: genwakecode.sh,v 1.3 2002/06/18 17:21:33 christos Exp $
# FreeBSD: src/sys/i386/acpica/genwakecode.sh,v 1.1 2002/05/01 21:52:34 peter Exp $
echo '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. */'
head -1 acpi_wakecode.S | sed 's@^.*\$\(NetBSD:.*\)\$.*$@/* from: \1 */@'
@ -24,16 +24,8 @@ do
done || exit 1
echo
echo 'static char wakecode[] = {';
hexdump -Cv < acpi_wakecode.bin | \
sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\|.*$//' | \
while read line
do
for code in ${line}
do
echo -n "0x${code},";
done
done
echo 'static const unsigned char wakecode[] = {';
hexdump -v -e '"\t" 8/1 "0x%02x, " "\n"' < acpi_wakecode.bin
echo '};'
exit 0