blivet: update to 2.1.11

Revert few changes to make it compatible with fc25 (libblockdev-0.9,
anaconda-25). And manually backport get_thpool_meta_size function not
present in libblockdev-0.9. Besides that, drop patches already included
in this release.

This update, among other things, limit fsck calls on partitions not
selected for install/resize.

Tarball generated from upstream git checkout of
ee16c10d48724590aac5e0382ebc540195dc712d ("New version 2.1.11") by
calling "make archive".

QubesOS/qubes-issues#2835
pull/32/head
Marek Marczykowski-Górecki 5 years ago
parent 70d4252d91
commit 7c2d9b37e3
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

@ -1,44 +0,0 @@
From a43dc757eff7fe9417f72e25fc373d09439963de Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Fri, 18 Nov 2016 14:01:49 +0100
Subject: [PATCH 1/2] Change how we run e2fsck to check ext filesystems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The '-p' option means "Automatically repair ("preen") the file system. This
option will cause e2fsck to automatically fix any filesystem problems that can
be safely fixed without human intervention." which is something we really
shouldn't do as part of reset()/populate(). We should use '-n' instead "Open the
filesystem read-only, and assume an answer of `no' to all questions." which
guaranties no changes to be made on the file system.
We might want to add the '-p' functionality back at some point, but it needs to
be explicitly triggered by the user code (e.g. Anaconda). I think we need to add
a 'clean' property and a 'repair' method to the formats.FS class so that users
can see where the problem is (if any) and explicitly trigger a safe fixup
attempt if they want to.
Related: rhbz#1170803
---
blivet/tasks/fsck.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py
index a3ed775..c4214dc 100644
--- a/blivet/tasks/fsck.py
+++ b/blivet/tasks/fsck.py
@@ -114,7 +114,9 @@ class Ext2FSCK(FSCK):
128: "Shared library error."}
ext = availability.E2FSCK_APP
- options = ["-f", "-p", "-C", "0"]
+ # "Force checking even if the file system seems clean." (we might get false results otherwise)
+ # + "Open the filesystem read-only, and assume an answer of `no' to all questions."
+ options = ["-f", "-n"]
def _error_message(self, rc):
msgs = (self._fsck_errors[c] for c in self._fsck_errors.keys() if rc & c)
--
2.7.5

