Author: titmuss
Date: Mon May 19 07:00:01 2008
New Revision: 2479
URL: http://svn.slimdevices.com?rev=2479&root=Jive&view=rev
Log:
Bug: N/A
Description:
Fix nanddump to obey the -l parameter correctly. It was always rounded up to
the size of the flash blocks and did
not skip bad blocks.
Modified:
7.1/trunk/squeezeos/src/system/mtd-utils/nanddump.c
Modified: 7.1/trunk/squeezeos/src/system/mtd-utils/nanddump.c
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeos/src/system/mtd-utils/nanddump.c?rev=2479&root=Jive&r1=2478&r2=2479&view=diff
==============================================================================
--- 7.1/trunk/squeezeos/src/system/mtd-utils/nanddump.c (original)
+++ 7.1/trunk/squeezeos/src/system/mtd-utils/nanddump.c Mon May 19 07:00:01 2008
@@ -281,8 +281,16 @@
}
if (badblock) {
- if (omitbad)
+ if (omitbad) {
+ if (length) {
+ /* bad blocks don't count towards the
length */
+ end_addr += bs;
+ if (end_addr > meminfo.size) {
+ end_addr = meminfo.size;
+ }
+ }
continue;
+ }
memset (readbuf, 0xff, bs);
} else {
/* Read page data and exit on failure */
@@ -290,6 +298,10 @@
perror("pread");
goto closeall;
}
+ }
+
+ if (bs > end_addr - ofs) {
+ bs = end_addr - ofs;
}
/* ECC stats available ? */
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins