Stephane Eranian 2005-12-06 08:21:36 -05:00 committed by Vincent Batts
parent cb533a5de5
commit 6a4d7e49dc
29 changed files with 523 additions and 1389 deletions

View file

@ -28,7 +28,7 @@
#include "elilo.h"
#define MAX_LABELS 16
#define MAX_LABELS 64
#define MSGBUFLEN 4096
static UINT8 msgbuf[MSGBUFLEN];
@ -358,6 +358,7 @@ textmenu_choose(CHAR16 **argv, INTN argc, INTN index, CHAR16 *kname, CHAR16 *cmd
# define BOOT_IMG_STR L"BOOT_IMAGE="
CHAR16 label[CMDLINE_MAXLEN];
CHAR16 initrd_name[CMDLINE_MAXLEN];
CHAR16 vmcode_name[CMDLINE_MAXLEN];
CHAR16 args[CMDLINE_MAXLEN];
CHAR16 devname[CMDLINE_MAXLEN];
CHAR16 dpath[FILENAME_MAXLEN];
@ -412,16 +413,16 @@ restart:
* still be modified by global options in the config file.
*/
if (label[0])
ret = find_label(label, kname, args, initrd_name);
ret = find_label(label, kname, args, initrd_name, vmcode_name);
else
ret = find_label(argv[index], kname, args, initrd_name);
ret = find_label((index < argc) ? argv[index] : NULL, kname, args, initrd_name, vmcode_name);
/*
* not found, so assume first argument is kernel name and
* not label name
*/
if (ret == -1) {
if (argv[index])
if ((index < argc) && argv[index])
StrCpy(kname, argv[index]);
else
StrCpy(kname, elilo_opt.default_kernel);
@ -448,9 +449,14 @@ restart:
StrCpy(elilo_opt.initrd, initrd_name);
}
if (elilo_opt.vmcode[0] == CHAR_NULL && vmcode_name[0] != CHAR_NULL) {
StrCpy(elilo_opt.vmcode, vmcode_name);
}
VERB_PRT(1, { Print(L"kernel is '%s'\n", kname);
Print(L"arguments are '%s'\n", args);
if (elilo_opt.initrd[0]) Print(L"initrd is '%s'\n", elilo_opt.initrd);
if (elilo_opt.vmcode[0]) Print(L"vmm is '%s'\n", elilo_opt.vmcode);
});
if (elilo_opt.prompt == 0) {
@ -494,6 +500,7 @@ restart:
len = StrLen(BOOT_IMG_STR) /* BOOT_IMAGE= */
+StrLen(devname) /* device name */
+StrLen(kname) /* kernel name */
+elilo_opt.vmcode[0] ? StrLen(elilo_opt.vmcode) : StrLen(kname)
+1 /* space */
+StrLen(args); /* args length */
@ -505,7 +512,10 @@ restart:
}
StrCpy(cmdline, L"BOOT_IMAGE=");
StrCat(cmdline, devname);
StrCat(cmdline, kname);
if (elilo_opt.vmcode[0])
StrCat(cmdline, elilo_opt.vmcode);
else
StrCat(cmdline, kname);
StrCat(cmdline, L" ");
StrCat(cmdline, args);