@ -1,47 +0,0 @@
From d08d99dfb766e539b9e0074643ab3bc940d6fcee Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 10 Nov 2016 11:34:24 -0800
Subject: [PATCH] Fix detection of 'macefi' partitions (#1393846)
368a4db6 lost a crucial condition in the detection of 'macefi'
partitions in the transition to the 'populator helper' design.
Previously we checked that the parted partition 'name' (which
is a GPT property, for GPT partitions) matched the expected
value according to the macefi format, which basically means we
will only detect partitions created by a previous anaconda run
as 'macefi' (because that name is a very specific one which is
only created by anaconda in the first place).
In the transition, that condition was lost, and now we treat
any device with an HFS+ filesystem that's over 50MiB in size
as a 'macefi' device, which means we mount it at /boot/efi and
try to write all kinds of stuff to it. Not surprisingly, this
borks the install. Fortunately, HFS+ filesystems are mounted
read-only unless they have journalling disabled, so this won't
result in us messing up people's OS X partitions with any luck.
---
blivet/populator/helpers/boot.py | 10 ++++++++++
tests/populator_test.py | 33 +++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/blivet/populator/helpers/boot.py b/blivet/populator/helpers/boot.py
index b679b3b..3d80dd2 100644
--- a/blivet/populator/helpers/boot.py
+++ b/blivet/populator/helpers/boot.py
@@ -54,6 +54,16 @@ class MacEFIFormatPopulator(BootFormatPopulator):
_type_specifier = "macefi"
_base_type_specifier = "hfsplus"
+ @classmethod
+ def match(cls, data, device):
+ fmt = formats.get_format(cls._type_specifier)
+ try:
+ return (super().match(data, device) and
+ device.parted_partition.name == fmt.name)
+ except AttributeError:
+ # just in case device.parted_partition has no name attr
+ return False
+
class AppleBootFormatPopulator(BootFormatPopulator):
_type_specifier = "appleboot"

@ -1,34 +0,0 @@
From 7a9697eae467fc0ed44022d948f70f30d156d69e Mon Sep 17 00:00:00 2001
From: Adam Williamson <adamw@fedoraproject.org>
Date: Fri, 11 Nov 2016 12:36:12 -0500
Subject: [PATCH] Fix "unknown" SAS device sysfs parsing.
Since the regexp matches the device type as well as the identifying
numbers, we need to pull the numbers from match groups 2 and 3, not 1
and 2.
Resolves: rhbz#1394026
Signed-off-by: Peter Jones <pjones@redhat.com>
---
blivet/devicelibs/edd.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index 7a1a1e2..51b7ed8 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -316,8 +316,8 @@ class EddEntry(object):
self.sas_address = int(sas_match.group(1), base=16)
self.sas_lun = int(sas_match.group(2), base=16)
elif unknown_match:
- self.sas_address = int(unknown_match.group(1), base=16)
- self.sas_lun = int(unknown_match.group(2), base=16)
+ self.sas_address = int(unknown_match.group(2), base=16)
+ self.sas_lun = int(unknown_match.group(3), base=16)
else:
log.warning("edd: can not match interface for %s: %s",
self.sysfspath, interface)
--
2.7.4

@ -0,0 +1,76 @@
From e6369b8986953e3d0eba93cc024a2219320fa42c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Tue, 22 Oct 2019 14:52:17 +0200
Subject: [PATCH 1/2] Revert "FBA DASD should use the msdos disk label type"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This reverts commit 41627e946cafc9341fd90c6713830aa67ebe28e7.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
blivet/platform.py | 21 ++++-----------------
python-blivet.spec | 2 +-
2 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/blivet/platform.py b/blivet/platform.py
index 4772b35d..9100487e 100644
--- a/blivet/platform.py
+++ b/blivet/platform.py
@@ -22,11 +22,6 @@
import logging
log = logging.getLogger("blivet")
-import gi
-gi.require_version("BlockDev", "2.0")
-
-from gi.repository import BlockDev as blockdev
-
import parted
from . import arch
@@ -356,20 +351,12 @@ class S390(Platform):
return [PartSpec(mountpoint="/boot", size=Size("1GiB"),
weight=self.weight(mountpoint="/boot"), lv=False)]
- def best_disklabel_type(self, device):
- """The best disklabel type for the specified device."""
- if flags.testing:
- return self.default_disklabel_type
-
- # the device is FBA DASD
- if blockdev.s390.dasd_is_fba(device.path):
- return "msdos"
- # the device is DASD
- elif parted.Device(path=device.path).type == parted.DEVICE_DASD:
+ def required_disklabel_type(self, device_type):
+ """The required disklabel type for the specified device type."""
+ if device_type == parted.DEVICE_DASD:
return "dasd"
- # other types of devices
- return super(S390, self).best_disklabel_type(device)
+ return super(S390, self).required_disklabel_type(device_type)
class ARM(Platform):
diff --git a/python-blivet.spec b/python-blivet.spec
index 1481bf84..0c3392c9 100644
--- a/python-blivet.spec
+++ b/python-blivet.spec
@@ -19,7 +19,7 @@ Source0: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver
%global partedver 1.8.1
%global pypartedver 3.10.4
%global utillinuxver 2.15.1
-%global libblockdevver 2.6
+%global libblockdevver 2.1
%global libbytesizever 0.3
%global pyudevver 0.18
--
2.20.1

@ -1,28 +0,0 @@
From cf32290dd3a0561585837fddfcdb08b3389f356a Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 26 Oct 2016 16:17:46 -0700
Subject: [PATCH 1/4] Use correct type for port in GVariant tuple
The type is `(sqa{sv})`, where `q` (according to the docs) is
"an unsigned 16 bit integer", so this should be an int, not a
string.
---
blivet/iscsi.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 8773509..14c4b9a 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -369,7 +369,7 @@ class iSCSI(object):
if r_password:
auth_info["r_password"] = GLib.Variant("s", r_password)
- args = GLib.Variant("(sqa{sv})", (ipaddr, port, auth_info))
+ args = GLib.Variant("(sqa{sv})", (ipaddr, int(port), auth_info))
nodes, _n_nodes = self._call_initiator_method("DiscoverSendTargets", args)
found_nodes = _to_node_infos(nodes)
--
2.7.4

@ -1,84 +0,0 @@
From 32ba44edfa5cd4424154396b877cd5ad75e8c999 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Tue, 22 Nov 2016 08:52:34 +0100
Subject: [PATCH 2/2] Do not run FS check as part of updating (re)size info
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the FS tools tell us the minimum size of the file system we are supposed to
(see rhbz#1170803) consider that an evidence of the file system being in a good
enough shape to be resized.
Resolves: rhbz#1170803
---
blivet/formats/fs.py | 44 ++++++++++++++++++--------------------------
1 file changed, 18 insertions(+), 26 deletions(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 203926e..100bfce 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -296,8 +296,6 @@ class FS(DeviceFormat):
""" Update this filesystem's current and minimum size (for resize). """
# This method ensures:
- # * If there are fsck errors, self._resizable is False.
- # Note that if there is no fsck program, no errors are possible.
# * If it is not possible to obtain the current size of the
# filesystem by interrogating the filesystem, self._resizable
# is False (and self._size is 0).
@@ -317,32 +315,26 @@ class FS(DeviceFormat):
self._min_instance_size = Size(0)
self._resizable = self.__class__._resizable
- # We can't allow resize if the filesystem has errors.
+ # try to gather current size info
+ self._size = Size(0)
try:
- self.do_check()
- except FSError:
+ if self._info.available:
+ self._current_info = self._info.do_task()
+ except FSError as e:
+ log.info("Failed to obtain info for device %s: %s", self.device, e)
+ try:
+ self._size = self._size_info.do_task()
+ except (FSError, NotImplementedError) as e:
+ log.warning("Failed to obtain current size for device %s: %s", self.device, e)
+ else:
+ self._min_instance_size = self._size
+
+ # We absolutely need a current size to enable resize. To shrink the
+ # filesystem we need a real minimum size provided by the resize
+ # tool. Failing that, we can default to the current size,
+ # effectively disabling shrink.
+ if self._size == Size(0):
self._resizable = False
- raise
- finally:
- # try to gather current size info anyway
- self._size = Size(0)
- try:
- if self._info.available:
- self._current_info = self._info.do_task()
- except FSError as e:
- log.info("Failed to obtain info for device %s: %s", self.device, e)
- try:
- self._size = self._size_info.do_task()
- self._min_instance_size = self._size
- except (FSError, NotImplementedError) as e:
- log.warning("Failed to obtain current size for device %s: %s", self.device, e)
-
- # We absolutely need a current size to enable resize. To shrink the
- # filesystem we need a real minimum size provided by the resize
- # tool. Failing that, we can default to the current size,
- # effectively disabling shrink.
- if self._size == Size(0):
- self._resizable = False
try:
result = self._minsize.do_task()
--
2.7.5

@ -0,0 +1,497 @@
From cbf2890b7be57e159e0890da4fded5062152f191 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Tue, 22 Oct 2019 14:52:36 +0200
Subject: [PATCH 2/2] Revert "Require BlockDev 2.0 in the gi.require_version()
call"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This reverts commit 778ca84050289f4a4c27857d923d6e3aea4919fc.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
blivet/__init__.py | 2 +-
blivet/devicefactory.py | 2 +-
blivet/devicelibs/lvm.py | 2 +-
blivet/devices/btrfs.py | 2 +-
blivet/devices/disk.py | 2 +-
blivet/devices/dm.py | 2 +-
blivet/devices/loop.py | 2 +-
blivet/devices/lvm.py | 2 +-
blivet/devices/md.py | 2 +-
blivet/devices/partition.py | 2 +-
blivet/devicetree.py | 2 +-
blivet/formats/__init__.py | 2 +-
blivet/formats/luks.py | 2 +-
blivet/formats/lvmpv.py | 2 +-
blivet/formats/mdraid.py | 2 +-
blivet/formats/swap.py | 2 +-
blivet/osinstall.py | 2 +-
blivet/partitioning.py | 2 +-
blivet/populator/helpers/disk.py | 2 +-
blivet/populator/helpers/dmraid.py | 2 +-
blivet/populator/helpers/loop.py | 2 +-
blivet/populator/helpers/luks.py | 2 +-
blivet/populator/helpers/lvm.py | 2 +-
blivet/populator/helpers/mdraid.py | 2 +-
blivet/populator/helpers/partition.py | 2 +-
blivet/populator/populator.py | 2 +-
blivet/static_data/lvm_info.py | 2 +-
blivet/static_data/mpath_info.py | 2 +-
blivet/tasks/availability.py | 2 +-
blivet/tasks/lukstasks.py | 2 +-
blivet/tasks/pvtask.py | 2 +-
blivet/util.py | 2 +-
blivet/zfcp.py | 2 +-
python-blivet.spec | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 1325e540..d5105842 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -75,7 +75,7 @@ log_bd_message = lambda level, msg: program_log.info(msg)
import gi
gi.require_version("GLib", "2.0")
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
# initialize the libblockdev library
from gi.repository import GLib
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 5b680668..5f486aab 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -38,7 +38,7 @@ from .size import Size
from .static_data import luks_data
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 24adf9a0..352f67a2 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -27,7 +27,7 @@ from collections import namedtuple
import itertools
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index c5cb21f7..35a2b099 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -24,7 +24,7 @@ import copy
import tempfile
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py
index 1136a535..acf31eed 100644
--- a/blivet/devices/disk.py
+++ b/blivet/devices/disk.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/dm.py b/blivet/devices/dm.py
index a0350b24..e7efddfb 100644
--- a/blivet/devices/dm.py
+++ b/blivet/devices/dm.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/loop.py b/blivet/devices/loop.py
index 78f88d7d..fcef161d 100644
--- a/blivet/devices/loop.py
+++ b/blivet/devices/loop.py
@@ -20,7 +20,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 72a2d395..39c6f342 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -30,7 +30,7 @@ from functools import wraps
from enum import Enum
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/md.py b/blivet/devices/md.py
index 891805aa..3006236e 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -23,7 +23,7 @@ import os
import six
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 4c175403..66f768d2 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -24,7 +24,7 @@ import parted
import _ped
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 805f6a04..8057f7e7 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -25,7 +25,7 @@ import pprint
import re
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index f60402fe..6d4eaf39 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -22,7 +22,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/formats/luks.py b/blivet/formats/luks.py
index d8db8dd5..4ad8252a 100644
--- a/blivet/formats/luks.py
+++ b/blivet/formats/luks.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/formats/lvmpv.py b/blivet/formats/lvmpv.py
index 260cc0bd..b2f70cdc 100644
--- a/blivet/formats/lvmpv.py
+++ b/blivet/formats/lvmpv.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/formats/mdraid.py b/blivet/formats/mdraid.py
index 383160a3..ee7e887a 100644
--- a/blivet/formats/mdraid.py
+++ b/blivet/formats/mdraid.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/formats/swap.py b/blivet/formats/swap.py
index 46dc980f..185fda53 100644
--- a/blivet/formats/swap.py
+++ b/blivet/formats/swap.py
@@ -29,7 +29,7 @@ from . import DeviceFormat, register_device_format
from ..size import Size
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index a4f9535f..485e774c 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -26,7 +26,7 @@ import stat
import time
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index dcc7ce80..b7b2617c 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -25,7 +25,7 @@ from decimal import Decimal
import functools
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
import parted
diff --git a/blivet/populator/helpers/disk.py b/blivet/populator/helpers/disk.py
index e937128b..9313f766 100644
--- a/blivet/populator/helpers/disk.py
+++ b/blivet/populator/helpers/disk.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/populator/helpers/dmraid.py b/blivet/populator/helpers/dmraid.py
index 5db42196..987caec3 100644
--- a/blivet/populator/helpers/dmraid.py
+++ b/blivet/populator/helpers/dmraid.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/populator/helpers/loop.py b/blivet/populator/helpers/loop.py
index 99fc4bb5..33bb3423 100644
--- a/blivet/populator/helpers/loop.py
+++ b/blivet/populator/helpers/loop.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
from ... import udev
diff --git a/blivet/populator/helpers/luks.py b/blivet/populator/helpers/luks.py
index 433cc06e..d27089a6 100644
--- a/blivet/populator/helpers/luks.py
+++ b/blivet/populator/helpers/luks.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/populator/helpers/lvm.py b/blivet/populator/helpers/lvm.py
index 10ef1646..2a985adc 100644
--- a/blivet/populator/helpers/lvm.py
+++ b/blivet/populator/helpers/lvm.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py
index 998e8de9..5542cc4d 100644
--- a/blivet/populator/helpers/mdraid.py
+++ b/blivet/populator/helpers/mdraid.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/populator/helpers/partition.py b/blivet/populator/helpers/partition.py
index 73b15f11..d977ea49 100644
--- a/blivet/populator/helpers/partition.py
+++ b/blivet/populator/helpers/partition.py
@@ -23,7 +23,7 @@
import copy
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
from ... import udev
diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py
index 7a6a4ae9..84c1d33d 100644
--- a/blivet/populator/populator.py
+++ b/blivet/populator/populator.py
@@ -26,7 +26,7 @@ import copy
import parted
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/static_data/lvm_info.py b/blivet/static_data/lvm_info.py
index 89e1b8e1..f8965f15 100644
--- a/blivet/static_data/lvm_info.py
+++ b/blivet/static_data/lvm_info.py
@@ -21,7 +21,7 @@
#
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/static_data/mpath_info.py b/blivet/static_data/mpath_info.py
index 71bf17e1..c9ca8a30 100644
--- a/blivet/static_data/mpath_info.py
+++ b/blivet/static_data/mpath_info.py
@@ -20,7 +20,7 @@
import os
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/tasks/availability.py b/blivet/tasks/availability.py
index 354a9ee1..c7f58b87 100644
--- a/blivet/tasks/availability.py
+++ b/blivet/tasks/availability.py
@@ -25,7 +25,7 @@ from distutils.spawn import find_executable
from six import add_metaclass
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/tasks/lukstasks.py b/blivet/tasks/lukstasks.py
index d32fe978..7814454f 100644
--- a/blivet/tasks/lukstasks.py
+++ b/blivet/tasks/lukstasks.py
@@ -20,7 +20,7 @@
# Red Hat Author(s): Anne Mulhern <amulhern@redhat.com>
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/tasks/pvtask.py b/blivet/tasks/pvtask.py
index a96d380d..2cb07a34 100644
--- a/blivet/tasks/pvtask.py
+++ b/blivet/tasks/pvtask.py
@@ -21,7 +21,7 @@
# Red Hat Author(s): Vojtěch Trefný <vtrefny@redhat.com>
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/util.py b/blivet/util.py
index 57f6372f..ba81bb6e 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -22,7 +22,7 @@ from enum import Enum
from .errors import DependencyError
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/blivet/zfcp.py b/blivet/zfcp.py
index 2381599c..0074c5dc 100644
--- a/blivet/zfcp.py
+++ b/blivet/zfcp.py
@@ -26,7 +26,7 @@ from .i18n import _
from .util import stringize, unicodeize
import gi
-gi.require_version("BlockDev", "2.0")
+gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
diff --git a/python-blivet.spec b/python-blivet.spec
index 0c3392c9..5e7bf8a1 100644
--- a/python-blivet.spec
+++ b/python-blivet.spec
@@ -19,7 +19,7 @@ Source0: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver
%global partedver 1.8.1
%global pypartedver 3.10.4
%global utillinuxver 2.15.1
-%global libblockdevver 2.1
+%global libblockdevver 1.9
%global libbytesizever 0.3
%global pyudevver 0.18
--
2.20.1

@ -1,122 +0,0 @@
From 5eaadad9218210ed2a616104a6e56665c38f9277 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 26 Oct 2016 20:42:53 -0700
Subject: [PATCH 2/4] iSCSI: Store auth info in NodeInfo tuples
This seems to have been overlooked in 9280eff7 . When we were
using libiscsi, the `node` objects were `PyIscsiNode` instances
(I think), with `getAuth` and `setAuth` methods that let you
read and set the authentication information for the node. We
used `getAuth` in `iScsiDiskDevice.dracut_setup_args()` to
include the auth information in the `netroot` arg. anaconda
also expects the `node` attribute of an `iScsiDiskDevice`
instance to be a `PyIscsiNode` and calls its `getAuth` method
to populate the kickstart data for the node.
When we ditched libiscsi and turned the `node` objects into
`NodeInfo` namedtuples, this was missed and not handled at all.
Both blivet and anaconda are still trying to call methods that
these node objects just don't have any more. The blivet call
was changed from `getAuth()` to `get_auth()` in 4e8f941b , but
apparently whoever did that didn't notice that neither method
exists at all for these objects any more...
Here's my attempt to fix this: basically, just stuff the auth
information into the `NodeInfo` instances when we log in. I
thought of several different ways to do this, but I think in
the end it always has to boil down to storing the auth details
on the node object when we log in, so let's just go with the
obvious way. We could mimic the `getAuth` and `setAuth` methods
pretty easily for 'compatibility', but it doesn't seem worth
it, we'd probably still be missing other bits of the interface.
---
blivet/devices/disk.py | 11 +++++------
blivet/iscsi.py | 33 +++++++++++++++++++++++++++++++--
2 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py
index 6880e1e..acf31ee 100644
--- a/blivet/devices/disk.py
+++ b/blivet/devices/disk.py
@@ -452,12 +452,11 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
address = "[%s]" % address
netroot = "netroot=iscsi:"
- auth = self.node.get_auth()
- if auth:
- netroot += "%s:%s" % (auth.username, auth.password)
- if len(auth.reverse_username) or len(auth.reverse_password):
- netroot += ":%s:%s" % (auth.reverse_username,
- auth.reverse_password)
+ if self.node.username and self.node.password:
+ netroot += "%s:%s" % (self.node.username, self.node.password)
+ if self.node.r_username and self.node.r_password:
+ netroot += ":%s:%s" % (self.node.r_username,
+ self.node.r_password)
iface_spec = ""
if self.nic != "default":
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 14c4b9a..1969fc8 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -66,10 +66,31 @@ def has_iscsi():
return True
-NodeInfo = namedtuple("NodeInfo", ["name", "tpgt", "address", "port", "iface"])
TargetInfo = namedtuple("TargetInfo", ["ipaddr", "port"])
+class NodeInfo(object):
+ """Simple representation of node information."""
+ def __init__(self, name, tpgt, address, port, iface):
+ self.name = name
+ self.tpgt = tpgt
+ self.address = address
+ self.port = port
+ self.iface = iface
+ # These get set by log_into_node, but *NOT* _login
+ self.username = None
+ self.password = None
+ self.r_username = None
+ self.r_password = None
+
+ @property
+ def conn_info(self):
+ """The 5-tuple of connection info (no auth info). This form
+ is useful for interacting with storaged.
+ """
+ return (self.name, self.tpgt, self.address, self.port, self.iface)
+
+
class LoginInfo(object):
def __init__(self, node, logged_in):
self.node = node
@@ -239,7 +260,7 @@ class iSCSI(object):
extra = dict()
extra["node.startup"] = GLib.Variant("s", "automatic")
- args = GLib.Variant("(sisisa{sv})", tuple(list(node_info) + [extra]))
+ args = GLib.Variant("(sisisa{sv})", node_info.conn_info + (extra,))
self._call_initiator_method("Login", args)
@storaged_iscsi_required(critical=False, eval_mode=util.EvalMode.onetime)
@@ -414,6 +435,14 @@ class iSCSI(object):
node.name, node.address, node.port, node.iface)
if not self._mark_node_active(node):
log.error("iSCSI: node not found among discovered")
+ if username:
+ node.username = username
+ if password:
+ node.password = password
+ if r_username:
+ node.r_username = r_username
+ if r_password:
+ node.r_password = r_password
except safe_dbus.DBusCallError as e:
msg = str(e)
log.warning("iSCSI: could not log into %s: %s", node.name, msg)
--
2.7.4

@ -0,0 +1,34 @@
From 42d465514031eb083cac591327436ed6bca2b94c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Tue, 22 Oct 2019 15:07:01 +0200
Subject: [PATCH] Revert "Adapt to logging module name change"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This reverts commit c367d62a516e541ad28636c8259321f1c53417ce.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
blivet/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index d5105842..ecaedad8 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -124,7 +124,7 @@ def enable_installer_mode():
from pyanaconda.constants import ROOT_PATH # pylint: disable=redefined-outer-name,no-name-in-module
_storage_root = _sysroot = ROOT_PATH
- from pyanaconda.anaconda_logging import program_log_lock
+ from pyanaconda.anaconda_log import program_log_lock
util.program_log_lock = program_log_lock
flags.installer_mode = True
--
2.20.1

@ -1,71 +0,0 @@
From 4d0b9f8338bfc1634340bb191058b888094ca81d Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 27 Oct 2016 15:17:29 -0700
Subject: [PATCH 3/4] iSCSI: turn `iscsi.initiator_set` into a property
The iSCSI class has an `initiator_set` attribute whose meaning
feels a bit slippery these days. It has always been set to
True in `__init__()` if iBFT is active, right after we get the
initiator name from the firmware. Prior to 9280eff7, it was
also set true by `startup()` after it wrote out INITIATOR_FILE.
In 9280eff7, that was removed, without any kind of replacement.
Now `initiator_set` will never be True unless iBFT is being
used.
This is a problem because `iscsi.write()` checks if it's True,
and immediately bails if it isn't. The result of this is that
when you do an iSCSI install with anaconda, the contents of
`/var/lib/iscsi` from the installer environment are no longer
copied in the installed system.
vpodzime asked for this fix: making it into a property which
returns True if `self._initiator` is set, otherwise False.
I used `== ""` as the test because that's what we use in other
places, though in my own code I'd normally just use
`if self._initiator:`.
Note that `if iscsi.initiator_set:` and `if iscsi.initiator:`
are not quite equivalent, as the `initiator` property will try
and read the initiator name from storaged if `self._initiator`
is not set, but `initiator_set` will not. This best matches
the previous behaviour, but I'm not sure if all of this makes
any logical sense when considered from scratch.
---
blivet/iscsi.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 1969fc8..b221fd4 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -149,7 +149,6 @@ class iSCSI(object):
# This list contains nodes discovered through iBFT (or other firmware)
self.ibft_nodes = []
self._initiator = ""
- self.initiator_set = False
self.started = False
self.ifaces = {}
@@ -159,7 +158,6 @@ class iSCSI(object):
try:
initiatorname = self._call_initiator_method("GetFirmwareInitiatorName")[0]
self._initiator = initiatorname
- self.initiator_set = True
except Exception: # pylint: disable=broad-except
log_exception_info(fmt_str="failed to get initiator name from iscsi firmware")
@@ -197,6 +195,11 @@ class iSCSI(object):
connection=self._connection)
@property
+ def initiator_set(self):
+ """True if initiator is set at our level."""
+ return self._initiator != ""
+
+ @property
@storaged_iscsi_required(critical=False, eval_mode=util.EvalMode.onetime)
def initiator(self):
if self._initiator != "":
--
2.7.4

@ -1,45 +0,0 @@
From 274b0bfb6aa923a82662e754030ebce4d8694901 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Thu, 3 Nov 2016 12:53:03 +0100
Subject: [PATCH 4/4] Add device symlinks to the PVs dictionary for MD RAID PVs
(#1389130)
Otherwise if the symlink is used to search for the PV info, it's not found and
everything on that PV is ignored which leads e.g. to issues when removing the PV
(as described in the bug) and others.
---
blivet/static_data/lvm_info.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/blivet/static_data/lvm_info.py b/blivet/static_data/lvm_info.py
index ed2e995..4f5a274 100644
--- a/blivet/static_data/lvm_info.py
+++ b/blivet/static_data/lvm_info.py
@@ -57,7 +57,23 @@ class PVsInfo(object):
def cache(self):
if self._pvs_cache is None:
pvs = blockdev.lvm.pvs()
- self._pvs_cache = dict((pv.pv_name, pv) for pv in pvs) # pylint: disable=attribute-defined-outside-init
+ self._pvs_cache = dict() # pylint: disable=attribute-defined-outside-init
+ for pv in pvs:
+ self._pvs_cache[pv.pv_name] = pv
+ # TODO: add get_all_device_symlinks() and resolve_device_symlink() functions to
+ # libblockdev and use them here
+ if pv.pv_name.startswith("/dev/md/"):
+ try:
+ md_node = blockdev.md.node_from_name(pv.pv_name[len("/dev/md/"):])
+ self._pvs_cache["/dev/" + md_node] = pv
+ except blockdev.MDRaidError:
+ pass
+ elif pv.pv_name.startswith("/dev/md"):
+ try:
+ md_named_dev = blockdev.md.name_from_node(pv.pv_name[len("/dev/"):])
+ self._pvs_cache["/dev/md/" + md_named_dev] = pv
+ except blockdev.MDRaidError:
+ pass
return self._pvs_cache
--
2.7.4

@ -0,0 +1,52 @@
From 7a4cfbeb1f971d4968248a6002a365835f11c72e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Wed, 23 Oct 2019 00:21:02 +0200
Subject: [PATCH] Backport lvm thin pool metadata size functions from BlockDev
2.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Those are included only in BlockDev >= 2.0 API (libblockdev>=2.1), but
we don't have luxury of such new version. Since it's just one short
function and two constants, "copy" (translating from C) them directly
into blivet/devices/lvm.py.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
blivet/devices/lvm.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 39c6f342..94894272 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -56,6 +56,22 @@ from .dm import DMDevice
from .md import MDRaidArrayDevice
from .cache import Cache, CacheStats, CacheRequest
+# loose backport from BlockDev 2.0 interface
+LVM_DEFAULT_CHUNK_SIZE = 65536
+LVM_MIN_THPOOL_MD_SIZE = 2 * 2**20 # 2 MiB
+
+def get_thpool_meta_size(pool_size, block_size, max_thins):
+
+ command = ["thin_metadata_size",
+ "-ub", "-n",
+ "-b", str(int(block_size)),
+ "-s", str(int(pool_size)),
+ "-m", str(int(max_thins))]
+ (rc, out) = util.run_program_and_capture_output(command)
+ if rc:
+ raise Exception("thin_metadata_size failed with %d" % rc)
+ return max(int(out), LVM_MIN_THPOOL_MD_SIZE)
+
class LVPVSpec(object):
""" Class for specifying how much space on a PV should be allocated for some LV """
--
2.20.1

@ -0,0 +1,36 @@
From 2aeba92531b6146a760440f857d526ca7c19053e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Wed, 23 Oct 2019 00:23:10 +0200
Subject: [PATCH 2/2] Use local backport of BlockDev 2.0 interface
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
blivet/devices/lvm.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 15ddef74..da3dc853 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -1541,10 +1541,10 @@ class LVMThinPoolMixin(object):
# we need to know chunk size to calculate recommended metadata size
if self._chunk_size == 0:
- self._chunk_size = Size(blockdev.LVM_DEFAULT_CHUNK_SIZE)
+ self._chunk_size = Size(LVM_DEFAULT_CHUNK_SIZE)
log.debug("Using default chunk size: %s", self._chunk_size)
- self._metadata_size = Size(blockdev.lvm.get_thpool_meta_size(self._size,
+ self._metadata_size = Size( get_thpool_meta_size(self._size,
self._chunk_size,
100)) # snapshots
log.debug("Recommended metadata size: %s", self._metadata_size)
--
2.20.1

Binary file not shown.

Binary file not shown.

@ -1,7 +1,7 @@
Summary: A python module for system storage configuration
Name: python-blivet
Url: http://fedoraproject.org/wiki/blivet
Version: 2.1.6
Version: 2.1.11
#%%global prerelease .b1
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
@ -13,15 +13,13 @@ Group: System Environment/Libraries
%global realversion %{version}%{?prerelease}
Source0: http://github.com/rhinstaller/blivet/archive/%{realname}-%{realversion}.tar.gz
Patch0: 0001-Use-correct-type-for-port-in-GVariant-tuple.patch
Patch1: 0002-iSCSI-Store-auth-info-in-NodeInfo-tuples.patch
Patch2: 0003-iSCSI-turn-iscsi.initiator_set-into-a-property.patch
Patch3: 0004-Add-device-symlinks-to-the-PVs-dictionary-for-MD-RAI.patch
Patch4: 0001-Fix-detection-of-macefi-partitions-1393846.patch
Patch5: 0001-Fix-unknown-SAS-device-sysfs-parsing.patch
Patch6: 0001-Change-how-we-run-e2fsck-to-check-ext-filesystems.patch
Patch7: 0002-Do-not-run-FS-check-as-part-of-updating-re-size-info.patch
Patch8: 0001-Fix-AttributeError-in-fsminsize-1502587.patch
Patch0: 0001-Fix-AttributeError-in-fsminsize-1502587.patch
# make it compatible with fc25
Patch1: 0001-Revert-FBA-DASD-should-use-the-msdos-disk-label-type.patch
Patch2: 0002-Revert-Require-BlockDev-2.0-in-the-gi.require_versio.patch
Patch3: 0003-Revert-Adapt-to-logging-module-name-change.patch
Patch4: 0004-Backport-lvm-thin-pool-metadata-size-functions-from-.patch
Patch5: 0005-Use-local-backport-of-BlockDev-2.0-interface.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -77,9 +75,6 @@ configuration.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
rm -rf %{py3dir}
cp -a . %{py3dir}

Loading…
Cancel
Save