" erase erase all data on device\n"
" write <imagefile>|- write <imagefile> (use - for stdin) to device\n"
"Following options are available:\n"
" erase erase all data on device\n"
" write <imagefile>|- write <imagefile> (use - for stdin) to device\n"
"Following options are available:\n"
+ " -q quiet mode (once: no [w] on writing,\n"
+ " twice: no status messages)\n"
" -r reboot after successful command\n"
" -f force write without trx checks\n"
" -e <device> erase <device> before executing the command\n\n"
" -r reboot after successful command\n"
" -f force write without trx checks\n"
" -e <device> erase <device> before executing the command\n\n"
boot = 1;
break;
case 'q':
boot = 1;
break;
case 'q':
/* check trx file before erasing or writing anything */
if (!image_check(imagefd, device)) {
/* check trx file before erasing or writing anything */
if (!image_check(imagefd, device)) {
+ if ((quiet < 2) || !force)
fprintf(stderr, "TRX check failed!\n");
if (!force)
exit(1);
fprintf(stderr, "TRX check failed!\n");
if (!force)
exit(1);
i = 0;
unlocked = 0;
while (erase[i] != NULL) {
i = 0;
unlocked = 0;
while (erase[i] != NULL) {
fprintf(stderr, "Unlocking %s ...\n", erase[i]);
mtd_unlock(erase[i]);
fprintf(stderr, "Unlocking %s ...\n", erase[i]);
mtd_unlock(erase[i]);
fprintf(stderr, "Erasing %s ...\n", erase[i]);
mtd_erase(erase[i]);
if (strcmp(erase[i], device) == 0)
fprintf(stderr, "Erasing %s ...\n", erase[i]);
mtd_erase(erase[i]);
if (strcmp(erase[i], device) == 0)
fprintf(stderr, "Unlocking %s ...\n", device);
mtd_unlock(device);
}
fprintf(stderr, "Unlocking %s ...\n", device);
mtd_unlock(device);
}
case CMD_UNLOCK:
break;
case CMD_ERASE:
case CMD_UNLOCK:
break;
case CMD_ERASE:
- if (!quiet)
- fprintf(stderr, "Erasing %s ...\n", erase[i]);
+ if (quiet < 2)
+ fprintf(stderr, "Erasing %s ...\n", device);
mtd_erase(device);
break;
case CMD_WRITE:
mtd_erase(device);
break;
case CMD_WRITE:
fprintf(stderr, "Writing from %s to %s ... ", imagefile, device);
mtd_write(imagefd, device, quiet);
fprintf(stderr, "Writing from %s to %s ... ", imagefile, device);
mtd_write(imagefd, device, quiet);
fprintf(stderr, "\n");
break;
}
fprintf(stderr, "\n");
break;
}