|
|
158b941 |
From 4c01539a4e8c9e87ce41789ec1e00ffae2e563aa Mon Sep 17 00:00:00 2001
|
|
|
158b941 |
From: Larry Finger <Larry.Finger@lwfinger.net>
|
|
|
158b941 |
Date: Thu, 20 Aug 2009 12:30:11 -0500
|
|
|
158b941 |
Subject: [PATCH 1/3] fwcutter: mklist.py - Update to new library and skip some sections
|
|
|
158b941 |
|
|
|
158b941 |
Switch from the deprecated md5 library to hashlib.
|
|
|
158b941 |
|
|
|
158b941 |
Detect the ro section that describes the firmware version,
|
|
|
158b941 |
print the address of the data, and and skip some ro sections
|
|
|
158b941 |
that are not of interest.
|
|
|
158b941 |
|
|
|
158b941 |
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
|
|
|
158b941 |
Signed-off-by: Michael Buesch <mb@bu3sch.de>
|
|
|
158b941 |
---
|
|
|
158b941 |
fwcutter/mklist.py | 12 ++++++++++--
|
|
|
158b941 |
1 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
158b941 |
|
|
|
158b941 |
diff --git a/fwcutter/mklist.py b/fwcutter/mklist.py
|
|
|
158b941 |
index 1bc8351..40e6cb8 100755
|
|
|
158b941 |
--- a/fwcutter/mklist.py
|
|
|
158b941 |
+++ b/fwcutter/mklist.py
|
|
|
158b941 |
@@ -30,7 +30,7 @@
|
|
|
158b941 |
import sys
|
|
|
158b941 |
import os
|
|
|
158b941 |
import re
|
|
|
158b941 |
-import md5
|
|
|
158b941 |
+import hashlib
|
|
|
158b941 |
|
|
|
158b941 |
if len(sys.argv) != 2:
|
|
|
158b941 |
print "Usage: %s path/to/wl.o" % sys.argv[0]
|
|
|
158b941 |
@@ -55,7 +55,7 @@ if rodata_fileoffset == None:
|
|
|
158b941 |
print "ERROR: Could not find .rodata fileoffset"
|
|
|
158b941 |
sys.exit(1)
|
|
|
158b941 |
|
|
|
158b941 |
-md5sum = md5.md5(file(fn, "r").read())
|
|
|
158b941 |
+md5sum = hashlib.md5(file(fn, "r").read())
|
|
|
158b941 |
|
|
|
158b941 |
print "static struct extract _%s[] =" % md5sum.hexdigest()
|
|
|
158b941 |
print "{"
|
|
|
158b941 |
@@ -80,6 +80,14 @@ for sym in syms:
|
|
|
158b941 |
size -= 8
|
|
|
158b941 |
if "pcm" in name:
|
|
|
158b941 |
type = "EXT_PCM"
|
|
|
158b941 |
+ if "bommajor" in name:
|
|
|
158b941 |
+ print "\t/* ucode major version at offset 0x%x */" % pos
|
|
|
158b941 |
+ continue
|
|
|
158b941 |
+ if "bomminor" in name:
|
|
|
158b941 |
+ print "\t/* ucode minor version at offset 0x%x */" % pos
|
|
|
158b941 |
+ continue
|
|
|
158b941 |
+ if "ucode_2w" in name:
|
|
|
158b941 |
+ continue
|
|
|
158b941 |
m = ucode_re.match(name)
|
|
|
158b941 |
if m:
|
|
|
158b941 |
corerev = int(m.group(1))
|
|
|
158b941 |
--
|
|
|
158b941 |
1.6.4
|
|
|
158b941 |
|