summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-16 01:43:50 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-16 01:43:50 +0000
commitde9128a1e6b5ef6d91146b5b7d984efb1778fc34 (patch)
treebcfcc94bf639aa3b7ad09efb74aefbd71a79e23c /build_tools
parent905c0014c3982c5a88a2b9d0a0f740d39b979be4 (diff)
Merged revisions 1820 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.4 ................ r1820 | kpfleming | 2007-01-15 19:37:26 -0600 (Mon, 15 Jan 2007) | 11 lines 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/trunk@1822 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}