Merge ~mwhudson/curtin:fba-dasd into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: e3ad89c8b41145f2a40aa1822c9bfabfce76600d
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:fba-dasd
Merge into: curtin:master
Diff against target: 44 lines (+15/-5)
1 file modified
curtin/storage_config.py (+15/-5)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Paride Legovini lightweight Approve
Review via email: mp+394986@code.launchpad.net

Commit message

storage_config: handle some FBA dasd oddities

The storage_config handling of dasds only accounted for ECKD
dasds. FBA dasds need different handling -- in many ways they are
more like a regular disk (that can only be formatted with a DOS
partition table, but this code doesn't need to handle that), but
the kernel creates a magic fake partition for a FBA dasd with no
DOS partition table and we want to pretend that doesn't exist.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :

LGTM

review: Approve (lightweight)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

Commit message lints:
- Line #2 has 309 too many characters. Line starts with: "The storage_config handling"...

review: Needs Fixing
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/curtin/storage_config.py b/curtin/storage_config.py
index 494b142..96d208f 100644
--- a/curtin/storage_config.py
+++ b/curtin/storage_config.py
@@ -768,17 +768,20 @@ class BlockdevParser(ProbertParser):
768 # set wwn, serial, and path768 # set wwn, serial, and path
769 entry.update(uniq_ids)769 entry.update(uniq_ids)
770770
771 # disk entry for dasds needs device_id and check for vtoc ptable771 # disk entry for ECKD dasds needs device_id and check for vtoc
772 if devname.startswith('/dev/dasd'):772 # ptable
773 dasd_config = self.probe_data.get('dasd', {}).get(devname)
774 if dasd_config is not None and \
775 dasd_config.get('type', 'ECKD') == 'ECKD':
773 device_id = (776 device_id = (
774 blockdev_data.get('ID_PATH', '').replace('ccw-', ''))777 blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
775 if device_id:778 if device_id:
776 entry['device_id'] = device_id779 entry['device_id'] = device_id
777780
778 # if dasd has been formatted, attrs.size is non-zero781 # if dasd has been formatted, attrs.size is non-zero
779 # formatted dasds have ptable type of 'vtoc'782 # formatted ECKD dasds have ptable type of 'vtoc'
780 dasd_size = blockdev_data.get('attrs', {}).get('size')783 dasd_size = blockdev_data.get('attrs', {}).get('size', "0")
781 if dasd_size and dasd_size != "0":784 if dasd_size != "0":
782 entry['ptable'] = 'vtoc'785 entry['ptable'] = 'vtoc'
783786
784 if 'ID_PART_TABLE_TYPE' in blockdev_data:787 if 'ID_PART_TABLE_TYPE' in blockdev_data:
@@ -794,6 +797,13 @@ class BlockdevParser(ProbertParser):
794 entry['number'] = int(attrs['partition'])797 entry['number'] = int(attrs['partition'])
795 parent_devname = self.partition_parent_devname(blockdev_data)798 parent_devname = self.partition_parent_devname(blockdev_data)
796 parent_blockdev = self.blockdev_data[parent_devname]799 parent_blockdev = self.blockdev_data[parent_devname]
800 if 'ID_PART_TABLE_TYPE' not in parent_blockdev:
801 # Exclude the fake partition that the kernel creates
802 # for an otherwise unformatted FBA dasd.
803 dasds = self.probe_data.get('dasd', {})
804 dasd_config = dasds.get(parent_devname, {})
805 if dasd_config.get('type', 'ECKD') == 'FBA':
806 return None
797 ptable = parent_blockdev.get('partitiontable')807 ptable = parent_blockdev.get('partitiontable')
798 if ptable:808 if ptable:
799 part = None809 part = None

Subscribers

People subscribed via source and target branches