Print this page
12743 man page spelling mistakes
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3ext/efi_alloc_and_init.3ext.man.txt
+++ new/usr/src/man/man3ext/efi_alloc_and_init.3ext.man.txt
1 1 EFI_ALLOC_AND_INIT(3EXT) Extended Library Functions EFI_ALLOC_AND_INIT(3EXT)
2 2
3 3
4 4
5 5 NAME
6 6 efi_alloc_and_init, efi_alloc_and_read, efi_free, efi_write,
7 7 efi_use_whole_disk, efi_reserved_sectors - manipulate a disk's EFI
8 8 Partition Table
9 9
10 10 SYNOPSIS
11 11 cc [ flag ... ] file... -lefi [ library ... ]
12 12 #include <sys/vtoc.h>
13 13 #include <sys/efi_partition.h>
14 14
15 15 int efi_alloc_and_init(int fd, uint32_t nparts, dk_gpt_t **vtoc);
16 16
17 17
18 18 int efi_alloc_and_read(int fd, dk_gpt_t **vtoc);
19 19
20 20
21 21 void efi_free(dk_gpt_t *vtoc);
22 22
23 23
24 24 int efi_write(int fd, dk_gpt_t *vtoc);
25 25
26 26
27 27 int efi_use_whole_disk(int fd);
28 28
29 29
30 30 uint_t efi_reserved_sectors(dk_gpt_t *vtoc);
31 31
32 32
33 33 DESCRIPTION
34 34 The efi_alloc_and_init() function initializes the dk_gpt_t structure
35 35 specified by vtoc in preparation for a call to efi_write(). It
36 36 calculates and initializes the efi_version, efi_lbasize, efi_nparts,
37 37 efi_first_u_lba, efi_last_lba, and efi_last_u_lba members of this
38 38 structure. The caller can then set the efi_nparts member.
39 39
40 40
41 41 The efi_alloc_and_read() function allocates memory and returns the
42 42 partition table.
43 43
44 44
45 45 The efi_free() function frees the memory allocated by
46 46 efi_alloc_and_init() and efi_alloc_and_read().
47 47
48 48
49 49 The efi_write() function writes the EFI partition table and creates a
50 50 Protective Master Boot Record (PMBR); see below.
51 51
52 52
53 53 The efi_use_whole_disk() function takes any space that is not contained
54 54 in the disk label and adds it to the last physically non-zero area
55 55 before the reserved slice (from slice 0 to slice 6 or unallocated
56 56 space).
57 57
58 58
59 59 The efi_reserved_sectors() function calculates number of sectors needed
60 60 to create the reserved partition. The reserved partition is used by the
61 61 operating system for internal purposes. The sector size used is based
62 62 on the device and is recorded in the efi_lbasize member of the dkgpt_t
63 63 structure indicated by the vtoc argument. A full description of the
64 64 dk_gpt_t structure appears later in the manual.
65 65
66 66
67 67 The fd argument refers to any slice on a raw disk, opened with
68 68 O_NDELAY. See open(2).
69 69
70 70
71 71 The nparts argument specifies the number of desired partitions.
72 72
73 73
74 74 The vtoc argument is a dk_gpt_t structure that describes an EFI
75 75 partition table and contains at least the following members:
76 76
77 77 uint_t efi_version; /* set to EFI_VERSION_CURRENT */
↓ open down ↓ |
77 lines elided |
↑ open up ↑ |
78 78 uint_t efi_nparts; /* no. of partitions in efi_parts */
79 79 uint_t efi_lbasize; /* size of block in bytes */
80 80 diskaddr_t efi_last_lba; /* last block on the disk */
81 81 diskaddr_t efi_first_u_lba; /* first block after labels */
82 82 diskaddr_t efi_last_u_lba; /* last block before backup labels */
83 83 struct dk_part efi_parts[]; /* array of partitions */
84 84
85 85
86 86 Protective Master Boot Record
87 87 When a disk receives an EFI label, a protective MBR (PMBR) is also
88 - written containing a single partiton of type EEh and spanning the
88 + written containing a single partition of type EEh and spanning the
89 89 entire disk (up to the limit of what can be represented in an MBR). By
90 90 default that partition is placed in slot 0 of the PMBR and not marked
91 91 as active. Some BIOS implementations contain bugs that require the
92 92 entry to be placed into a different slot or to be made active in order
93 93 for the system to boot successfully. The default behaviour is modified
94 94 for systems with known firmware bugs, refer to
95 95 /usr/share/hwdata/efi.fixes for more information.
96 96
97 97
98 98 RETURN VALUES
99 99 Upon successful completion, efi_alloc_and_init() returns 0. Otherwise
100 100 it returns VT_EIO if an I/O operation to the disk fails.
101 101
102 102
103 103 Upon successful completion, efi_alloc_and_read() returns a positive
104 104 integer indicating the slice index associated with the open file
105 105 descriptor. Otherwise, it returns a negative integer to indicate one
106 106 of the following:
107 107
108 108 VT_EIO
109 109 An I/O error occurred.
110 110
111 111
112 112 VT_ERROR
113 113 An unknown error occurred.
114 114
115 115
116 116 VT_EINVAL
117 117 An EFI label was not found.
118 118
119 119
120 120
121 121 The efi_reserved_sectors() function always returns the number of
122 122 reserved sectors required. It will always succeed.
123 123
124 124
125 125
126 126 Upon successful completion, efi_write() returns 0. Otherwise, it
127 127 returns a negative integer to indicate one of the following:
128 128
129 129 VT_EIO
130 130 An I/O error occurred.
131 131
132 132
133 133 VT_ERROR
134 134 An unknown error occurred.
135 135
136 136
137 137 VT_EINVAL
138 138 The label contains incorrect data.
139 139
140 140
141 141
142 142 Upon successfully completion, efi_use_whole_disk() returns 0.
143 143 Otherwise, it returns a negative integer to indicate one of the
144 144 following:
145 145
146 146 VT_EIO
147 147 An I/O error occurred.
148 148
149 149
150 150 VT_ERROR
151 151 An unknown error occurred.
152 152
153 153
154 154 VT_EINVAL
155 155 The label contains incorrect data.
156 156
157 157
158 158 VT_ENOSPC
159 159 Space out of label was not found.
160 160
161 161
162 162 USAGE
163 163 The EFI label is used on disks with more than 1^32-1 blocks. For
164 164 compatibility reasons, the read_vtoc(3EXT) and write_vtoc() functions
165 165 should be used on smaller disks. The application should attempt the
166 166 read_vtoc() or write_vtoc() call, check for an error of VT_ENOTSUP,
167 167 then call the analogous EFI function.
168 168
169 169 ATTRIBUTES
170 170 See attributes(5) for descriptions of the following attributes:
171 171
172 172
173 173
174 174
175 175 +--------------------+-----------------+
176 176 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
177 177 +--------------------+-----------------+
178 178 |Interface Stability | Committed |
↓ open down ↓ |
80 lines elided |
↑ open up ↑ |
179 179 +--------------------+-----------------+
180 180 |MT-Level | Unsafe |
181 181 +--------------------+-----------------+
182 182
183 183 SEE ALSO
184 184 fmthard(1M), format(1M), prtvtoc(1M), ioctl(2), open(2), libefi(3LIB),
185 185 read_vtoc(3EXT), attributes(5), dkio(7I)
186 186
187 187
188 188
189 - November 20, 2019 EFI_ALLOC_AND_INIT(3EXT)
189 + May 16, 2020 EFI_ALLOC_AND_INIT(3EXT)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX