--- embedtools/src/imgupd.c 2014/02/05 22:00:29 1.3 +++ embedtools/src/imgupd.c 2014/02/05 22:44:13 1.3.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: imgupd.c,v 1.3 2014/02/05 22:00:29 misho Exp $ + * $Id: imgupd.c,v 1.3.2.1 2014/02/05 22:44:13 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -59,6 +59,7 @@ Usage() "=== %s === %s@%s ===\n\n" " Syntax: imgupd [options] [image_file]\n\n" "\t-v\t\tVerbose ...\n" + "\t-R\t\tReboot system after complete\n" "\t-g\t\tGet image from Storage\n" "\t-t\t\tTruncate Storage file name\n" "\t-s \tStorage size (required for stdin)\n" @@ -134,10 +135,10 @@ FillStore(int img, int fd) int main(int argc, char **argv) { - char ch, m = 0; + char ch, m = 0, R = 0; int fd, img, tr = 0; - while ((ch = getopt(argc, argv, "hvgts:f:")) != -1) + while ((ch = getopt(argc, argv, "hvRgts:f:")) != -1) switch (ch) { case 'f': strlcpy(imgName, optarg, sizeof imgName); @@ -155,6 +156,9 @@ main(int argc, char **argv) case 'g': m = 1; break; + case 'R': + R = 1; + break; case 'v': Verbose++; break; @@ -274,5 +278,8 @@ main(int argc, char **argv) close(img); if (fd > 2) close(fd); + + if (R) + reboot(RB_AUTOBOOT); return 0; }