bdpart
1# This file was automatically generated by SWIG (https://www.swig.org). 2# Version 4.2.1 3# 4# Do not make changes to this file unless you know what you are doing - modify 5# the SWIG interface file instead. 6 7from sys import version_info as _swig_python_version_info 8from mock_rtems import _bdpart as _bdpart 9 10try: 11 import builtins as __builtin__ 12except ImportError: 13 import __builtin__ 14 15def _swig_repr(self): 16 try: 17 strthis = "proxy of " + self.this.__repr__() 18 except __builtin__.Exception: 19 strthis = "" 20 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 21 22 23def _swig_setattr_nondynamic_instance_variable(set): 24 def set_instance_attr(self, name, value): 25 if name == "this": 26 set(self, name, value) 27 elif name == "thisown": 28 self.this.own(value) 29 elif hasattr(self, name) and isinstance(getattr(type(self), name), property): 30 set(self, name, value) 31 else: 32 raise AttributeError("You cannot add instance attributes to %s" % self) 33 return set_instance_attr 34 35 36def _swig_setattr_nondynamic_class_variable(set): 37 def set_class_attr(cls, name, value): 38 if hasattr(cls, name) and not isinstance(getattr(cls, name), property): 39 set(cls, name, value) 40 else: 41 raise AttributeError("You cannot add class attributes to %s" % cls) 42 return set_class_attr 43 44 45def _swig_add_metaclass(metaclass): 46 """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" 47 def wrapper(cls): 48 return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) 49 return wrapper 50 51 52class _SwigNonDynamicMeta(type): 53 """Meta class to enforce nondynamic attributes (no new attributes) for a class""" 54 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) 55 56 57RTEMS_BDPART_MBR_EMPTY = _bdpart.RTEMS_BDPART_MBR_EMPTY 58r"""**""" 59RTEMS_BDPART_MBR_FAT_12 = _bdpart.RTEMS_BDPART_MBR_FAT_12 60 61RTEMS_BDPART_MBR_FAT_16 = _bdpart.RTEMS_BDPART_MBR_FAT_16 62 63RTEMS_BDPART_MBR_FAT_16_LBA = _bdpart.RTEMS_BDPART_MBR_FAT_16_LBA 64 65RTEMS_BDPART_MBR_FAT_32 = _bdpart.RTEMS_BDPART_MBR_FAT_32 66 67RTEMS_BDPART_MBR_FAT_32_LBA = _bdpart.RTEMS_BDPART_MBR_FAT_32_LBA 68 69RTEMS_BDPART_MBR_EXTENDED = _bdpart.RTEMS_BDPART_MBR_EXTENDED 70 71RTEMS_BDPART_MBR_DATA = _bdpart.RTEMS_BDPART_MBR_DATA 72 73RTEMS_BDPART_MBR_GPT = _bdpart.RTEMS_BDPART_MBR_GPT 74 75RTEMS_BDPART_MBR_FLAG_ACTIVE = _bdpart.RTEMS_BDPART_MBR_FLAG_ACTIVE 76 77RTEMS_BDPART_PARTITION_NUMBER_HINT = _bdpart.RTEMS_BDPART_PARTITION_NUMBER_HINT 78r"""Recommended maximum partition table size.""" 79class rtems_bdpart_partition(object): 80 r"""Partition description.""" 81 82 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 83 __repr__ = _swig_repr 84 begin = property(_bdpart.rtems_bdpart_partition_begin_get, _bdpart.rtems_bdpart_partition_begin_set, doc=r"""Block index for partition begin.""") 85 end = property(_bdpart.rtems_bdpart_partition_end_get, _bdpart.rtems_bdpart_partition_end_set, doc=r"""Block index for partition end (this block is not a part of the partition).""") 86 type = property(_bdpart.rtems_bdpart_partition_type_get, _bdpart.rtems_bdpart_partition_type_set, doc=r"""Partition type.""") 87 id = property(_bdpart.rtems_bdpart_partition_id_get, _bdpart.rtems_bdpart_partition_id_set, doc=r"""Partition ID.""") 88 flags = property(_bdpart.rtems_bdpart_partition_flags_get, _bdpart.rtems_bdpart_partition_flags_set, doc=r"""Partition flags.""") 89 90 def __init__(self): 91 r"""__init__(rtems_bdpart_partition self) -> rtems_bdpart_partition""" 92 _bdpart.rtems_bdpart_partition_swiginit(self, _bdpart.new_rtems_bdpart_partition()) 93 __swig_destroy__ = _bdpart.delete_rtems_bdpart_partition 94 95# Register rtems_bdpart_partition in _bdpart: 96_bdpart.rtems_bdpart_partition_swigregister(rtems_bdpart_partition) 97RTEMS_BDPART_FORMAT_MBR = _bdpart.RTEMS_BDPART_FORMAT_MBR 98r"""Type value for MBR format.""" 99RTEMS_BDPART_FORMAT_GPT = _bdpart.RTEMS_BDPART_FORMAT_GPT 100r"""Type value for GPT format.""" 101class rtems_bdpart_format(object): 102 r"""Disk format description.""" 103 104 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 105 __repr__ = _swig_repr 106 type = property(_bdpart.rtems_bdpart_format_type_get, _bdpart.rtems_bdpart_format_type_set, doc=r"""Format type.""") 107 mbr = property(_bdpart.rtems_bdpart_format_mbr_get, doc=r"""mbr : rtems_bdpart_format_mbr""") 108 gpt = property(_bdpart.rtems_bdpart_format_gpt_get, doc=r"""gpt : rtems_bdpart_format_gpt""") 109 110 def __init__(self): 111 r"""__init__(rtems_bdpart_format self) -> rtems_bdpart_format""" 112 _bdpart.rtems_bdpart_format_swiginit(self, _bdpart.new_rtems_bdpart_format()) 113 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format 114 115# Register rtems_bdpart_format in _bdpart: 116_bdpart.rtems_bdpart_format_swigregister(rtems_bdpart_format) 117class rtems_bdpart_format_gpt(object): 118 r"""GPT format fields.""" 119 120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 121 __repr__ = _swig_repr 122 type = property(_bdpart.rtems_bdpart_format_gpt_type_get, _bdpart.rtems_bdpart_format_gpt_type_set, doc=r"""type : rtems_bdpart_format_type""") 123 disk_id = property(_bdpart.rtems_bdpart_format_gpt_disk_id_get, _bdpart.rtems_bdpart_format_gpt_disk_id_set, doc=r"""Disk ID in GPT header.""") 124 125 def __init__(self): 126 r"""__init__(rtems_bdpart_format_gpt self) -> rtems_bdpart_format_gpt""" 127 _bdpart.rtems_bdpart_format_gpt_swiginit(self, _bdpart.new_rtems_bdpart_format_gpt()) 128 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format_gpt 129 130# Register rtems_bdpart_format_gpt in _bdpart: 131_bdpart.rtems_bdpart_format_gpt_swigregister(rtems_bdpart_format_gpt) 132class rtems_bdpart_format_mbr(object): 133 r"""MBR format fields.""" 134 135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 136 __repr__ = _swig_repr 137 type = property(_bdpart.rtems_bdpart_format_mbr_type_get, _bdpart.rtems_bdpart_format_mbr_type_set, doc=r"""type : rtems_bdpart_format_type""") 138 disk_id = property(_bdpart.rtems_bdpart_format_mbr_disk_id_get, _bdpart.rtems_bdpart_format_mbr_disk_id_set, doc=r"""Disk ID in MBR at offset 440.""") 139 dos_compatibility = property(_bdpart.rtems_bdpart_format_mbr_dos_compatibility_get, _bdpart.rtems_bdpart_format_mbr_dos_compatibility_set, doc=r""" 140 This option is used for partition table creation and validation checks 141 before a write to the disk. It ensures that the first primary 142 partition and the logical partitions start at head one and sector one 143 under the virtual one head and 63 sectors geometry. Each begin and 144 end of a partition will be aligned to the virtual cylinder boundary. 145 """) 146 147 def __init__(self): 148 r"""__init__(rtems_bdpart_format_mbr self) -> rtems_bdpart_format_mbr""" 149 _bdpart.rtems_bdpart_format_mbr_swiginit(self, _bdpart.new_rtems_bdpart_format_mbr()) 150 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format_mbr 151 152# Register rtems_bdpart_format_mbr in _bdpart: 153_bdpart.rtems_bdpart_format_mbr_swigregister(rtems_bdpart_format_mbr) 154 155def rtems_bdpart_read(disk_name, format, partitions, count): 156 r""" 157 Reads the partition information from the physical disk device with 158 name *disk_name*. 159 160 The partition information will be stored in the partition table 161 *partitions* with a maximum of *count* partitions. The number of actual 162 partitions will be stored in *count*. If there are more partitions than 163 space for storage an error status will be returned. The partition table 164 format recognized on the disk will be stored in *format*. 165 """ 166 return _bdpart.rtems_bdpart_read(disk_name, format, partitions, count) 167 168def rtems_bdpart_sort(partitions, count): 169 r""" 170 Sorts the partition table *partitions* with *count* partitions to 171 have ascending begin blocks 172 """ 173 return _bdpart.rtems_bdpart_sort(partitions, count) 174 175def rtems_bdpart_write(disk_name, format, partitions, count): 176 r""" 177 Writes the partition table to the physical disk device with name 178 *disk_name*. 179 180 The partition table *partitions* with *count* partitions will be written 181 to the disk. The output format for the partition table on the disk is 182 specified by *format*. There are some consistency checks applied to the 183 partition table. The partition table must be sorted such that the begin 184 blocks are in ascending order. This can be done with the 185 rtems_bdpart_sort() function. The partitions must not overlap. The 186 partitions must have a positive size. The partitions must be within the 187 disk. Depending on the output format there are additional constrains. 188 """ 189 return _bdpart.rtems_bdpart_write(disk_name, format, partitions, count) 190 191def rtems_bdpart_create(disk_name, format, partitions, distribution, count): 192 r""" 193 Creates a partition table in *partitions* with *count* partitions 194 for the physical disk device with name *disk_name*. 195 196 The array of positive integer weights in *distribution* must have exactly 197 *count* elements. The weights in the distribution array are summed up. 198 Each weight is then divided by the sum to obtain the disk fraction which 199 forms the corresponding partition. The partition boundaries are generated 200 with respect to the output format in *format*. 201 """ 202 return _bdpart.rtems_bdpart_create(disk_name, format, partitions, distribution, count) 203 204def rtems_bdpart_register(disk_name, partitions, count): 205 r""" 206 Registers the partitions as logical disks for the physical disk 207 device with name *disk_name*. 208 209 For each partition of the partition table *partitions* with *count* 210 partitions a logical disk is registered. The partition number equals the 211 partition table index plus one. The name of the logical disk device is the 212 concatenation of the physical disk device name and the partition number. 213 214 See also: rtems_blkdev_create_partition(). 215 """ 216 return _bdpart.rtems_bdpart_register(disk_name, partitions, count) 217 218def rtems_bdpart_register_from_disk(disk_name): 219 r""" 220 *brief* Reads the partition table from the disk device with name 221 *disk_name* and registers the partitions as logical disks. 222 223 See also: rtems_bdpart_register() and rtems_fsmount(). 224 """ 225 return _bdpart.rtems_bdpart_register_from_disk(disk_name) 226 227def rtems_bdpart_unregister(disk_name, partitions, count): 228 r""" 229 Deletes the logical disks associated with the partitions of the disk 230 device with name *disk_name*. 231 232 The partition table *partitions* with *count* partitions will be used to 233 determine which disks need to be deleted. It may be obtained from 234 rtems_bdpart_read(). 235 """ 236 return _bdpart.rtems_bdpart_unregister(disk_name, partitions, count) 237 238def rtems_bdpart_dump(partitions, count): 239 r""" 240 Prints the partition table *partitions* with *count* partitions to 241 standard output. 242 """ 243 return _bdpart.rtems_bdpart_dump(partitions, count) 244 245def rtems_bdpart_to_partition_type(mbr_type, type): 246 r""" 247 Returns the partition type for the MBR partition type value 248 *mbr_type* in *type*. 249 """ 250 return _bdpart.rtems_bdpart_to_partition_type(mbr_type, type) 251 252def rtems_bdpart_to_mbr_partition_type(type, mbr_type): 253 r""" 254 Converts the partition type in *type* to the MBR partition type. 255 256 The result will be stored in *mbr_type*. Returns ``true`` in case of a 257 successful convertion and otherwise ``false``. Both arguments must not be 258 ``NULL``. 259 """ 260 return _bdpart.rtems_bdpart_to_mbr_partition_type(type, mbr_type) 261RTEMS_BDPART_MBR_CYLINDER_SIZE = _bdpart.RTEMS_BDPART_MBR_CYLINDER_SIZE 262 263RTEMS_BDPART_NUMBER_SIZE = _bdpart.RTEMS_BDPART_NUMBER_SIZE 264 265RTEMS_BDPART_BLOCK_SIZE = _bdpart.RTEMS_BDPART_BLOCK_SIZE 266 267RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE = _bdpart.RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE 268 269RTEMS_BDPART_MBR_OFFSET_TABLE_0 = _bdpart.RTEMS_BDPART_MBR_OFFSET_TABLE_0 270 271RTEMS_BDPART_MBR_OFFSET_TABLE_1 = _bdpart.RTEMS_BDPART_MBR_OFFSET_TABLE_1 272 273RTEMS_BDPART_MBR_OFFSET_DISK_ID = _bdpart.RTEMS_BDPART_MBR_OFFSET_DISK_ID 274 275RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0 = _bdpart.RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0 276 277RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1 = _bdpart.RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1 278 279RTEMS_BDPART_MBR_SIGNATURE_0 = _bdpart.RTEMS_BDPART_MBR_SIGNATURE_0 280 281RTEMS_BDPART_MBR_SIGNATURE_1 = _bdpart.RTEMS_BDPART_MBR_SIGNATURE_1 282 283RTEMS_BDPART_MBR_OFFSET_BEGIN = _bdpart.RTEMS_BDPART_MBR_OFFSET_BEGIN 284 285RTEMS_BDPART_MBR_OFFSET_SIZE = _bdpart.RTEMS_BDPART_MBR_OFFSET_SIZE 286 287RTEMS_BDPART_MBR_OFFSET_TYPE = _bdpart.RTEMS_BDPART_MBR_OFFSET_TYPE 288 289RTEMS_BDPART_MBR_OFFSET_FLAGS = _bdpart.RTEMS_BDPART_MBR_OFFSET_FLAGS 290 291 292def rtems_bdpart_mbr_partition_type(type): 293 r""" 294 rtems_bdpart_mbr_partition_type(uuid_t const type) -> uint8_t 295 296 Parameters 297 ---------- 298 type: uuid_t const 299 300 """ 301 return _bdpart.rtems_bdpart_mbr_partition_type(type) 302 303def rtems_bdpart_get_disk_data(disk_name, fd_ptr, dd_ptr, disk_end): 304 r""" 305 rtems_bdpart_get_disk_data(char const * disk_name, int * fd_ptr, rtems_disk_device ** dd_ptr, rtems_blkdev_bnum * disk_end) -> rtems_status_code 306 307 Parameters 308 ---------- 309 disk_name: char const * 310 fd_ptr: int * 311 dd_ptr: rtems_disk_device ** 312 disk_end: rtems_blkdev_bnum * 313 314 """ 315 return _bdpart.rtems_bdpart_get_disk_data(disk_name, fd_ptr, dd_ptr, disk_end)
**
Recommended maximum partition table size.
80class rtems_bdpart_partition(object): 81 r"""Partition description.""" 82 83 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 84 __repr__ = _swig_repr 85 begin = property(_bdpart.rtems_bdpart_partition_begin_get, _bdpart.rtems_bdpart_partition_begin_set, doc=r"""Block index for partition begin.""") 86 end = property(_bdpart.rtems_bdpart_partition_end_get, _bdpart.rtems_bdpart_partition_end_set, doc=r"""Block index for partition end (this block is not a part of the partition).""") 87 type = property(_bdpart.rtems_bdpart_partition_type_get, _bdpart.rtems_bdpart_partition_type_set, doc=r"""Partition type.""") 88 id = property(_bdpart.rtems_bdpart_partition_id_get, _bdpart.rtems_bdpart_partition_id_set, doc=r"""Partition ID.""") 89 flags = property(_bdpart.rtems_bdpart_partition_flags_get, _bdpart.rtems_bdpart_partition_flags_set, doc=r"""Partition flags.""") 90 91 def __init__(self): 92 r"""__init__(rtems_bdpart_partition self) -> rtems_bdpart_partition""" 93 _bdpart.rtems_bdpart_partition_swiginit(self, _bdpart.new_rtems_bdpart_partition()) 94 __swig_destroy__ = _bdpart.delete_rtems_bdpart_partition
Partition description.
91 def __init__(self): 92 r"""__init__(rtems_bdpart_partition self) -> rtems_bdpart_partition""" 93 _bdpart.rtems_bdpart_partition_swiginit(self, _bdpart.new_rtems_bdpart_partition())
__init__(rtems_bdpart_partition self) -> rtems_bdpart_partition
83 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
Type value for MBR format.
Type value for GPT format.
102class rtems_bdpart_format(object): 103 r"""Disk format description.""" 104 105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 106 __repr__ = _swig_repr 107 type = property(_bdpart.rtems_bdpart_format_type_get, _bdpart.rtems_bdpart_format_type_set, doc=r"""Format type.""") 108 mbr = property(_bdpart.rtems_bdpart_format_mbr_get, doc=r"""mbr : rtems_bdpart_format_mbr""") 109 gpt = property(_bdpart.rtems_bdpart_format_gpt_get, doc=r"""gpt : rtems_bdpart_format_gpt""") 110 111 def __init__(self): 112 r"""__init__(rtems_bdpart_format self) -> rtems_bdpart_format""" 113 _bdpart.rtems_bdpart_format_swiginit(self, _bdpart.new_rtems_bdpart_format()) 114 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format
Disk format description.
111 def __init__(self): 112 r"""__init__(rtems_bdpart_format self) -> rtems_bdpart_format""" 113 _bdpart.rtems_bdpart_format_swiginit(self, _bdpart.new_rtems_bdpart_format())
__init__(rtems_bdpart_format self) -> rtems_bdpart_format
105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
118class rtems_bdpart_format_gpt(object): 119 r"""GPT format fields.""" 120 121 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 122 __repr__ = _swig_repr 123 type = property(_bdpart.rtems_bdpart_format_gpt_type_get, _bdpart.rtems_bdpart_format_gpt_type_set, doc=r"""type : rtems_bdpart_format_type""") 124 disk_id = property(_bdpart.rtems_bdpart_format_gpt_disk_id_get, _bdpart.rtems_bdpart_format_gpt_disk_id_set, doc=r"""Disk ID in GPT header.""") 125 126 def __init__(self): 127 r"""__init__(rtems_bdpart_format_gpt self) -> rtems_bdpart_format_gpt""" 128 _bdpart.rtems_bdpart_format_gpt_swiginit(self, _bdpart.new_rtems_bdpart_format_gpt()) 129 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format_gpt
GPT format fields.
126 def __init__(self): 127 r"""__init__(rtems_bdpart_format_gpt self) -> rtems_bdpart_format_gpt""" 128 _bdpart.rtems_bdpart_format_gpt_swiginit(self, _bdpart.new_rtems_bdpart_format_gpt())
__init__(rtems_bdpart_format_gpt self) -> rtems_bdpart_format_gpt
121 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
133class rtems_bdpart_format_mbr(object): 134 r"""MBR format fields.""" 135 136 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 137 __repr__ = _swig_repr 138 type = property(_bdpart.rtems_bdpart_format_mbr_type_get, _bdpart.rtems_bdpart_format_mbr_type_set, doc=r"""type : rtems_bdpart_format_type""") 139 disk_id = property(_bdpart.rtems_bdpart_format_mbr_disk_id_get, _bdpart.rtems_bdpart_format_mbr_disk_id_set, doc=r"""Disk ID in MBR at offset 440.""") 140 dos_compatibility = property(_bdpart.rtems_bdpart_format_mbr_dos_compatibility_get, _bdpart.rtems_bdpart_format_mbr_dos_compatibility_set, doc=r""" 141 This option is used for partition table creation and validation checks 142 before a write to the disk. It ensures that the first primary 143 partition and the logical partitions start at head one and sector one 144 under the virtual one head and 63 sectors geometry. Each begin and 145 end of a partition will be aligned to the virtual cylinder boundary. 146 """) 147 148 def __init__(self): 149 r"""__init__(rtems_bdpart_format_mbr self) -> rtems_bdpart_format_mbr""" 150 _bdpart.rtems_bdpart_format_mbr_swiginit(self, _bdpart.new_rtems_bdpart_format_mbr()) 151 __swig_destroy__ = _bdpart.delete_rtems_bdpart_format_mbr
MBR format fields.
148 def __init__(self): 149 r"""__init__(rtems_bdpart_format_mbr self) -> rtems_bdpart_format_mbr""" 150 _bdpart.rtems_bdpart_format_mbr_swiginit(self, _bdpart.new_rtems_bdpart_format_mbr())
__init__(rtems_bdpart_format_mbr self) -> rtems_bdpart_format_mbr
136 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
156def rtems_bdpart_read(disk_name, format, partitions, count): 157 r""" 158 Reads the partition information from the physical disk device with 159 name *disk_name*. 160 161 The partition information will be stored in the partition table 162 *partitions* with a maximum of *count* partitions. The number of actual 163 partitions will be stored in *count*. If there are more partitions than 164 space for storage an error status will be returned. The partition table 165 format recognized on the disk will be stored in *format*. 166 """ 167 return _bdpart.rtems_bdpart_read(disk_name, format, partitions, count)
Reads the partition information from the physical disk device with name disk_name.
The partition information will be stored in the partition table partitions with a maximum of count partitions. The number of actual partitions will be stored in count. If there are more partitions than space for storage an error status will be returned. The partition table format recognized on the disk will be stored in format.
169def rtems_bdpart_sort(partitions, count): 170 r""" 171 Sorts the partition table *partitions* with *count* partitions to 172 have ascending begin blocks 173 """ 174 return _bdpart.rtems_bdpart_sort(partitions, count)
Sorts the partition table partitions with count partitions to have ascending begin blocks
176def rtems_bdpart_write(disk_name, format, partitions, count): 177 r""" 178 Writes the partition table to the physical disk device with name 179 *disk_name*. 180 181 The partition table *partitions* with *count* partitions will be written 182 to the disk. The output format for the partition table on the disk is 183 specified by *format*. There are some consistency checks applied to the 184 partition table. The partition table must be sorted such that the begin 185 blocks are in ascending order. This can be done with the 186 rtems_bdpart_sort() function. The partitions must not overlap. The 187 partitions must have a positive size. The partitions must be within the 188 disk. Depending on the output format there are additional constrains. 189 """ 190 return _bdpart.rtems_bdpart_write(disk_name, format, partitions, count)
Writes the partition table to the physical disk device with name disk_name.
The partition table partitions with count partitions will be written to the disk. The output format for the partition table on the disk is specified by format. There are some consistency checks applied to the partition table. The partition table must be sorted such that the begin blocks are in ascending order. This can be done with the rtems_bdpart_sort() function. The partitions must not overlap. The partitions must have a positive size. The partitions must be within the disk. Depending on the output format there are additional constrains.
192def rtems_bdpart_create(disk_name, format, partitions, distribution, count): 193 r""" 194 Creates a partition table in *partitions* with *count* partitions 195 for the physical disk device with name *disk_name*. 196 197 The array of positive integer weights in *distribution* must have exactly 198 *count* elements. The weights in the distribution array are summed up. 199 Each weight is then divided by the sum to obtain the disk fraction which 200 forms the corresponding partition. The partition boundaries are generated 201 with respect to the output format in *format*. 202 """ 203 return _bdpart.rtems_bdpart_create(disk_name, format, partitions, distribution, count)
Creates a partition table in partitions with count partitions for the physical disk device with name disk_name.
The array of positive integer weights in distribution must have exactly count elements. The weights in the distribution array are summed up. Each weight is then divided by the sum to obtain the disk fraction which forms the corresponding partition. The partition boundaries are generated with respect to the output format in format.
205def rtems_bdpart_register(disk_name, partitions, count): 206 r""" 207 Registers the partitions as logical disks for the physical disk 208 device with name *disk_name*. 209 210 For each partition of the partition table *partitions* with *count* 211 partitions a logical disk is registered. The partition number equals the 212 partition table index plus one. The name of the logical disk device is the 213 concatenation of the physical disk device name and the partition number. 214 215 See also: rtems_blkdev_create_partition(). 216 """ 217 return _bdpart.rtems_bdpart_register(disk_name, partitions, count)
Registers the partitions as logical disks for the physical disk device with name disk_name.
For each partition of the partition table partitions with count partitions a logical disk is registered. The partition number equals the partition table index plus one. The name of the logical disk device is the concatenation of the physical disk device name and the partition number.
See also: rtems_blkdev_create_partition().
219def rtems_bdpart_register_from_disk(disk_name): 220 r""" 221 *brief* Reads the partition table from the disk device with name 222 *disk_name* and registers the partitions as logical disks. 223 224 See also: rtems_bdpart_register() and rtems_fsmount(). 225 """ 226 return _bdpart.rtems_bdpart_register_from_disk(disk_name)
brief Reads the partition table from the disk device with name disk_name and registers the partitions as logical disks.
See also: rtems_bdpart_register() and rtems_fsmount().
228def rtems_bdpart_unregister(disk_name, partitions, count): 229 r""" 230 Deletes the logical disks associated with the partitions of the disk 231 device with name *disk_name*. 232 233 The partition table *partitions* with *count* partitions will be used to 234 determine which disks need to be deleted. It may be obtained from 235 rtems_bdpart_read(). 236 """ 237 return _bdpart.rtems_bdpart_unregister(disk_name, partitions, count)
Deletes the logical disks associated with the partitions of the disk device with name disk_name.
The partition table partitions with count partitions will be used to determine which disks need to be deleted. It may be obtained from rtems_bdpart_read().
239def rtems_bdpart_dump(partitions, count): 240 r""" 241 Prints the partition table *partitions* with *count* partitions to 242 standard output. 243 """ 244 return _bdpart.rtems_bdpart_dump(partitions, count)
Prints the partition table partitions with count partitions to standard output.
246def rtems_bdpart_to_partition_type(mbr_type, type): 247 r""" 248 Returns the partition type for the MBR partition type value 249 *mbr_type* in *type*. 250 """ 251 return _bdpart.rtems_bdpart_to_partition_type(mbr_type, type)
Returns the partition type for the MBR partition type value mbr_type in type.
253def rtems_bdpart_to_mbr_partition_type(type, mbr_type): 254 r""" 255 Converts the partition type in *type* to the MBR partition type. 256 257 The result will be stored in *mbr_type*. Returns ``true`` in case of a 258 successful convertion and otherwise ``false``. Both arguments must not be 259 ``NULL``. 260 """ 261 return _bdpart.rtems_bdpart_to_mbr_partition_type(type, mbr_type)
Converts the partition type in type to the MBR partition type.
The result will be stored in mbr_type. Returns true in case of a
successful convertion and otherwise false. Both arguments must not be
NULL.
293def rtems_bdpart_mbr_partition_type(type): 294 r""" 295 rtems_bdpart_mbr_partition_type(uuid_t const type) -> uint8_t 296 297 Parameters 298 ---------- 299 type: uuid_t const 300 301 """ 302 return _bdpart.rtems_bdpart_mbr_partition_type(type)
rtems_bdpart_mbr_partition_type(uuid_t const type) -> uint8_t
Parameters
type: uuid_t const
304def rtems_bdpart_get_disk_data(disk_name, fd_ptr, dd_ptr, disk_end): 305 r""" 306 rtems_bdpart_get_disk_data(char const * disk_name, int * fd_ptr, rtems_disk_device ** dd_ptr, rtems_blkdev_bnum * disk_end) -> rtems_status_code 307 308 Parameters 309 ---------- 310 disk_name: char const * 311 fd_ptr: int * 312 dd_ptr: rtems_disk_device ** 313 disk_end: rtems_blkdev_bnum * 314 315 """ 316 return _bdpart.rtems_bdpart_get_disk_data(disk_name, fd_ptr, dd_ptr, disk_end)
rtems_bdpart_get_disk_data(char const * disk_name, int * fd_ptr, rtems_disk_device ** dd_ptr, rtems_blkdev_bnum * disk_end) -> rtems_status_code
Parameters
disk_name: char const * fd_ptr: int * dd_ptr: rtems_disk_device ** disk_end: rtems_blkdev_bnum *