← Back to team overview

curtin-dev team mailing list archive

[Merge] ~mwhudson/curtin:v2-sfdisk-focal into curtin:master

 

Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:v2-sfdisk-focal into curtin:master.

Commit message:
block_meta_v2: do not use aliases for partition types

These are not supported by sfdisk in focal.


Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/415778
-- 
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:v2-sfdisk-focal into curtin:master.
diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
index 772c347..e45c4ca 100644
--- a/curtin/commands/block_meta_v2.py
+++ b/curtin/commands/block_meta_v2.py
@@ -53,6 +53,11 @@ def align_down(size, block_size):
 FLAG_TO_GUID = {
     flag: guid for (guid, (flag, typecode)) in GPT_GUID_TO_CURTIN_MAP.items()
     }
+FLAG_TO_MBR_TYPE = {
+    flag: typecode[:2].upper() for (guid, (flag, typecode))
+    in GPT_GUID_TO_CURTIN_MAP.items()
+    }
+FLAG_TO_MBR_TYPE['extended'] = '05'
 
 
 class SFDiskPartTable:
@@ -150,14 +155,7 @@ class DOSPartTable(SFDiskPartTable):
                 else:
                     start = align_up(prev.start + prev.size, ONE_MIB_SECTORS)
         size = int(util.human2bytes(action['size'])) // SECTOR_BYTES
-        FLAG_TO_TYPE = {
-            'extended': 'extended',
-            'boot': 'uefi',
-            'swap': 'swap',
-            'lvm': 'lvm',
-            'raid': 'raid',
-            }
-        type = FLAG_TO_TYPE.get(flag)
+        type = FLAG_TO_MBR_TYPE.get(flag)
         if flag == 'boot':
             bootable = True
         else:

Follow ups