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>
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
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"
35 -md5sum = md5.md5(file(fn, "r").read())
36 +md5sum = hashlib.md5(file(fn, "r").read())
38 print "static struct extract _%s[] =" % md5sum.hexdigest()
40 @@ -80,6 +80,14 @@ for sym in syms:
44 + if "bommajor" in name:
45 + print "\t/* ucode major version at offset 0x%x */" % pos
47 + if "bomminor" in name:
48 + print "\t/* ucode minor version at offset 0x%x */" % pos
50 + if "ucode_2w" in name:
52 m = ucode_re.match(name)
54 corerev = int(m.group(1))