From 58d914a3d4861e1e88e71585ddecd92c63dae1fc Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 3 Sep 2009 22:34:03 +0200 Subject: [PATCH] acpi: restructure genwakecode.sh genwakecode.sh used some obscure hexdump/sed magic to embed a binary into source. The specific usage of sed breaks in at least the UTF-8 locale. Rework the script to use hexdump and sed in a less obscure way. --- sys/platform/pc32/acpica5/genwakecode.sh | 11 ++--------- sys/platform/{pc32 => pc64}/acpica5/genwakecode.sh | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) copy sys/platform/{pc32 => pc64}/acpica5/genwakecode.sh (68%) diff --git a/sys/platform/pc32/acpica5/genwakecode.sh b/sys/platform/pc32/acpica5/genwakecode.sh index 970e5d772a..0e4499e0fd 100644 --- a/sys/platform/pc32/acpica5/genwakecode.sh +++ b/sys/platform/pc32/acpica5/genwakecode.sh @@ -4,15 +4,8 @@ # echo "/* generated from `pwd`/acpi_wakecode.o */" 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 +hexdump -bv acpi_wakecode.bin | \ + sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\([[:digit:]]\{1,\}\) */0\1,/g' echo '};' nm -n acpi_wakecode.o | while read offset dummy what diff --git a/sys/platform/pc32/acpica5/genwakecode.sh b/sys/platform/pc64/acpica5/genwakecode.sh similarity index 68% copy from sys/platform/pc32/acpica5/genwakecode.sh copy to sys/platform/pc64/acpica5/genwakecode.sh index 970e5d772a..0e4499e0fd 100644 --- a/sys/platform/pc32/acpica5/genwakecode.sh +++ b/sys/platform/pc64/acpica5/genwakecode.sh @@ -4,15 +4,8 @@ # echo "/* generated from `pwd`/acpi_wakecode.o */" 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 +hexdump -bv acpi_wakecode.bin | \ + sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\([[:digit:]]\{1,\}\) */0\1,/g' echo '};' nm -n acpi_wakecode.o | while read offset dummy what -- 2.11.4.GIT