aboutsummaryrefslogtreecommitdiffstats
path: root/target/utils/src/addpattern.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-08-12 13:59:13 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-08-12 13:59:13 +0000
commit74e0667343ad15a4d7d47c002f7002c4d0e6481d (patch)
tree0e99c9f12d5f338babd9bab33a66f1888ced7174 /target/utils/src/addpattern.c
parente5438a7070455755d7784f96ebf9ac5b199beaee (diff)
downloadmaster-187ad058-74e0667343ad15a4d7d47c002f7002c4d0e6481d.tar.gz
master-187ad058-74e0667343ad15a4d7d47c002f7002c4d0e6481d.tar.bz2
master-187ad058-74e0667343ad15a4d7d47c002f7002c4d0e6481d.zip
add pspboot support, cleanup in ar7 board support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1611 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/utils/src/addpattern.c')
-rw-r--r--target/utils/src/addpattern.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/target/utils/src/addpattern.c b/target/utils/src/addpattern.c
index 52fb8ee1c4..084ecf29a5 100644
--- a/target/utils/src/addpattern.c
+++ b/target/utils/src/addpattern.c
@@ -50,6 +50,7 @@
#define CODE_ID "U2ND" /* from code_pattern.h */
#define CODE_PATTERN "W54S" /* from code_pattern.h */
+#define PBOT_PATTERN "PBOT"
#define CYBERTAN_VERSION "v3.37.2" /* from cyutils.h */
@@ -75,7 +76,7 @@ void usage(void) __attribute__ (( __noreturn__ ));
void usage(void)
{
- fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1|2}]\n");
+ fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-b] [-v v#.#.#] [-{0|1|2}]\n");
exit(EXIT_FAILURE);
}
@@ -88,8 +89,10 @@ int main(int argc, char **argv)
char *ifn = NULL;
char *ofn = NULL;
char *pattern = CODE_PATTERN;
+ char *pbotpat = PBOT_PATTERN;
char *version = CYBERTAN_VERSION;
int gflag = 0;
+ int pbotflag = 0;
int c;
int v0, v1, v2;
size_t off, n;
@@ -101,7 +104,7 @@ int main(int argc, char **argv)
hdr = (struct code_header *) buf;
memset(hdr, 0, sizeof(struct code_header));
- while ((c = getopt(argc, argv, "i:o:p:gv:012")) != -1) {
+ while ((c = getopt(argc, argv, "i:o:p:gbv:012")) != -1) {
switch (c) {
case 'i':
ifn = optarg;
@@ -115,6 +118,9 @@ int main(int argc, char **argv)
case 'g':
gflag = 1;
break;
+ case 'b':
+ pbotflag = 1;
+ break;
case 'v': /* extension to allow setting version */
version = optarg;
break;
@@ -169,6 +175,8 @@ int main(int argc, char **argv)
}
memcpy(&hdr->magic, pattern, 4);
+ if (pbotflag)
+ memcpy(&hdr->res1, pbotpat, 4);
hdr->fwdate[0] = ptm->tm_year % 100;
hdr->fwdate[1] = ptm->tm_mon + 1;
hdr->fwdate[2] = ptm->tm_mday;