blob: ed464b180bbaab9aa786a4f38443566cdc10b250 [file] [log] [blame]
Enric Balletbo i Serraff6ef4b2023-01-10 17:19:32 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
3part command
4===============
5
6Synopis
7-------
8
9::
10
11 part uuid <interface> <dev>:<part> [varname]
12 part list <interface> <dev> [flags] [varname]
13 part start <interface> <dev> <part> <varname>
14 part size <interface> <dev> <part> <varname>
15 part number <interface> <dev> <part> <varname>
16 part types
17
18Description
19-----------
20
21The `part` command is used to manage disk partition related commands.
22
23The 'part uuid' command prints or sets an environment variable to partition UUID
24
25 interface
26 interface for accessing the block device (mmc, sata, scsi, usb, ....)
27 dev
28 device number
29 part
30 partition number
31 varname
32 an optional environment variable to store the current partition UUID value into.
33
34The 'part list' command prints or sets an environment variable to the list of partitions
35
36 interface
37 interface for accessing the block device (mmc, sata, scsi, usb, ....)
38 dev
39 device number
40 part
41 partition number
42 flags
43 -bootable
44 lists only bootable partitions
45 varname
46 an optional environment variable to store the list of partitions value into.
47
48The 'part start' commnad sets an environment variable to the start of the partition (in blocks),
49part can be either partition number or partition name.
50
51 interface
52 interface for accessing the block device (mmc, sata, scsi, usb, ....)
53 dev
54 device number
55 part
56 partition number
57 varname
58 a variable to store the current start of the partition value into.
59
60The 'part size' command sets an environment variable to the size of the partition (in blocks),
61part can be either partition number or partition name.
62
63 interface
64 interface for accessing the block device (mmc, sata, scsi, usb, ....)
65 dev
66 device number
67 part
68 partition number
69 varname
70 a variable to store the current size of the partition value into.
71
72The 'part number' command sets an environment variable to the partition number using the partition name,
73part must be specified as partition name.
74
75 interface
76 interface for accessing the block device (mmc, sata, scsi, usb, ....)
77 dev
78 device number
79 part
80 partition number
81 varname
82 a variable to store the current partition number value into
83
84The 'part types' command list supported partition table types.
85
86Examples
87--------
88
89::
90
91 => host bind 0 ./test_gpt_disk_image.bin
92 => part uuid host 0:1
93 24156b69-3378-497f-bb3e-b982223de528
94 => part uuid host 0:1 varname
95 => env print varname
96 varname=24156b69-3378-497f-bb3e-b982223de528
97 =>
98 => part list host 0
99
100 Partition Map for HOST device 0 -- Partition Type: EFI
101
102 Part Start LBA End LBA Name
103 Attributes
104 Type GUID
105 Partition GUID
106 1 0x00000800 0x00000fff "second"
107 attrs: 0x0000000000000000
108 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
109 (data)
110 guid: 24156b69-3378-497f-bb3e-b982223de528
111 2 0x00001000 0x00001bff "first"
112 attrs: 0x0000000000000000
113 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
114 (data)
115 guid: 5272ee44-29ab-4d46-af6c-4b45ac67d3b7
116 =>
117 => part start host 0 2 varname
118 => env print varname
119 varname=1000
120 =>
121 => part size host 0 2 varname
122 => env print varname
123 varname=c00
124 =>
125 => part number host 0 2 varname
126 => env print varname
127 varname=0x2
128 =>
129 => part types
130 Supported partition tables: EFI, AMIGA, DOS, ISO, MAC
131
132Return value
133------------
134
135The return value $? is set to 0 (true) if the command succededd. If an
136error occurs, the return value $? is set to 1 (false).