curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #02275
[Merge] ~dbungert/curtin:v1-extended-sizing into curtin:master
Dan Bungert has proposed merging ~dbungert/curtin:v1-extended-sizing into curtin:master.
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.
Requested reviews:
curtin developers (curtin-dev)
For more details, see:
https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/419514
--
Your team curtin developers is requested to review the proposed merge of ~dbungert/curtin:v1-extended-sizing into curtin:master.
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):
# start sector is part of the sectors that define the partitions size
# so length has to be "size in sectors - 1"
length_sectors = int(length_bytes / logical_block_size_bytes) - 1
- # logical partitions can't share their start sector with the extended
- # partition and logical partitions can't go head-to-head, so we have to
- # realign and for that increase size as required
- if info.get('flag') == "extended":
- logdisks = getnumberoflogicaldisks(device, storage_config)
- length_sectors = length_sectors + (logdisks * alignment_offset)
# Handle preserve flag
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):
img = self.tmp_path('image.img')
config = StorageConfigBuilder(version=version)
config.add_image(path=img, size='100M', ptable='msdos')
- # curtin adds 1MiB to the size of the extend partition per contained
- # logical partition, but only in v1 mode
- size = '97M' if version == 1 else '99M'
+ size = '99M'
config.add_part(size=size, number=1, flag='extended')
config.add_part(size='10M', number=5, flag='logical')
config.add_part(size='10M', number=6, flag='logical')
Follow ups