diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 1 | ||||
-rw-r--r-- | cmd/event.c | 2 | ||||
-rw-r--r-- | cmd/part.c | 35 |
3 files changed, 37 insertions, 1 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index b2aefae9cb7..4fe2c75de25 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2622,6 +2622,7 @@ config CMD_DIAG config CMD_EVENT bool "event - Show information about events" + depends on EVENT default y if EVENT_DEBUG help This enables the 'event' command which provides information about diff --git a/cmd/event.c b/cmd/event.c index 9cac2023530..b4b779ffac0 100644 --- a/cmd/event.c +++ b/cmd/event.c @@ -20,7 +20,7 @@ static int do_event_list(struct cmd_tbl *cmdtp, int flag, int argc, #ifdef CONFIG_SYS_LONGHELP static char event_help_text[] = - "event list - list event spies"; + "list - list event spies"; #endif U_BOOT_CMD_WITH_SUBCMDS(event, "Events", event_help_text, diff --git a/cmd/part.c b/cmd/part.c index 9d419c967cb..28f2b7ff9bb 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -182,6 +182,31 @@ static int do_part_number(int argc, char *const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); } +#ifdef CONFIG_PARTITION_TYPE_GUID +static int do_part_type(int argc, char *const argv[]) +{ + int part; + struct blk_desc *dev_desc; + struct disk_partition info; + + if (argc < 2) + return CMD_RET_USAGE; + if (argc > 3) + return CMD_RET_USAGE; + + part = blk_get_device_part_str(argv[0], argv[1], &dev_desc, &info, 0); + if (part < 0) + return 1; + + if (argc > 2) + env_set(argv[2], info.type_guid); + else + printf("%s\n", info.type_guid); + + return 0; +} +#endif + static int do_part_types(int argc, char * const argv[]) { struct part_driver *drv = ll_entry_start(struct part_driver, @@ -220,6 +245,10 @@ static int do_part(struct cmd_tbl *cmdtp, int flag, int argc, return do_part_number(argc - 2, argv + 2); else if (!strcmp(argv[1], "types")) return do_part_types(argc - 2, argv + 2); +#ifdef CONFIG_PARTITION_TYPE_GUID + else if (!strcmp(argv[1], "type")) + return do_part_type(argc - 2, argv + 2); +#endif return CMD_RET_USAGE; } @@ -244,6 +273,12 @@ U_BOOT_CMD( "part number <interface> <dev> <part> <varname>\n" " - set environment variable to the partition number using the partition name\n" " part must be specified as partition name\n" +#ifdef CONFIG_PARTITION_TYPE_GUID + "part type <interface> <dev>:<part>\n" + " - print partition type\n" +#endif + "part type <interface> <dev>:<part> <varname>\n" + " - set environment variable to partition type\n" "part types\n" " - list supported partition table types" ); |