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
diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
index 5614883..c986e94 100644
--- a/curtin/commands/block_meta.py
+++ b/curtin/commands/block_meta.py
@@ -928,12 +928,6 @@ def partition_handler(info, storage_config, handlers):
928 # start sector is part of the sectors that define the partitions size928 # start sector is part of the sectors that define the partitions size
929 # so length has to be "size in sectors - 1"929 # so length has to be "size in sectors - 1"
930 length_sectors = int(length_bytes / logical_block_size_bytes) - 1930 length_sectors = int(length_bytes / logical_block_size_bytes) - 1
931 # logical partitions can't share their start sector with the extended
932 # partition and logical partitions can't go head-to-head, so we have to
933 # realign and for that increase size as required
934 if info.get('flag') == "extended":
935 logdisks = getnumberoflogicaldisks(device, storage_config)
936 length_sectors = length_sectors + (logdisks * alignment_offset)
937931
938 # Handle preserve flag932 # Handle preserve flag
939 create_partition = True933 create_partition = True
diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
index be69bc0..2b939d0 100644
--- a/tests/integration/test_block_meta.py
+++ b/tests/integration/test_block_meta.py
@@ -272,9 +272,7 @@ class TestBlockMeta(IntegrationTestCase):
272 img = self.tmp_path('image.img')272 img = self.tmp_path('image.img')
273 config = StorageConfigBuilder(version=version)273 config = StorageConfigBuilder(version=version)
274 config.add_image(path=img, size='100M', ptable='msdos')274 config.add_image(path=img, size='100M', ptable='msdos')
275 # curtin adds 1MiB to the size of the extend partition per contained275 size = '99M'
276 # logical partition, but only in v1 mode
277 size = '97M' if version == 1 else '99M'
278 config.add_part(size=size, number=1, flag='extended')276 config.add_part(size=size, number=1, flag='extended')
279 config.add_part(size='10M', number=5, flag='logical')277 config.add_part(size='10M', number=5, flag='logical')
280 config.add_part(size='10M', number=6, flag='logical')278 config.add_part(size='10M', number=6, flag='logical')

Subscribers

People subscribed via source and target branches