/* Lookup the "misc" partition from argv[2] and argv[3] */
if (part_get_info_by_dev_and_name_or_num(argv[2], argv[3],
- &dev_desc, &part_info) < 0) {
+ &dev_desc, &part_info,
+ false) < 0) {
return CMD_RET_FAILURE;
}
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
const char *dev_part_str,
struct blk_desc **dev_desc,
- struct disk_partition *part_info)
+ struct disk_partition *part_info,
+ int allow_whole_dev)
{
int ret;
* directly.
*/
ret = blk_get_device_part_str(dev_iface, dev_part_str,
- dev_desc, part_info, 1);
+ dev_desc, part_info, allow_whole_dev);
if (ret < 0)
printf("Couldn't find partition %s %s\n",
dev_iface, dev_part_str);
* @param[in] dev_part_str Input partition description, like "0#misc" or "0:1"
* @param[out] dev_desc Place to store the device description pointer
* @param[out] part_info Place to store the partition information
+ * @param[in] allow_whole_dev true to allow the user to select partition 0
+ * (which means the whole device), false to require a valid
+ * partition number >= 1
* @return 0 on success, or a negative on error
*/
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
const char *dev_part_str,
struct blk_desc **dev_desc,
- struct disk_partition *part_info);
+ struct disk_partition *part_info,
+ int allow_whole_dev);
/**
* part_set_generic_name() - create generic partition like hda1 or sdb2