support subpartition hints

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-13 12:16:22 +02:00
parent 53d4ca1afc
commit 1f1dd48a17
3 changed files with 68 additions and 11 deletions

View file

@ -38,7 +38,8 @@ static const struct grub_arg_option options[] =
N_("Set a variable to the first device found."), "VAR", ARG_TYPE_STRING},
{"no-floppy", 'n', 0, N_("Do not probe any floppy drive."), 0, 0},
{"hint", 'h', GRUB_ARG_OPTION_REPEATABLE,
N_("First try the device HINT"), N_("HINT"), ARG_TYPE_STRING},
N_("First try the device HINT. If HINT ends in comma, "
"also try subpartitions"), N_("HINT"), ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
@ -71,13 +72,13 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
if (state[SEARCH_LABEL].set)
grub_search_label (args[0], var, state[SEARCH_NO_FLOPPY].set,
(const char **) state[SEARCH_HINT].args, nhints);
state[SEARCH_HINT].args, nhints);
else if (state[SEARCH_FS_UUID].set)
grub_search_fs_uuid (args[0], var, state[SEARCH_NO_FLOPPY].set,
(const char **) state[SEARCH_HINT].args, nhints);
state[SEARCH_HINT].args, nhints);
else if (state[SEARCH_FILE].set)
grub_search_fs_file (args[0], var, state[SEARCH_NO_FLOPPY].set,
(const char **) state[SEARCH_HINT].args, nhints);
state[SEARCH_HINT].args, nhints);
else
return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");