version 1.3, 2014/02/05 22:00:29
|
version 1.3.2.1, 2014/02/05 22:44:13
|
Line 59 Usage()
|
Line 59 Usage()
|
"=== %s === %s@%s ===\n\n" |
"=== %s === %s@%s ===\n\n" |
" Syntax: imgupd [options] [image_file]\n\n" |
" Syntax: imgupd [options] [image_file]\n\n" |
"\t-v\t\tVerbose ...\n" |
"\t-v\t\tVerbose ...\n" |
|
"\t-R\t\tReboot system after complete\n" |
"\t-g\t\tGet image from Storage\n" |
"\t-g\t\tGet image from Storage\n" |
"\t-t\t\tTruncate Storage file name\n" |
"\t-t\t\tTruncate Storage file name\n" |
"\t-s <size>\tStorage size (required for stdin)\n" |
"\t-s <size>\tStorage size (required for stdin)\n" |
Line 134 FillStore(int img, int fd)
|
Line 135 FillStore(int img, int fd)
|
int |
int |
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
char ch, m = 0; | char ch, m = 0, R = 0; |
int fd, img, tr = 0; |
int fd, img, tr = 0; |
|
|
while ((ch = getopt(argc, argv, "hvgts:f:")) != -1) | while ((ch = getopt(argc, argv, "hvRgts:f:")) != -1) |
switch (ch) { |
switch (ch) { |
case 'f': |
case 'f': |
strlcpy(imgName, optarg, sizeof imgName); |
strlcpy(imgName, optarg, sizeof imgName); |
Line 155 main(int argc, char **argv)
|
Line 156 main(int argc, char **argv)
|
case 'g': |
case 'g': |
m = 1; |
m = 1; |
break; |
break; |
|
case 'R': |
|
R = 1; |
|
break; |
case 'v': |
case 'v': |
Verbose++; |
Verbose++; |
break; |
break; |
Line 274 main(int argc, char **argv)
|
Line 278 main(int argc, char **argv)
|
close(img); |
close(img); |
if (fd > 2) |
if (fd > 2) |
close(fd); |
close(fd); |
|
|
|
if (R) |
|
reboot(RB_AUTOBOOT); |
return 0; |
return 0; |
} |
} |