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
1diff --git a/curtin/storage_config.py b/curtin/storage_config.py
2index 494b142..96d208f 100644
3--- a/curtin/storage_config.py
4+++ b/curtin/storage_config.py
5@@ -768,17 +768,20 @@ class BlockdevParser(ProbertParser):
6 # set wwn, serial, and path
7 entry.update(uniq_ids)
8
9- # disk entry for dasds needs device_id and check for vtoc ptable
10- if devname.startswith('/dev/dasd'):
11+ # disk entry for ECKD dasds needs device_id and check for vtoc
12+ # ptable
13+ dasd_config = self.probe_data.get('dasd', {}).get(devname)
14+ if dasd_config is not None and \
15+ dasd_config.get('type', 'ECKD') == 'ECKD':
16 device_id = (
17 blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
18 if device_id:
19 entry['device_id'] = device_id
20
21 # if dasd has been formatted, attrs.size is non-zero
22- # formatted dasds have ptable type of 'vtoc'
23- dasd_size = blockdev_data.get('attrs', {}).get('size')
24- if dasd_size and dasd_size != "0":
25+ # formatted ECKD dasds have ptable type of 'vtoc'
26+ dasd_size = blockdev_data.get('attrs', {}).get('size', "0")
27+ if dasd_size != "0":
28 entry['ptable'] = 'vtoc'
29
30 if 'ID_PART_TABLE_TYPE' in blockdev_data:
31@@ -794,6 +797,13 @@ class BlockdevParser(ProbertParser):
32 entry['number'] = int(attrs['partition'])
33 parent_devname = self.partition_parent_devname(blockdev_data)
34 parent_blockdev = self.blockdev_data[parent_devname]
35+ if 'ID_PART_TABLE_TYPE' not in parent_blockdev:
36+ # Exclude the fake partition that the kernel creates
37+ # for an otherwise unformatted FBA dasd.
38+ dasds = self.probe_data.get('dasd', {})
39+ dasd_config = dasds.get(parent_devname, {})
40+ if dasd_config.get('type', 'ECKD') == 'FBA':
41+ return None
42 ptable = parent_blockdev.get('partitiontable')
43 if ptable:
44 part = None

Subscribers

People subscribed via source and target branches