Blob Blame History Raw
From 4c01539a4e8c9e87ce41789ec1e00ffae2e563aa Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
Date: Thu, 20 Aug 2009 12:30:11 -0500
Subject: [PATCH 1/3] fwcutter: mklist.py - Update to new library and skip some sections

Switch from the deprecated md5 library to hashlib.

Detect the ro section that describes the firmware version,
print the address of the data, and and skip some ro sections
that are not of interest.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
 fwcutter/mklist.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/fwcutter/mklist.py b/fwcutter/mklist.py
index 1bc8351..40e6cb8 100755
--- a/fwcutter/mklist.py
+++ b/fwcutter/mklist.py
@@ -30,7 +30,7 @@
 import sys
 import os
 import re
-import md5
+import hashlib
 
 if len(sys.argv) != 2:
 	print "Usage: %s path/to/wl.o" % sys.argv[0]
@@ -55,7 +55,7 @@ if rodata_fileoffset == None:
 	print "ERROR: Could not find .rodata fileoffset"
 	sys.exit(1)
 
-md5sum = md5.md5(file(fn, "r").read())
+md5sum = hashlib.md5(file(fn, "r").read())
 
 print "static struct extract _%s[] =" % md5sum.hexdigest()
 print "{"
@@ -80,6 +80,14 @@ for sym in syms:
 		size -= 8
 	if "pcm" in name:
 		type = "EXT_PCM"
+	if "bommajor" in name:
+		print "\t/* ucode major version at offset 0x%x */" % pos
+		continue
+	if "bomminor" in name:
+		print "\t/* ucode minor version at offset 0x%x */" % pos
+		continue
+	if "ucode_2w" in name:
+		continue
 	m = ucode_re.match(name)
 	if m:
 		corerev = int(m.group(1))
-- 
1.6.4