Skip to content

Commit

Permalink
[cmdline] Add "passes=N" command-line parameter to limit number of pa…
Browse files Browse the repository at this point in the history
…sses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 12, 2012
1 parent 416a228 commit f9d3679
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.c
Expand Up @@ -174,6 +174,11 @@ static void parse_command_line(void)
serial_console_setup(cmdline);
}

if (!strncmp(cmdline, "passes=", 7)) {
cmdline += 7;
v->max_passes = simple_strtoul(cmdline,&cmdline,10);
}

/* go to the next parameter */
while (*cmdline && *cmdline != ' ')
cmdline++;
Expand Down Expand Up @@ -523,6 +528,8 @@ void do_test(void)
beep(2000);
}
}
if (v->max_passes && v->pass >= v->max_passes)
v->exit = 1;
}

/* We always start a pass with the low copy */
Expand Down
2 changes: 2 additions & 0 deletions test.h
Expand Up @@ -104,6 +104,7 @@ typedef unsigned long ulong;
int memcmp(const void *s1, const void *s2, ulong count);
int strncmp(const char *s1, const char *s2, ulong n);
void *memmove(void *dest, const void *src, ulong n);
unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
int query_linuxbios(void);
int query_pcbios(void);
int insertaddress(ulong);
Expand Down Expand Up @@ -349,6 +350,7 @@ struct vars {
ulong selected_pages;
ulong reserved_pages;
int exit;
int max_passes;
};

#define FIRMWARE_UNKNOWN 0
Expand Down

0 comments on commit f9d3679

Please sign in to comment.