I'm not certain how to effectively leverage rhel06 code to rewrite this
better--this patch is fairly similar to the upstream patches sitting in
POST right now. I think, however, that it may be best to incorporate the
patches from IBM as-is for this branch, and re-work the ones upstream to
be improved.
====
Fixed Block Access (FBA) DASDs are mainframe-specific disk devices
which are layed out as a sequence of 512-byte sectors. In contrast
to ECKD DASDs, these disks do not require formatting and resemble
the LBA layout of non-mainframe disks. Despite this resemblance,
the Linux kernel applies special handling during partition detection
for FBA DASDs, resulting in a single, immutable partition being
reported.
While actual FBA DASD hardware is no longer available, the z/VM
hypervisor can simulate FBA DASD disks, backed by either ECKD or
SCSI devices.
This patch adds support for successful installation on FBA DASD
devies (EDEV)
Signed-off-by: Nageswara R Sastry <rnsastry(a)linux.vnet.ibm.com>
Resolves: rhbz#654323
---
storage/devices.py | 5 ++++-
storage/formats/disklabel.py | 13 ++++++++++++-
storage/partitioning.py | 8 ++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/storage/devices.py b/storage/devices.py
index 42e3b6f..6348057 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -113,6 +113,7 @@ from flags import flags
from .storage_log import log_method_call
from udev import *
from formats import get_device_format_class, getFormat, DeviceFormat
+import isys
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1327,7 +1328,9 @@ class PartitionDevice(StorageDevice):
self.createParents()
self.setupParents()
- self.disk.format.addPartition(self.partedPartition)
+ # Do not create partition on LDL formatted
+ if isys.isLdlDasd(self.disk.name):
+ self.disk.format.addPartition(self.partedPartition)
try:
self.disk.format.commit()
diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py
index c6927ec..c100051 100644
--- a/storage/formats/disklabel.py
+++ b/storage/formats/disklabel.py
@@ -128,6 +128,11 @@ class DiskLabel(DeviceFormat):
log_method_call(self, device=self.device, labelType=self._labelType)
return parted.freshDisk(device=self.partedDevice, ty=self._labelType)
+ def newPartedDisk(self):
+ """ Return a new, empty parted.Disk instance for this device.
"""
+ log_method_call(self, device=self.device)
+ return parted.newDisk(device=self.partedDevice)
+
@property
def partedDisk(self):
if not self._partedDisk:
@@ -149,7 +154,13 @@ class DiskLabel(DeviceFormat):
# preexisting disklabels if the passed type was wrong
self._labelType = self._partedDisk.type
else:
- self._partedDisk = self.freshPartedDisk()
+ if (self._labelType == "dasd"):
+ self._partedDisk = self.newPartedDisk()
+ # Don't want to break for the normal DASD
+ if self._partedDisk.maxPrimaryPartitionCount != 1:
+ self._partedDisk = self.freshPartedDisk()
+ else:
+ self.partedDisk = self.freshPartedDisk()
return self._partedDisk
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 1e7f583..67ec012 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -34,6 +34,7 @@ from errors import *
from deviceaction import *
from devices import PartitionDevice, LUKSDevice, devicePathToName
from formats import getFormat
+import isys
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -485,6 +486,11 @@ def clearPartitions(storage):
# disk. Still, we need it out of the devicetree.
storage.devicetree._removeDevice(part, moddisk=False)
+ # Do not remove partition from LDL formatted
+ if not isys.isLdlDasd(disk.name):
+ if disk.partitioned and disk.format.partitions:
+ raise ValueError("cannot initialize a disk that has
partitions")
+
destroy_action = ActionDestroyFormat(disk)
newLabel = getFormat("disklabel", device=disk.path,
labelType=nativeLabelType)
@@ -633,6 +639,8 @@ def getNextPartitionType(disk, no_primary=None):
part_type = parted.PARTITION_LOGICAL
elif extended and logical_count < max_logicals:
part_type = parted.PARTITION_LOGICAL
+ elif (disk.type == "dasd" and disk.maxPrimaryPartitionCount == 1):
+ part_type = parted.PARTITION_NORMAL
return part_type
--
1.7.11.7
Show replies by date