Patch 8 needs to get into a build so that composes with the new anaconda have a chance of working without updates image.
Patch 4 is relevant to anaconda. The populate following user providing a passphrase for an existing luks device currently brings removed and hidden devices back into play.
Patches 2,3,7,11 are all for non-installer usage.
--- blivet/__init__.py | 2 -- 1 file changed, 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 08b59b6..809ede3 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -403,7 +403,6 @@ class Blivet(object): self.dasd.startup(None, self.config.exclusiveDisks, self.config.initializeDisks) - clearPartType = self.config.clearPartType # save this before overriding it if self.dasd: # Reset the internal dasd list (823534) self.dasd.clear_device_list() @@ -414,7 +413,6 @@ class Blivet(object): iscsi=self.iscsi, dasd=self.dasd) self.devicetree.populate(cleanupOnly=cleanupOnly) - self.config.clearPartType = clearPartType # set it back self.fsset = FSSet(self.devicetree) self.eddDict = get_edd_dict(self.partitioned) if self.bootloader:
--- blivet/devices.py | 31 +++++++++++++++++-------------- blivet/devicetree.py | 7 +++++-- 2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/blivet/devices.py b/blivet/devices.py index 1a4b4d0..28a5a92 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -2120,7 +2120,7 @@ class LVMVolumeGroupDevice(DMDevice): device.addChild()
# now see if the VG can be activated - if self.complete: + if self.complete and flags.installer_mode: self.setup()
def _removeDevice(self, device): @@ -2933,20 +2933,21 @@ class MDRaidArrayDevice(StorageDevice): self.devices.append(device) device.addChild()
- device.setup() - udev_settle() + if flags.installer_mode: + device.setup() + udev_settle()
- if self.spares > 0: - # mdadm doesn't like it when you try to incrementally add spares - return + if self.spares > 0: + # mdadm doesn't like it when you try to incrementally add spares + return
- try: - mdraid.mdadd(device.path) - # mdadd causes udev events - udev_settle() - except MDRaidError as e: - log.warning("failed to add member %s to md array %s: %s" - % (device.path, self.path, e)) + try: + mdraid.mdadd(device.path) + # mdadd causes udev events + udev_settle() + except MDRaidError as e: + log.warning("failed to add member %s to md array %s: %s" + % (device.path, self.path, e))
if self.status: # we always probe since the device may not be set up when we want @@ -4111,7 +4112,9 @@ class BTRFSVolumeDevice(BTRFSDevice):
def listSubVolumes(self): subvols = [] - self.setup(orig=True) + if flags.installer_mode: + self.setup(orig=True) + try: self._do_temp_mount(orig=True) except FSError as e: diff --git a/blivet/devicetree.py b/blivet/devicetree.py index 26a853b..a627398 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -1212,7 +1212,7 @@ class DeviceTree(object): mirrors[name]["log"] = lv_sizes[index]
lv_dev = self.getDeviceByName(name) - if lv_dev is None: + if lv_dev is None and flags.installer_mode: lv_uuid = lv_uuids[index] lv_size = lv_sizes[index] lv_device = LVMLogicalVolumeDevice(lv_name, @@ -1797,7 +1797,7 @@ class DeviceTree(object):
old_devices = {}
- if os.access("/etc/multipath.conf", os.W_OK): + if os.access("/etc/multipath.conf", os.W_OK) and flags.installer_mode: self.__multipathConfigWriter.writeConfig(self.mpathFriendlyNames) self.topology = devicelibs.mpath.MultipathTopology(udev_get_block_devices()) log.info("devices to scan: %s" % @@ -1879,6 +1879,9 @@ class DeviceTree(object):
def teardownAll(self): """ Run teardown methods on all devices. """ + if not flags.installer_mode: + return + for device in self.leaves: if device.protected: continue
--- blivet/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 809ede3..9b5bd54 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -396,7 +396,7 @@ class Blivet(object): if self.ksdata: self.config.update(self.ksdata)
- if not flags.image_install: + if flags.installer_mode and not flags.image_install: self.iscsi.startup() self.fcoe.startup() self.zfcp.startup() @@ -422,7 +422,8 @@ class Blivet(object): self.bootloader.stage1_device = None self.bootloader.stage2_device = None
- self.roots = findExistingInstallations(self.devicetree) + if flags.installer_mode: + self.roots = findExistingInstallations(self.devicetree)
self.dumpState("initial")
--- blivet/devicetree.py | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index a627398..eee8ed6 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -922,6 +922,19 @@ class DeviceTree(object): uuid = udev_device_get_uuid(info) sysfs_path = udev_device_get_sysfs_path(info)
+ # make sure this device was not scheduled for removal and also has not + # been hidden + removed = self.findActions(type="destroy", object="device") + for ignored in removed + self._hidden: + if ignored.sysfsPath == sysfs_path or \ + uuid in (ignored.uuid, ignored.format.uuid): + if ignored in removed: + reason = "removed" + else: + reason = "hidden" + + log.debug("skipping %s device %s" % (reason, name)) + # make sure we note the name of every device we see if name not in self.names: self.names.append(name)
On Mon, 2013-02-04 at 17:32 -0600, David Lehman wrote:
blivet/devicetree.py | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index a627398..eee8ed6 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -922,6 +922,19 @@ class DeviceTree(object): uuid = udev_device_get_uuid(info) sysfs_path = udev_device_get_sysfs_path(info)
# make sure this device was not scheduled for removal and also has not# been hiddenremoved = self.findActions(type="destroy", object="device")for ignored in removed + self._hidden:if ignored.sysfsPath == sysfs_path or \uuid in (ignored.uuid, ignored.format.uuid):if ignored in removed:reason = "removed"else:reason = "hidden"log.debug("skipping %s device %s" % (reason, name))
There's a missing 'return' above, right after the logging.
# make sure we note the name of every device we see if name not in self.names: self.names.append(name)
--- blivet/devicetree.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index a627398..5972b62 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -922,6 +922,21 @@ class DeviceTree(object): uuid = udev_device_get_uuid(info) sysfs_path = udev_device_get_sysfs_path(info)
+ # make sure this device was not scheduled for removal and also has not + # been hidden + removed = [a.device for a in + self.findActions(type="destroy", object="device")] + for ignored in removed + self._hidden: + if (sysfs_path and ignored.sysfsPath == sysfs_path) or \ + (uuid and uuid in (ignored.uuid, ignored.format.uuid)): + if ignored in removed: + reason = "removed" + else: + reason = "hidden" + + log.debug("skipping %s device %s" % (reason, name)) + return + # make sure we note the name of every device we see if name not in self.names: self.names.append(name)
On Tue, 2013-02-05 at 15:13 -0600, David Lehman wrote:
blivet/devicetree.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index a627398..5972b62 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -922,6 +922,21 @@ class DeviceTree(object): uuid = udev_device_get_uuid(info) sysfs_path = udev_device_get_sysfs_path(info)
# make sure this device was not scheduled for removal and also has not# been hiddenremoved = [a.device for a inself.findActions(type="destroy", object="device")]for ignored in removed + self._hidden:if (sysfs_path and ignored.sysfsPath == sysfs_path) or \(uuid and uuid in (ignored.uuid, ignored.format.uuid)):if ignored in removed:reason = "removed"else:reason = "hidden"log.debug("skipping %s device %s" % (reason, name))return# make sure we note the name of every device we see if name not in self.names: self.names.append(name)
ACK.
--- blivet/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 9b5bd54..3081319 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -163,12 +163,11 @@ def storageInitialize(storage, ksdata, protected): # Set up the protected partitions list now. if protected: storage.config.protectedDevSpecs.extend(protected) - storage.reset()
- if not flags.live_install and not storage.protectedDevices: - raise UnknownSourceDeviceError(protected) - else: - storage.reset() + storage.reset() + + if protected and not flags.live_install and not storage.protectedDevices: + raise UnknownSourceDeviceError(protected)
# kickstart uses all the disks if flags.automated_install:
Thanks to Jan Safranek for the idea. --- python-blivet.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/python-blivet.spec b/python-blivet.spec index 8ea140e..e343ba0 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,11 +5,8 @@ Version: 0.4 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries -# This is a Red Hat maintained package which is specific to -# our distribution. Thus the source is only available from -# within this srpm. %define realname blivet -Source0: %{realname}-%{version}.tar.gz +Source0: http://git.fedorahosted.org/cgit/blivet.git/snapshot/%%7Brealname%7D-%%7Bver...
# Versions of required components (done so we make sure the buildrequires # match the requires versions of things).
Any commit of a DiskLabel will now trigger an update of its origPartedDisk attribute so it always reflects the on-disk state. --- blivet/devicetree.py | 5 ++++- blivet/formats/disklabel.py | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index eee8ed6..a400656 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -84,6 +84,7 @@ class DeviceTree(object): # internal data members self._devices = [] self._actions = [] + self._completed_actions = []
# a list of all device names we encounter self.names = [] @@ -235,7 +236,7 @@ class DeviceTree(object): for action in self._actions: log.debug("action: %s" % action)
- for action in self._actions: + for action in self._actions[:]: log.info("executing action: %s" % action) if not dryRun: try: @@ -253,6 +254,8 @@ class DeviceTree(object): device.updateName() device.format.device = device.path
+ self._completed_actions.append(self._actions.pop(0)) + def _addDevice(self, newdev): """ Add a device to the tree.
diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py index 018adf4..32e995d 100644 --- a/blivet/formats/disklabel.py +++ b/blivet/formats/disklabel.py @@ -74,7 +74,7 @@ class DiskLabel(DeviceFormat):
if self.partedDevice: # set up the parted objects and raise exception on failure - self._origPartedDisk = self.partedDisk.duplicate() + self.updateOrigPartedDisk()
def __deepcopy__(self, memo): """ Create a deep copy of a Disklabel instance. @@ -131,6 +131,9 @@ class DiskLabel(DeviceFormat): "grainSize": self.alignment.grainSize}) return d
+ def updateOrigPartedDisk(self): + self._origPartedDisk = self.partedDisk.duplicate() + def resetPartedDisk(self): """ Set this instance's partedDisk to reflect the disk's contents. """ log_method_call(self, device=self.device) @@ -290,6 +293,7 @@ class DiskLabel(DeviceFormat): except parted.DiskException as msg: raise DiskLabelCommitError(msg) else: + self.updateOrigPartedDisk() udev_settle()
def commitToDisk(self): @@ -300,6 +304,8 @@ class DiskLabel(DeviceFormat): self.partedDisk.commitToDevice() except parted.DiskException as msg: raise DiskLabelCommitError(msg) + else: + self.updateOrigPartedDisk()
def addPartition(self, *args, **kwargs): partition = kwargs.get("partition", None)
--- blivet/arch.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/blivet/arch.py b/blivet/arch.py index 7fc39e7..d4ffc7b 100644 --- a/blivet/arch.py +++ b/blivet/arch.py @@ -30,6 +30,9 @@ import os
from .flags import flags
+# DMI information paths +DMI_CHASSIS_VENDOR = "/sys/class/dmi/id/chassis_vendor" + ## Get the SPARC machine variety type. # @return The SPARC machine type, or 0 if not SPARC. def getSparcMachine():
--- TODO | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/TODO b/TODO index 75b68ab..bd7ebb3 100644 --- a/TODO +++ b/TODO @@ -18,6 +18,7 @@ via ks.cfg - improve interaction with the environment - detect mounts, active swaps, &c + - disallow partitioning changes to disks with in-use partitions? - stop disabling udev-related activation - improve detection of active devices and associated error handling @@ -37,6 +38,7 @@ - improve clarity of exceptions raised - btrfs - raid10 needs four disks + - use btrfs for resize instead of btrfsctl - detection of btrfs raid level, compression - md name collisions in existing system - add StorageConfigurationError or similar so autopart failures due to the
--- blivet/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 3081319..8c854f2 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -37,7 +37,11 @@ import sys import statvfs import copy
-import nss.nss +try: + import nss.nss +except ImportError: + nss = None + import parted
from pykickstart.constants import * @@ -216,6 +220,10 @@ def writeEscrowPackets(storage):
log.debug("escrow: writeEscrowPackets start")
+ if not nss: + log.error("escrow: no nss python module -- aborting") + return + nss.nss.nss_init_nodb() # Does nothing if NSS is already initialized
backupPassphrase = generateBackupPassphrase()
There will be no passphrase or key until/unless one is provided to the luks format instance. --- blivet/devicetree.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py index a400656..32c4003 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -591,7 +591,8 @@ class DeviceTree(object): log.debug("failed to find dm node for %s" % dmdev.name) continue
- cleanup_luks = udev_device_is_dm_luks(info) and self._cleanup + handle_luks = (udev_device_is_dm_luks(info) and + (self._cleanup or not flags.installer_mode)) slave_dev = None slave_info = None if device is None: @@ -619,7 +620,7 @@ class DeviceTree(object): log.error("failure scanning device %s: could not add slave %s" % (name, dev_name)) return
- if cleanup_luks: + if handle_luks: slave_info = new_info
# try to get the device again now that we've got all the slaves @@ -632,7 +633,7 @@ class DeviceTree(object):
# if this is a luks device whose map name is not what we expect, # fix up the map name and see if that sorts us out - if device is None and cleanup_luks and slave_info and slave_dev: + if device is None and handle_luks and slave_info and slave_dev: slave_dev.format.mapName = name self.handleUdevLUKSFormat(slave_info, slave_dev)
On Mon, 2013-02-04 at 17:32 -0600, David Lehman wrote:
Patch 8 needs to get into a build so that composes with the new anaconda have a chance of working without updates image.
Patch 4 is relevant to anaconda. The populate following user providing a passphrase for an existing luks device currently brings removed and hidden devices back into play.
Patches 2,3,7,11 are all for non-installer usage.
These all look good to me.
anaconda-patches@lists.fedorahosted.org