Merge ~dbungert/curtin:v1-extended-sizing into curtin:master

Proposed by Dan Bungert
Status: Rejected
Rejected by: Dan Bungert
Proposed branch: ~dbungert/curtin:v1-extended-sizing
Merge into: curtin:master
Diff against target: 32 lines (+1/-9)
2 files modified
curtin/commands/block_meta.py (+0/-6)
tests/integration/test_block_meta.py (+1/-3)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Disapprove
Server Team CI bot continuous-integration Approve
Review via email: mp+419514@code.launchpad.net

Commit message

block-meta: remove extension of extended part size

In v1 action mode, the size of the extended partition is currently
extended by 1MiB to counter for the 1MiB gap in between logical
partition. Remove that. Callers are expected to provide appropriate
sizing.

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
Michael Hudson-Doyle (mwhudson) wrote :

I guess the only question is if MAAS might rely on this. I sincerely hope not though.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Actually it looks like maas works around this in a way that this change will probably break. I'd still like to change this, but maybe by killing v1 entirely.

review: Disapprove

Unmerged commits

f974822... by Dan Bungert

block-meta: remove extension of extended part size

In v1 action mode, the size of the extended partition is currently
extended by 1MiB to counter for the 1MiB gap in between logical
partiton. Remove that. Callers are expected to provide appropriate
sizing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
2index 5614883..c986e94 100644
3--- a/curtin/commands/block_meta.py
4+++ b/curtin/commands/block_meta.py
5@@ -928,12 +928,6 @@ def partition_handler(info, storage_config, handlers):
6 # start sector is part of the sectors that define the partitions size
7 # so length has to be "size in sectors - 1"
8 length_sectors = int(length_bytes / logical_block_size_bytes) - 1
9- # logical partitions can't share their start sector with the extended
10- # partition and logical partitions can't go head-to-head, so we have to
11- # realign and for that increase size as required
12- if info.get('flag') == "extended":
13- logdisks = getnumberoflogicaldisks(device, storage_config)
14- length_sectors = length_sectors + (logdisks * alignment_offset)
15
16 # Handle preserve flag
17 create_partition = True
18diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
19index be69bc0..2b939d0 100644
20--- a/tests/integration/test_block_meta.py
21+++ b/tests/integration/test_block_meta.py
22@@ -272,9 +272,7 @@ class TestBlockMeta(IntegrationTestCase):
23 img = self.tmp_path('image.img')
24 config = StorageConfigBuilder(version=version)
25 config.add_image(path=img, size='100M', ptable='msdos')
26- # curtin adds 1MiB to the size of the extend partition per contained
27- # logical partition, but only in v1 mode
28- size = '97M' if version == 1 else '99M'
29+ size = '99M'
30 config.add_part(size=size, number=1, flag='extended')
31 config.add_part(size='10M', number=5, flag='logical')
32 config.add_part(size='10M', number=6, flag='logical')

Subscribers

People subscribed via source and target branches