curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #01346
Re: [Merge] ~mwhudson/curtin:lp-1893818 into curtin:master
Diff comments:
> diff --git a/curtin/storage_config.py b/curtin/storage_config.py
> index e6c33cc..dfe13a8 100644
> --- a/curtin/storage_config.py
> +++ b/curtin/storage_config.py
> @@ -796,23 +751,35 @@ class BlockdevParser(ProbertParser):
>
> if entry['type'] == 'partition':
> attrs = blockdev_data['attrs']
> - entry['number'] = int(attrs['partition'])
> - parent_devname = self.partition_parent_devname(blockdev_data)
> - parent_blockdev = self.blockdev_data[parent_devname]
> - if 'ID_PART_TABLE_TYPE' not in parent_blockdev:
> - # Exclude the fake partition that the kernel creates
> - # for an otherwise unformatted FBA dasd.
> - dasds = self.probe_data.get('dasd', {})
> - dasd_config = dasds.get(parent_devname, {})
> - if dasd_config.get('type', 'ECKD') == 'FBA':
> - return None
> + if self.is_mpath_partition(blockdev_data):
> + entry['number'] = int(blockdev_data['DM_PART'])
> + parent_mpath = blockdev_data['DM_MPATH']
> + for data in self.blockdev_data.values():
> + if data.get('DM_NAME') == parent_mpath:
> + parent_blockdev = data
> + break
> + else:
> + raise ValueError("cannot find parent")
I've rewritten this part a bunch.
> + self_name = '/dev/mapper/{}-part{}'.format(
> + parent_mpath, entry['number'])
> + else:
> + entry['number'] = int(attrs['partition'])
> + self_name = blockdev_data['DEVNAME']
> + parent_devname = self.partition_parent_devname(blockdev_data)
> + parent_blockdev = self.blockdev_data[parent_devname]
> + if 'ID_PART_TABLE_TYPE' not in parent_blockdev:
> + # Exclude the fake partition that the kernel creates
> + # for an otherwise unformatted FBA dasd.
> + dasds = self.probe_data.get('dasd', {})
> + dasd_config = dasds.get(parent_devname, {})
> + if dasd_config.get('type', 'ECKD') == 'FBA':
> + return None
> ptable = parent_blockdev.get('partitiontable')
> if ptable:
> part = None
> for pentry in ptable['partitions']:
> node = pentry['node']
> - node_p = node.replace(parent_devname, '')
> - if node_p.replace('p', '') == attrs['partition']:
> + if node == self_name:
> part = pentry
> break
>
--
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/392353
Your team curtin developers is subscribed to branch curtin:master.
References