*/
#define ELILO_DEFAULT_CONFIG L"elilo.conf"
-#define MAX_STRING CMDLINE_MAXLEN
+#define MAX_STRING 512
#define CONFIG_BUFSIZE 512 /* input buffer size */
/*
struct boot_image *next;
CHAR16 label[MAX_STRING];
CHAR16 kname[FILENAME_MAXLEN];
- CHAR16 options[MAX_STRING];
+ CHAR16 options[CMDLINE_MAXLEN];
CHAR16 initrd[FILENAME_MAXLEN];
CHAR16 vmcode[FILENAME_MAXLEN];
CHAR16 root[FILENAME_MAXLEN];
CHAR16 root[FILENAME_MAXLEN]; /* globally defined root fs */
CHAR16 initrd[FILENAME_MAXLEN];/* globally defined initrd */
CHAR16 vmcode[FILENAME_MAXLEN];/* globally defined boot-time module */
- CHAR16 options[MAX_STRING];
+ CHAR16 options[CMDLINE_MAXLEN];
CHAR16 default_image_name[MAX_STRING];
CHAR16 message_file[MAX_MESSAGES][FILENAME_MAXLEN];
CHAR16 chooser[FILENAME_MAXLEN];/* which image chooser to use */
back = 0;
return ch;
}
- return getc();
+/*
+ * config files served from pxe/tftpboot windows servers can contain
+ * extraneous '\r' characters, often the first char in the file, and
+ * we need to simply skip over those and continue on
+ */
+ ch = getc();
+ if(ch == '\r')
+ ch = getc();
+
+ return ch;
}
/*
CHAR16 *here;
for (;;) {
- while ((ch = next()), ch == ' ' || ch == '\t' || ch == '\n') if (ch == '\n') line_num++;
+ while ((ch = next()), ch == ' ' || ch == '\t' || ch == '\n') if (ch == '\n' ) line_num++;
if (ch == CHAR_EOF) return TOK_EOF;
+ /* skip comment line */
if (ch != '#') break;
- /* skip comment line */
while ((ch = next()), ch != '\n') if (ch == CHAR_EOF) return TOK_EOF;
line_num++;
}
if (tok == TOK_EOF) break;
- if (tok == TOK_ERR) return -1;
+ if (tok == TOK_ERR) {
+ Print(L"Bad Token from elilo config file, parser read: %s\n elilo exiting\n", str);
+ return -1;
+ }
if ( (p = find_option(current_options, str)) == NULL) {
config_error(L"Unkown option %s", str);
{
boot_image_t *img, *dfl = global_config.default_image;
- if (dfl) Print(L"\t%s\n", dfl->label);
+ if (dfl) Print(L" %s\n", dfl->label);
for (img = image_list; img; img = img->next) {
- if (img != dfl) Print(L"\t%s\n", img->label);
+ if (img != dfl) Print(L" %s\n", img->label);
}
}