X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/8bf683b4afd61cc191c001f28815061e4fd5c8a1..6e01c9cecfc5783bf23b3be60161bf010820b7b3:/package/openwrt/mtd.c?ds=sidebyside diff --git a/package/openwrt/mtd.c b/package/openwrt/mtd.c index 645ad1180..851f26628 100644 --- a/package/openwrt/mtd.c +++ b/package/openwrt/mtd.c @@ -237,7 +237,6 @@ void usage(void) " erase erase all data on device\n" " write write imagefile to device\n" "Following options are available:\n" - " -u unlock device before accessing it\n" " -r reboot after successful command\n" " -e erase before executing the command\n\n" "Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards\n" @@ -257,13 +256,9 @@ int main (int argc, char **argv) erase[0] = NULL; boot = 0; - unlock = 0; - while ((ch = getopt(argc, argv, "ure:")) != -1) + while ((ch = getopt(argc, argv, "re:")) != -1) switch (ch) { - case 'u': - unlock = 1; - break; case 'r': boot = 1; break; @@ -308,12 +303,10 @@ int main (int argc, char **argv) i++; } - if (unlock) - mtd_unlock(device); + mtd_unlock(device); switch (cmd) { case CMD_UNLOCK: - mtd_unlock(device); break; case CMD_ERASE: mtd_erase(device); @@ -324,7 +317,7 @@ int main (int argc, char **argv) } if (boot) - reboot(0); + kill(1, 15); // send SIGTERM to init for reboot return 0; }