--- eli/eli.c.imagename Fri Aug 18 16:35:38 2000 +++ eli/eli.c Fri Aug 18 19:20:04 2000 @@ -69,7 +70,7 @@ UINT64 initrd_size; }; -#define MAX_IMAGE_NAME 15 +#define MAX_IMAGE_NAME 1024 struct boot_image { struct boot_image *next; @@ -989,7 +990,7 @@ Print(W2U(L"\n")); for (timage = image_head; timage; timage = timage->next) { - Print(W2U(L"%-*s "), MAX_IMAGE_NAME, timage->label); + Print(W2U(L"%s "), timage->label); if ((i % 3) == 2) Print(W2U(L"\n")); i++; @@ -1014,14 +1015,14 @@ case CHAR_CARRIAGE_RETURN: { struct boot_image *timage; - + int x; + if (!imagename[0]) { Print(W2U(L"\n")); return default_image; } - - + /* Attempt to find the image name now */ for (timage = image_head; timage; timage = timage->next) { if (StriCmp(timage->label, imagename) == 0) { @@ -1031,6 +1032,24 @@ } } + /* Perhaps they added some arguments? */ + for (x = 0; imagename[x] && x < MAX_IMAGE_NAME; x++) { + if (imagename[x] == L' ') { + imagename[x] = 0; + for (timage = image_head; timage; timage = timage->next) { + if (StriCmp(timage->label, imagename) == 0) { + + StrCat(args, W2U(L" ")); + StrCat(args,imagename+x+1); + Print(W2U(L"\n")); + return timage; + } + } + imagename[x] = L' '; + break; + } + } + Print(W2U(L"\n\nUnknown image %s\n\nboot: "), imagename); @@ -1095,7 +1113,7 @@ struct allocated_memory kernel, initrd, new_systab; UINTN argc; CHAR16 *argv[MAX_ARGS]; - struct boot_image *boot_image = NULL; + struct boot_image *boot_image = NULL, *tmp_image; struct acpi_op *acpi_root = NULL; UINTN cookie; struct vector *vectors; @@ -1169,15 +1187,24 @@ if (boot_image) StrCpy(kernel_name, boot_image->filename); } + + /* If they passed us an image name, use that instead */ + if (!boot_image) + for (tmp_image = image_head; tmp_image; tmp_image = tmp_image->next) { + if (StriCmp(tmp_image->label, kernel_name) == 0) { + boot_image = tmp_image; + StrCpy(kernel_name, boot_image->filename); + } + } if (!kernel_name[0]) { Print(W2U(L"eli: no kernel to boot!\n")); goto free_acpi; } - + /* Setup the arguments to the kernel from the info on the command */ /* line and configuration file */ - if (!args[0]) { + if (!args[0] || boot_image) { INT8 ro = -1; if (boot_image && boot_image->root) {