diff --git a/diskimage_builder/block_device/tests/test_mbr.py b/diskimage_builder/block_device/tests/test_mbr.py index 606b943e..0645ee51 100644 --- a/diskimage_builder/block_device/tests/test_mbr.py +++ b/diskimage_builder/block_device/tests/test_mbr.py @@ -162,3 +162,13 @@ class TestMBR(tb.TestBase): "9 155648 176127 0x83 0x0 dos\n" "10 178176 198655 0x83 0x0 dos\n" "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) diff --git a/doc/source/user_guide/building_an_image.rst b/doc/source/user_guide/building_an_image.rst index 15bb9586..7f7a3081 100644 --- a/doc/source/user_guide/building_an_image.rst +++ b/doc/source/user_guide/building_an_image.rst @@ -323,6 +323,11 @@ size (percentage) numbers: in the later case the size is calculated 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: .. code-block:: yaml