/*
* Copyright (C) 2001-2003 Hewlett-Packard Co.
* Contributed by Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 2006-2009 Intel Corporation
+ * Contributed by Fenghua Yu <fenghua.yu@intel.com>
+ * Contributed by Bibo Mao <bibo.mao@intel.com>
+ * Contributed by Chandramouli Narayanan <mouli@linux.intel.com>
*
* This file is part of the ELILO, the EFI Linux boot loader.
*
{
CHAR16 *desc;
CHAR16 initrd_name[CMDLINE_MAXLEN];
+ CHAR16 vmcode_name[CMDLINE_MAXLEN];
CHAR16 options_tmp[CMDLINE_MAXLEN];
CHAR16 options[CMDLINE_MAXLEN];
CHAR16 kname[FILENAME_MAXLEN];
Print(L"desc : %s\n", desc);
}
- initrd_name[0] = options_tmp[0] = kname[0] = CHAR_NULL;
+ initrd_name[0] = vmcode_name[0] = options_tmp[0] = kname[0] = CHAR_NULL;
- if (find_label(name, kname, options_tmp, initrd_name) == -1) {
+ if (find_label(name, kname, options_tmp, initrd_name, vmcode_name) == -1) {
StrCpy(kname, name);
Print(L"\n");
}
Print(L"cmdline: %s %s\n", kname, options);
if (initrd_name[0]) Print(L"initrd : %s\n", initrd_name);
+ if (vmcode_name[0]) Print(L"vmcode : %s\n", vmcode_name);
}
static VOID
first_time = 0;
for (;;) {
- while ((status=ip->ReadKeyStroke(ip, &key)) == EFI_NOT_READY);
+ while ((status = uefi_call_wrapper(ip->ReadKeyStroke, 2, ip, &key))
+ == EFI_NOT_READY);
if (EFI_ERROR(status)) {
ERR_PRT((L"select_kernel readkey: %r", status));
return -1;
{
fops_fd_t fd;
EFI_STATUS status;
- INTN len, i;
+ UINTN len, i;
CHAR16 *filename;
CHAR8 buf[256];
CHAR16 buffer[CMDLINE_MAXLEN];
CHAR16 alt_buffer[CMDLINE_MAXLEN];
CHAR16 initrd_name[CMDLINE_MAXLEN];
+ CHAR16 vmcode_name[CMDLINE_MAXLEN];
CHAR16 args[CMDLINE_MAXLEN];
CHAR16 devname[CMDLINE_MAXLEN];
CHAR16 dpath[FILENAME_MAXLEN];
display_message();
restart:
- initrd_name[0] = kname[0] = cmdline[0] = args[0] = CHAR_NULL;
+ initrd_name[0] = vmcode_name[0] = kname[0] = cmdline[0] = args[0] = CHAR_NULL;
/* reset per image loader options */
Memset(&elilo_opt.img_opt, 0, sizeof(elilo_opt.img_opt));
argc = argify(alt_buffer,sizeof(alt_buffer), argv);
alt_argv = argv;
index = 0;
- args[0] = initrd_name[0] = 0;
+ args[0] = initrd_name[0] = vmcode_name[0] = 0;
/*
* don't check twice because the variable is deleted after
* first access
* if no match is found, the args and initrd arguments may
* still be modified by global options in the config file.
*/
- 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);
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) {
ret = wait_timeout(elilo_opt.delay);
if (ret != 0) {
elilo_opt.prompt = 1;
+ elilo_opt.initrd[0] = elilo_opt.vmcode[0] = CHAR_NULL;
elilo_opt.timeout = ELILO_TIMEOUT_INFINITY;
goto restart;
}
*/
len = StrLen(BOOT_IMG_STR) /* BOOT_IMAGE= */
+StrLen(devname) /* device name */
- +StrLen(kname) /* kernel name */
+ /* kernel name */
+ +elilo_opt.vmcode[0] ? StrLen(elilo_opt.vmcode) : StrLen(kname)
+1 /* space */
+StrLen(args); /* args length */
}
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);