Merge "Allow users to specify partition type in the MBR PTE"

This commit is contained in:
Jenkins 2017-08-04 05:19:02 +00:00 committed by Gerrit Code Review
commit ced9b51f6e
2 changed files with 15 additions and 0 deletions

View File

@ -162,3 +162,13 @@ class TestMBR(tb.TestBase):
"9 155648 176127 0x83 0x0 dos\n" "9 155648 176127 0x83 0x0 dos\n"
"10 178176 198655 0x83 0x0 dos\n" "10 178176 198655 0x83 0x0 dos\n"
"11 200704 221183 0x83 0x0 dos\n", output) "11 200704 221183 0x83 0x0 dos\n", output)
def test_pri_fat32_lba_partition(self):
"""Creates a partition with a non-default 'type' and verifies."""
with MBR(self.image_path, TestMBR.disk_size_1G, 1024 * 1024) as mbr:
mbr.add_partition(True, False, TestMBR.disk_size_10M, 0x0c)
output = self._run_partx(self.image_path)
self.assertEqual(
"1 2048 22527 0xc 0x0 dos\n", output)

View File

@ -323,6 +323,11 @@ size
(percentage) numbers: in the later case the size is calculated (percentage) numbers: in the later case the size is calculated
based on the remaining free space. based on the remaining free space.
type (optional)
The partition type stored in the MBR partition table entry. The
default value is '0x83' (Linux Default partition). Any valid one
byte hexadecimal value may be specified here.
Example: Example:
.. code-block:: yaml .. code-block:: yaml