diff --git a/0001-force-lvm-plugin.patch b/0001-force-lvm-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f9d9a09d8f9111933cfe130635f3090491f529b --- /dev/null +++ b/0001-force-lvm-plugin.patch @@ -0,0 +1,32 @@ +From 2f90040ff66eacc9715e370cd49ffb72d8d1f36f Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 11 Jul 2018 15:36:24 +0200 +Subject: [PATCH] Force command line based libblockdev LVM plugin + +--- + blivet/__init__.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/blivet/__init__.py b/blivet/__init__.py +index c5a75bb8..cb759173 100644 +--- a/blivet/__init__.py ++++ b/blivet/__init__.py +@@ -63,11 +63,16 @@ def log_bd_message(level, msg): + from gi.repository import GLib + from gi.repository import BlockDev as blockdev + if arch.is_s390(): +- _REQUESTED_PLUGIN_NAMES = set(("lvm", "btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "s390", "nvdimm")) ++ _REQUESTED_PLUGIN_NAMES = set(("btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "s390", "nvdimm")) + else: +- _REQUESTED_PLUGIN_NAMES = set(("lvm", "btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "nvdimm")) ++ _REQUESTED_PLUGIN_NAMES = set(("btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "nvdimm")) + + _requested_plugins = blockdev.plugin_specs_from_names(_REQUESTED_PLUGIN_NAMES) ++# XXX force non-dbus LVM plugin ++lvm_plugin = blockdev.PluginSpec() ++lvm_plugin.name = blockdev.Plugin.LVM ++lvm_plugin.so_name = "libbd_lvm.so.2" ++_requested_plugins.append(lvm_plugin) + try: + # do not check for dependencies during libblockdev initializtion, do runtime + # checks instead diff --git a/0002-Fix-options-for-ISCSI-functions-1632656.patch b/0002-Fix-options-for-ISCSI-functions-1632656.patch new file mode 100644 index 0000000000000000000000000000000000000000..b482f6bc123bc83dd668a14e515b7a90fb11c12d --- /dev/null +++ b/0002-Fix-options-for-ISCSI-functions-1632656.patch @@ -0,0 +1,42 @@ +From 48d19a9835ebb6743ec03e4c9182c8cc74db4cf8 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 3 Oct 2018 14:11:08 +0200 +Subject: [PATCH] Fix options for ISCSI functions (#1632656) + +Correct mutual authentication options in UDisks are +"reverse-username" and "reverse-password". +--- + blivet/iscsi.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/blivet/iscsi.py b/blivet/iscsi.py +index b979e01c..ca51f8ed 100644 +--- a/blivet/iscsi.py ++++ b/blivet/iscsi.py +@@ -385,9 +385,9 @@ class iSCSI(object): + if password: + auth_info["password"] = GLib.Variant("s", password) + if r_username: +- auth_info["r_username"] = GLib.Variant("s", r_username) ++ auth_info["reverse-username"] = GLib.Variant("s", r_username) + if r_password: +- auth_info["r_password"] = GLib.Variant("s", r_password) ++ auth_info["reverse-password"] = GLib.Variant("s", r_password) + + args = GLib.Variant("(sqa{sv})", (ipaddr, int(port), auth_info)) + nodes, _n_nodes = self._call_initiator_method("DiscoverSendTargets", args) +@@ -423,9 +423,9 @@ class iSCSI(object): + if password: + auth_info["password"] = GLib.Variant("s", password) + if r_username: +- auth_info["r_username"] = GLib.Variant("s", r_username) ++ auth_info["reverse-username"] = GLib.Variant("s", r_username) + if r_password: +- auth_info["r_password"] = GLib.Variant("s", r_password) ++ auth_info["reverse-password"] = GLib.Variant("s", r_password) + + try: + self._login(node, auth_info) +-- +2.17.1 + diff --git a/blivet-3.1.1.tar.gz b/blivet-3.1.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ed3602fb22c49d7f291e86292f5e5b522d08c4e1 Binary files /dev/null and b/blivet-3.1.1.tar.gz differ diff --git a/fix-the-long-hostname.patch b/fix-the-long-hostname.patch new file mode 100644 index 0000000000000000000000000000000000000000..d8d23c1e510f7bfe71abe99083e6cabdc172b4ab --- /dev/null +++ b/fix-the-long-hostname.patch @@ -0,0 +1,12 @@ +diff -Nur blivet-3.1.1/blivet/devicelibs/lvm.py blivet-3.1.1-old/blivet/devicelibs/lvm.py +--- blivet-3.1.1/blivet/devicelibs/lvm.py 2019-01-26 04:29:13.358210238 -0500 ++++ blivet-3.1.1-old/blivet/devicelibs/lvm.py 2019-01-26 04:29:54.489210238 -0500 +@@ -201,7 +201,7 @@ + # minus the number of hyphens, and possibly minus up to another 8 characters + # in some unspecified set of situations. Instead of figuring all of that out, + # no one gets a vg or lv name longer than, let's say, 55. +- if len(name) > 55: ++ if len(name) > 71: + return False + + return True diff --git a/python-blivet.spec b/python-blivet.spec new file mode 100644 index 0000000000000000000000000000000000000000..364b18e0befffba87d4277c52806a1a345511448 --- /dev/null +++ b/python-blivet.spec @@ -0,0 +1,120 @@ +Name: python-blivet +Version: 3.1.1 +Release: 4 +Epoch: 1 +Summary: A python module for system storage configuration +License: LGPLv2+ +URL: https://storageapis.wordpress.com/projects/blivet +Source0: http://github.com/storaged-project/blivet/archive/blivet-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: systemd gettext python3-devel python3-setuptools + +%if %{with_python2} +BuildRequires: python2-devel python2-setuptools +%endif + +Patch0: 0001-force-lvm-plugin.patch +Patch1: 0002-Fix-options-for-ISCSI-functions-1632656.patch + +Patch9000: fix-the-long-hostname.patch + +%description +The python-blivet package is a python module for examining and modifying +storage configuration. + +%package -n blivet-data +Summary: Data packages for python-blivet +Conflicts: python-blivet < 1:2.0.0 python3-blivet < 1:2.0.0 + +%description -n blivet-data +Data packages for python-blivet. + +%package -n python3-blivet +Summary: python3 package for blivet +Requires: python3 python3-six python3-pyudev >= 0.18 python3-pyparted >= 3.10.4 +Requires: libselinux-python3 python3-blockdev >= 2.19 parted >= 1.8.1 +Requires: python3-bytesize >= 0.3 util-linux >= 2.15.1 lsof python3-gobject-base +Requires: systemd-udev blivet-data = %{epoch}:%{version}-%{release} +Recommends: libblockdev-btrfs >= 2.19 libblockdev-crypto >= 2.19 libblockdev-dm >= 2.19 +Recommends: libblockdev-fs >= 2.19 libblockdev-kbd >= 2.19 libblockdev-loop >= 2.19 +Recommends: libblockdev-lvm >= 2.19 libblockdev-mdraid >= 2.19 libblockdev-mpath >= 2.19 +Recommends: libblockdev-nvdimm >= 2.19 libblockdev-part >= 2.19 libblockdev-swap >= 2.19 +Recommends: libblockdev-s390 >= 2.19 +%{?python_provide:%python_provide python3-blivet} +Obsoletes: blivet-data < 1:2.0.0 +%if %{without python2} +Obsoletes: python2-blivet < 1:2.0.2-2 python-blivet < 1:2.0.2-2 +%else +Obsoletes: python-blivet < 1:2.0.0 +%endif + +%description -n python3-blivet +python3 package for blivet + +%if %{with python2} +%package -n python2-blivet +Summary: python2 package for blivet +Requires: python2 python2-six python2-pyudev >= 0.18 python2-pyparted >= 3.10.4 +Requires: python2-libselinux python2-blockdev >= 2.19 parted >= 1.8.1 +Requires: python2-bytesize >= 0.3 util-linux >= 2.15.1 lsof python2-gobject-base +Requires: systemd-udev blivet-data = %{epoch}:%{version}-%{release} python2-hawkey +Recommends: libblockdev-btrfs >= 2.19 libblockdev-crypto >= 2.19 libblockdev-dm >= 2.19 +Recommends: libblockdev-fs >= 2.19 libblockdev-kbd >= 2.19 libblockdev-loop >= 2.19 +Recommends: libblockdev-lvm >= 2.19 libblockdev-mdraid >= 2.19 libblockdev-mpath >= 2.19 +Recommends: libblockdev-nvdimm >= 2.19 libblockdev-part >= 2.19 libblockdev-swap >= 2.19 +Recommends: libblockdev-s390 >= 2.19 +%{?python_provide:%python_provide python2-blivet} +Obsoletes: blivet-data < 1:2.0.0 python-blivet < 1:2.0.0 + +%description -n python2-blivet +python2 package for blivet +%endif + +%package_help + +%prep +%autosetup -n blivet-blivet-%{version} -p1 + +%build +%{?with_python2:make PYTHON=%{__python2}} +%{?with_python3:make PYTHON=%{__python3}} + +%install +%{?with_python2:make PYTHON=%{__python2} DESTDIR=%{buildroot} install} +%{?with_python3:make PYTHON=%{__python3} DESTDIR=%{buildroot} install} + +%files -n blivet-data +%defattr(-,root,root) +%{_sysconfdir}/dbus-1/system.d/* +%{_libexecdir}/* +%{_unitdir}/* +%{_datadir}/dbus-1/system-services/* + +%files -n python3-blivet +%defattr(-,root,root) +%license COPYING +%doc examples +%{python3_sitelib}/* + +%if %{with python2} +%files -n python2-blivet +%defattr(-,root,root) +%license COPYING +%doc examples +%{python2_sitelib}/* +%endif + +%files help +%defattr(-,root,root) +%doc README + +%changelog +* Sun Dec 29 2019 openEuler Buildteam - 3.1.1-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:optimization the spec + +* Wed Oct 23 2019 openEuler Buildteam - 3.1.1-3 +- Package init