From 3668c70c583e0b11ecbcda0a4bb9f5e2d40d480a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 14 2020 01:49:52 +0000 Subject: import python-blivet-3.2.2-3.el8 --- diff --git a/SOURCES/0004-Add-extra-sleep-after-pvremove-call.patch b/SOURCES/0004-Add-extra-sleep-after-pvremove-call.patch new file mode 100644 index 0000000..96969d0 --- /dev/null +++ b/SOURCES/0004-Add-extra-sleep-after-pvremove-call.patch @@ -0,0 +1,38 @@ +From 6a62a81d326a1121a2768735e52a8e1c5e5d6f0d Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 24 Jun 2020 14:43:47 +0200 +Subject: [PATCH] Add extra sleep after pvremove call + +To give enough time for the async pvscan to finish scanning the +partition before removing it. + +Resolves: rhbz#1640601 +--- + blivet/formats/lvmpv.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/blivet/formats/lvmpv.py b/blivet/formats/lvmpv.py +index e4182adb..9f53ec6b 100644 +--- a/blivet/formats/lvmpv.py ++++ b/blivet/formats/lvmpv.py +@@ -26,6 +26,7 @@ gi.require_version("BlockDev", "2.0") + from gi.repository import BlockDev as blockdev + + import os ++import time + + from ..storage_log import log_method_call + from parted import PARTITION_LVM +@@ -137,6 +138,9 @@ class LVMPhysicalVolume(DeviceFormat): + DeviceFormat._destroy(self, **kwargs) + finally: + udev.settle() ++ # LVM now has async pvscan jobs so udev.settle doesn't help and if we try to remove ++ # the partition immediately after the pvremove we get an error ++ time.sleep(5) + + @property + def destroyable(self): +-- +2.25.4 + diff --git a/SOURCES/0005-Round-down-to-nearest-MiB-value-when-writing-ks-parittion-info.ks b/SOURCES/0005-Round-down-to-nearest-MiB-value-when-writing-ks-parittion-info.ks new file mode 100644 index 0000000..5ea1723 --- /dev/null +++ b/SOURCES/0005-Round-down-to-nearest-MiB-value-when-writing-ks-parittion-info.ks @@ -0,0 +1,48 @@ +From dc964f10d24499ea7fc90fd896a8b50c9c5e2d74 Mon Sep 17 00:00:00 2001 +From: "Samantha N. Bueno" +Date: Wed, 8 Jun 2016 13:47:40 -0400 +Subject: [PATCH] Round down to nearest MiB value when writing ks parittion + info. + +On s390x in particular, some partition alignment issue is causing fractional +sizes to be reported. Pykickstart doesn't take anything except int values for +partition info, hence the call to roundToNearest. + +This change only affects the data that is written to ks.cfg. + +Resolves: rhbz#1850670 +--- + blivet/devices/partition.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py +index 0c56a6e7..76048aed 100644 +--- a/blivet/devices/partition.py ++++ b/blivet/devices/partition.py +@@ -35,7 +35,7 @@ + from ..storage_log import log_method_call + from .. import udev + from ..formats import DeviceFormat, get_format +-from ..size import Size, MiB ++from ..size import Size, MiB, ROUND_DOWN + + import logging + log = logging.getLogger("blivet") +@@ -967,7 +967,8 @@ def populate_ksdata(self, data): + data.resize = (self.exists and self.target_size and + self.target_size != self.current_size) + if not self.exists: +- data.size = self.req_base_size.convert_to(MiB) ++ # round this to nearest MiB before doing anything else ++ data.size = self.req_base_size.round_to_nearest(MiB, rounding=ROUND_DOWN).convert_to(spec=MiB) + data.grow = self.req_grow + if self.req_grow: + data.max_size_mb = self.req_max_size.convert_to(MiB) +@@ -980,4 +981,6 @@ def populate_ksdata(self, data): + data.on_part = self.name # by-id + + if data.resize: +- data.size = self.size.convert_to(MiB) ++ # on s390x in particular, fractional sizes are reported, which ++ # cause issues when writing to ks.cfg ++ data.size = self.size.round_to_nearest(MiB, rounding=ROUND_DOWN).convert_to(spec=MiB) diff --git a/SPECS/python-blivet.spec b/SPECS/python-blivet.spec index a846bbb..80b222c 100644 --- a/SPECS/python-blivet.spec +++ b/SPECS/python-blivet.spec @@ -23,7 +23,7 @@ Version: 3.2.2 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 1%{?prerelease}%{?dist} +Release: 3%{?prerelease}%{?dist} Epoch: 1 License: LGPLv2+ Group: System Environment/Libraries @@ -34,6 +34,8 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver Patch0: 0001-force-lvm-cli.plugin Patch1: 0002-remove-btrfs-plugin.patch Patch2: 0003-Skip-test_mounting-for-filesystems-that-are-not-moun.patch +Patch3: 0004-Add-extra-sleep-after-pvremove-call.patch +Patch4: 0005-Round-down-to-nearest-MiB-value-when-writing-ks-parittion-info.ks # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -195,6 +197,14 @@ configuration. %endif %changelog +* Tue Jun 30 2020 Vojtech Trefny - 3.2.2-3 +- Round down to nearest MiB value when writing ks parittion info + Resolves: rhbz#1850670 + +* Wed Jun 24 2020 Vojtech Trefny - 3.2.2-2 +- Add extra sleep after pvremove call + Resolves: rhbz#1640601 + * Fri May 22 2020 Vojtech Trefny - 3.2.2-1 - Rebase to the latest upstream release 3.2.2 Resolves: rhbz#1714970