summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-16 01:37:26 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-16 01:37:26 +0000
commit2b1564743ec337898e31300ccc97b3b91ecc50b3 (patch)
treeeae2f8153b7fa2fcdd8a41e70395ba0be12f1f69 /build_tools
parent38aafc7ac1a09549c042c994c1b9e08d19b69c75 (diff)
Merged revisions 1818 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r1818 | kpfleming | 2007-01-15 19:28:54 -0600 (Mon, 15 Jan 2007) | 3 lines eliminate the fw2h tool, and instead use objcopy to directly make object files from the firmware binary files pass HOTPLUG_FIRMWARE down to the module build so that we can avoid various compiler warnings ........ git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@1820 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/make_firmware_object12
1 files changed, 12 insertions, 0 deletions
diff --git a/build_tools/make_firmware_object b/build_tools/make_firmware_object
new file mode 100755
index 0000000..1aadde3
--- /dev/null
+++ b/build_tools/make_firmware_object
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+# make an object file from a raw binary firmware file
+# arguments:
+# 1 - firmware file
+# 2 - output file
+# 3 - template output file (used to learn desired format)
+
+bfdname=`objdump -f ${3} | grep -e "${3}:" | sed "s/.*file format \(.*\)/\1/"`
+bfdarch=`objdump -f ${3} | grep -e "architecture:" | sed "s/.*ture: \(.*\),.*/\1/"`
+
+objcopy -I binary ${1} -B ${bfdarch} -O ${bfdname} ${2}