curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #03871
[Merge] ~ogayot/curtin:dyndisk-ptable=none into curtin:master
Olivier Gayot has proposed merging ~ogayot/curtin:dyndisk-ptable=none into curtin:master.
Commit message:
storage-config: drop visible-on-ptable, unset ptable when relevant
When parsing a blockdev with DEVTYPE=partition, we look in the parent
blockdev for the partition table. Then, if we notice that the partition is
not actually associated with the partition table (which is only accepted
for Windows dynamic disks ATM), we used to add a "visible-in-ptable":
False attribute ; so that we don't try to retrieve properties from the
ptable later.
A simpler way it to unset the ptable variable. This has the same effect
without relying on an extra property.
Requested reviews:
curtin developers (curtin-dev)
For more details, see:
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/481186
--
Your team curtin developers is requested to review the proposed merge of ~ogayot/curtin:dyndisk-ptable=none into curtin:master.
diff --git a/curtin/storage_config.py b/curtin/storage_config.py
index 8646a2e..e00b380 100644
--- a/curtin/storage_config.py
+++ b/curtin/storage_config.py
@@ -845,8 +845,8 @@ class BlockdevParser(ProbertParser):
part = {
'start': attrs['start'],
'size': attrs['size'],
- 'visible-in-ptable': False,
}
+ ptable = None
else:
raise RuntimeError(
"Couldn't find partition entry in table")
@@ -864,7 +864,7 @@ class BlockdevParser(ProbertParser):
entry['offset'] = offset_val
entry['size'] = int(part['size'])
- if ptable and part.get("visible-in-ptable", True):
+ if ptable:
entry['size'] *= logical_sector_size
if blockdev_data.get('ID_PART_TABLE_TYPE') == 'gpt':
@@ -884,7 +884,7 @@ class BlockdevParser(ProbertParser):
ptype_flag = blockdev_data.get('ID_PART_ENTRY_FLAGS')
if ptype_flag in [MBR_BOOT_FLAG]:
flag_name = 'boot'
- elif part.get("visible-in-ptable", True):
+ else:
# logical partitions are not tagged in data, however
# the partition number > 4 (ie, not primary nor extended)
if entry['number'] > 4:
Follow ups