mtd-utils flash_erase progress

eric eric.kenny at gmail.com
Tue Aug 1 08:23:30 PDT 2023


On Tue, 2023-08-01 at 10:31 +0800, Zhihao Cheng wrote:
> 
> The flash_erase tool will display progress in default, unless user
> adds 
> '-q' or '--silent'.
> 
> BTW, I can't apply the patch:
> git apply mtd-utils-flash_erase-progress.patch
> error: corrupt patch at line 159
> 

Apologies.  What I would like to propose is that when erasing the full
chip with mtd_erase_multi, flash_erase should not pretend that it is
going to give progress updates.  It makes it appear that it isn't
functioning correctly.  Suggested patch:


diff --git a/misc-utils/flash_erase.c b/misc-utils/flash_erase.c
index 49a880f..192d1b6 100644
--- a/misc-utils/flash_erase.c
+++ b/misc-utils/flash_erase.c
@@ -236,7 +236,6 @@ int main(int argc, char *argv[])
 		erase_chip = false;
 
 	if (erase_chip) {
-		show_progress(0, eb_start, eb_start, eb_cnt,
mtd.size);
 
 		if (unlock) {
 			if (mtd_unlock_multi(&mtd, fd, eb_start,
eb_cnt) != 0) {
@@ -254,9 +253,6 @@ int main(int argc, char *argv[])
 			goto erase_each_sector;
 		}
 
-		show_progress(0, eb_start + eb_cnt, eb_start,
-			      eb_cnt, mtd.size);
-
 		if (!jffs2)
 			goto out;
 











More information about the linux-mtd mailing list