updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / b43-fwcutter-patched / 0001-fwcutter-mklist.py-Update-to-new-library-and-skip-so.patch
blob455a700ca3de3f6167b1298fcc942be0de6418f3
1 From 4c01539a4e8c9e87ce41789ec1e00ffae2e563aa Mon Sep 17 00:00:00 2001
2 From: Larry Finger <Larry.Finger@lwfinger.net>
3 Date: Thu, 20 Aug 2009 12:30:11 -0500
4 Subject: [PATCH 1/3] fwcutter: mklist.py - Update to new library and skip some sections
6 Switch from the deprecated md5 library to hashlib.
8 Detect the ro section that describes the firmware version,
9 print the address of the data, and and skip some ro sections
10 that are not of interest.
12 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
13 Signed-off-by: Michael Buesch <mb@bu3sch.de>
14 ---
15 fwcutter/mklist.py | 12 ++++++++++--
16 1 files changed, 10 insertions(+), 2 deletions(-)
18 diff --git a/fwcutter/mklist.py b/fwcutter/mklist.py
19 index 1bc8351..40e6cb8 100755
20 --- a/fwcutter/mklist.py
21 +++ b/fwcutter/mklist.py
22 @@ -30,7 +30,7 @@
23 import sys
24 import os
25 import re
26 -import md5
27 +import hashlib
29 if len(sys.argv) != 2:
30 print "Usage: %s path/to/wl.o" % sys.argv[0]
31 @@ -55,7 +55,7 @@ if rodata_fileoffset == None:
32 print "ERROR: Could not find .rodata fileoffset"
33 sys.exit(1)
35 -md5sum = md5.md5(file(fn, "r").read())
36 +md5sum = hashlib.md5(file(fn, "r").read())
38 print "static struct extract _%s[] =" % md5sum.hexdigest()
39 print "{"
40 @@ -80,6 +80,14 @@ for sym in syms:
41 size -= 8
42 if "pcm" in name:
43 type = "EXT_PCM"
44 + if "bommajor" in name:
45 + print "\t/* ucode major version at offset 0x%x */" % pos
46 + continue
47 + if "bomminor" in name:
48 + print "\t/* ucode minor version at offset 0x%x */" % pos
49 + continue
50 + if "ucode_2w" in name:
51 + continue
52 m = ucode_re.match(name)
53 if m:
54 corerev = int(m.group(1))
55 --
56 1.6.4