2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
4 * made from cmd_ext2, which was:
7 * esd gmbh <www.esd-electronics.com>
8 * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
10 * made from cmd_reiserfs by
12 * (C) Copyright 2003 - 2004
13 * Sysgo Real-Time Solutions, AG <www.elinos.com>
14 * Pavel Bartusek <pba@sysgo.com>
16 * See file CREDITS for list of people who contributed to this
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License as
21 * published by the Free Software Foundation; either version 2 of
22 * the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
39 #ifndef CONFIG_PARTITION_UUIDS
40 #error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_PART to be enabled
43 int do_part_uuid(int argc, char * const argv[])
46 block_dev_desc_t *dev_desc;
47 disk_partition_t info;
54 part = get_device_and_partition(argv[0], argv[1], &dev_desc, &info, 0);
59 setenv(argv[2], info.uuid);
61 printf("%s\n", info.uuid);
66 int do_part_list(int argc, char * const argv[])
69 block_dev_desc_t *desc;
74 ret = get_device(argv[0], argv[1], &desc);
83 int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
88 if (!strcmp(argv[1], "uuid"))
89 return do_part_uuid(argc - 2, argv + 2);
90 else if (!strcmp(argv[1], "list"))
91 return do_part_list(argc - 2, argv + 2);
98 "disk partition related commands",
99 "uuid <interface> <dev>:<part>\n"
100 " - print partition UUID\n"
101 "part uuid <interface> <dev>:<part> <varname>\n"
102 " - set environment variable to partition UUID\n"
103 "part list <interface> <dev>\n"
104 " - print a device's partition table"