summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fc50c6a)
Signed-off-by: Mark Mentovai <mark@moxienet.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27052
3c298f89-4303-0410-b956-
a3cf2f4a3e73
static char *ofname;
static char *version = "1.00.00";
static char *region = "";
static char *ofname;
static char *version = "1.00.00";
static char *region = "";
static char *board_id;
/*
static char *board_id;
/*
" -o <file> write output to the file <file>\n"
" -v <version> set image version to <version>\n"
" -r <region> set image region to <region>\n"
" -o <file> write output to the file <file>\n"
" -v <version> set image version to <version>\n"
" -r <region> set image region to <region>\n"
+" -H <hd_id> set image hardware id to <hd_id>\n"
" -h show this screen\n"
);
" -h show this screen\n"
);
int err;
struct stat st;
char *buf;
int err;
struct stat st;
char *buf;
uint8_t csum;
FILE *outfile, *infile;
uint8_t csum;
FILE *outfile, *infile;
- c = getopt(argc, argv, "B:i:o:v:r:h");
+ c = getopt(argc, argv, "B:i:o:v:r:H:h");
case 'r':
region = optarg;
break;
case 'r':
region = optarg;
break;
+ case 'H':
+ hd_id = optarg;
+ break;
case 'h':
usage(EXIT_SUCCESS);
break;
case 'h':
usage(EXIT_SUCCESS);
break;
}
memset(buf, 0, DNI_HDR_LEN);
}
memset(buf, 0, DNI_HDR_LEN);
- snprintf(buf, DNI_HDR_LEN, "device:%s\nversion:V%s\nregion:%s\n",
- board_id, version, region);
+ pos = snprintf(buf, DNI_HDR_LEN, "device:%s\nversion:V%s\nregion:%s\n",
+ board_id, version, region);
+ rem = DNI_HDR_LEN - pos;
+ if (pos >= 0 && rem > 1 && hd_id) {
+ snprintf(buf + pos, rem, "hd_id:%s\n", hd_id);
+ }
infile = fopen(ifname, "r");
if (infile == NULL) {
infile = fopen(ifname, "r");
if (infile == NULL) {