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

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 5e46883d907e5e1ae5f1f022a1921a13afe2bc84
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:v2-sfdisk-focal
Merge into: curtin:master
Diff against target: 32 lines (+6/-8)
1 file modified
curtin/commands/block_meta_v2.py (+6/-8)
Reviewer Review Type Date Requested Status
Dan Bungert Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+415778@code.launchpad.net

Commit message

block_meta_v2: do not use aliases for partition types

These are not supported by sfdisk in focal.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Bungert (dbungert) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
2index 772c347..e45c4ca 100644
3--- a/curtin/commands/block_meta_v2.py
4+++ b/curtin/commands/block_meta_v2.py
5@@ -53,6 +53,11 @@ def align_down(size, block_size):
6 FLAG_TO_GUID = {
7 flag: guid for (guid, (flag, typecode)) in GPT_GUID_TO_CURTIN_MAP.items()
8 }
9+FLAG_TO_MBR_TYPE = {
10+ flag: typecode[:2].upper() for (guid, (flag, typecode))
11+ in GPT_GUID_TO_CURTIN_MAP.items()
12+ }
13+FLAG_TO_MBR_TYPE['extended'] = '05'
14
15
16 class SFDiskPartTable:
17@@ -150,14 +155,7 @@ class DOSPartTable(SFDiskPartTable):
18 else:
19 start = align_up(prev.start + prev.size, ONE_MIB_SECTORS)
20 size = int(util.human2bytes(action['size'])) // SECTOR_BYTES
21- FLAG_TO_TYPE = {
22- 'extended': 'extended',
23- 'boot': 'uefi',
24- 'swap': 'swap',
25- 'lvm': 'lvm',
26- 'raid': 'raid',
27- }
28- type = FLAG_TO_TYPE.get(flag)
29+ type = FLAG_TO_MBR_TYPE.get(flag)
30 if flag == 'boot':
31 bootable = True
32 else:

Subscribers

People subscribed via source and target branches