static void usage(void)
{
fprintf(stderr, "Usage: mtd [<options> ...] <command></command> [<arguments> ...] <device>[:<device>...]\n\n"
"The device is in the format of mtdX (eg: mtd4) or its label.\n"
"mtd recognizes these commands:\n"
" unlock unlock the device\n"
" refresh refresh mtd partition\n"
" erase erase all data on device\n"
" write <imagefile>|- write <imagefile> (use - for stdin) to device\n"
" jffs2write <file> append <file> to the jffs2 partition on the device\n");
if (mtd_fixtrx) {
fprintf(stderr,
" fixtrx fix the checksum in a trx header on first boot\n");
}
fprintf(stderr,
"Following options are available:\n"
" -q quiet mode (once: no [w] on writing,\n"
" twice: no status messages)\n"
" -n write without first erasing the blocks\n"
" -r reboot after successful command\n"
" -f force write without trx checks\n"
" -e <device> erase <device> before executing the command\n"
" -d <name> directory for jffs2write, defaults to \"tmp\"\n"
" -j <name> integrate <file> into jffs2 data when writing an image\n");
if (mtd_fixtrx) {
fprintf(stderr,
" -o offset offset of the image header in the partition(for fixtrx)\n");
}
fprintf(stderr,
#ifdef FIS_SUPPORT
" -F <part>[:<size>[:<entrypoint>]][,<part>...]\n"
" alter the fis partition table to create new partitions replacing\n"
" the partitions provided as argument to the write command\n"
" (only valid together with the write command)\n"
#endif
"\n"
"Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards\n"
" mtd -r write linux.trx linux\n\n");
exit(1);
}</part></entrypoint></size></part></file></name></name></device></device></file></file></imagefile></imagefile></device></device></arguments></options> |