import CS python-blivet-3.10.0-16.el10
This commit is contained in:
parent
f545022d0e
commit
0bdc8923fc
27
0007-Fix-checking-for-NVMe-plugin-availability.patch
Normal file
27
0007-Fix-checking-for-NVMe-plugin-availability.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 7677fc312b821a9c67750220f2494d06f2357780 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Wed, 18 Sep 2024 15:30:05 +0200
|
||||||
|
Subject: [PATCH] Fix checking for NVMe plugin availability
|
||||||
|
|
||||||
|
---
|
||||||
|
blivet/nvme.py | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/blivet/nvme.py b/blivet/nvme.py
|
||||||
|
index 4309dea3..72a47070 100644
|
||||||
|
--- a/blivet/nvme.py
|
||||||
|
+++ b/blivet/nvme.py
|
||||||
|
@@ -76,6 +76,10 @@ class NVMe(object):
|
||||||
|
return False
|
||||||
|
if not hasattr(blockdev.NVMETech, "FABRICS"):
|
||||||
|
return False
|
||||||
|
+ try:
|
||||||
|
+ blockdev.nvme.is_tech_avail(blockdev.NVMETech.FABRICS, 0) # pylint: disable=no-member
|
||||||
|
+ except (blockdev.BlockDevNotImplementedError, blockdev.NVMEError):
|
||||||
|
+ return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def startup(self):
|
||||||
|
--
|
||||||
|
2.46.1
|
||||||
|
|
30
0008-Align-sizes-up-for-growable-LVs.patch
Normal file
30
0008-Align-sizes-up-for-growable-LVs.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From ad7966a456224f22729c55616f2c8c73321654c7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Thu, 24 Oct 2024 12:18:58 +0200
|
||||||
|
Subject: [PATCH] Align sizes up for growable LVs
|
||||||
|
|
||||||
|
Growable LVs usually start at minimum size so adjusting it down
|
||||||
|
can change the size below allowed minimum.
|
||||||
|
|
||||||
|
Resolves: RHEL-45180
|
||||||
|
Resolves: RHEL-45181
|
||||||
|
---
|
||||||
|
blivet/devices/lvm.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
|
||||||
|
index 661881ea..661dc6e0 100644
|
||||||
|
--- a/blivet/devices/lvm.py
|
||||||
|
+++ b/blivet/devices/lvm.py
|
||||||
|
@@ -2673,7 +2673,7 @@ class LVMLogicalVolumeDevice(LVMLogicalVolumeBase, LVMInternalLogicalVolumeMixin
|
||||||
|
if not isinstance(newsize, Size):
|
||||||
|
raise AttributeError("new size must be of type Size")
|
||||||
|
|
||||||
|
- newsize = self.vg.align(newsize)
|
||||||
|
+ newsize = self.vg.align(newsize, roundup=self.growable)
|
||||||
|
log.debug("trying to set lv %s size to %s", self.name, newsize)
|
||||||
|
# Don't refuse to set size if we think there's not enough space in the
|
||||||
|
# VG for an existing LV, since it's existence proves there is enough
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
32
0009-mod_pass_in_stratis_test.patch
Normal file
32
0009-mod_pass_in_stratis_test.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From c2177aa362d20278a0ebd5c25a776f952d83e5b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jan Pokorny <japokorn@redhat.com>
|
||||||
|
Date: Fri, 11 Oct 2024 17:17:41 +0200
|
||||||
|
Subject: [PATCH] Modified passphrase in stratis test
|
||||||
|
|
||||||
|
FIPS requires at least 8 chars long passphrase. Dummy passphrase used
|
||||||
|
in stratis test was too short causing encryption
|
||||||
|
tests with FIPS enabled to fail.
|
||||||
|
|
||||||
|
Changed passphrase.
|
||||||
|
|
||||||
|
fixes RHEL-45173, RHEL-8029
|
||||||
|
---
|
||||||
|
tests/storage_tests/devices_test/stratis_test.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/storage_tests/devices_test/stratis_test.py b/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
index 5aaa12d4..21c4d0f5 100644
|
||||||
|
--- a/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
+++ b/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
@@ -230,7 +230,7 @@ class StratisTestCaseClevis(StratisTestCaseBase):
|
||||||
|
blivet.partitioning.do_partitioning(self.storage)
|
||||||
|
|
||||||
|
pool = self.storage.new_stratis_pool(name="blivetTestPool", parents=[bd],
|
||||||
|
- encrypted=True, passphrase="abcde",
|
||||||
|
+ encrypted=True, passphrase="fipsneeds8chars",
|
||||||
|
clevis=StratisClevisConfig(pin="tang",
|
||||||
|
tang_url=self._tang_server,
|
||||||
|
tang_thumbprint=None))
|
||||||
|
--
|
||||||
|
2.45.0
|
||||||
|
|
58
0010-Fix_running_tests_in_FIPS_mode.patch
Normal file
58
0010-Fix_running_tests_in_FIPS_mode.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From cd9e137a2e33165a8af3a7e4a3d2615adcabf659 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Fri, 8 Nov 2024 09:19:45 +0100
|
||||||
|
Subject: [PATCH 1/2] Fix "Modified passphrase in stratis test"
|
||||||
|
|
||||||
|
Follow up for 68708e347ef7b2f98312c76aa80366091dd4aade, two more
|
||||||
|
places where the passphrase is too short for FIPS mode.
|
||||||
|
|
||||||
|
Resolves: RHEL-45173
|
||||||
|
---
|
||||||
|
tests/storage_tests/devices_test/stratis_test.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/storage_tests/devices_test/stratis_test.py b/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
index 21c4d0f50..9792e0618 100644
|
||||||
|
--- a/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
+++ b/tests/storage_tests/devices_test/stratis_test.py
|
||||||
|
@@ -105,7 +105,7 @@ def test_stratis_encrypted(self):
|
||||||
|
blivet.partitioning.do_partitioning(self.storage)
|
||||||
|
|
||||||
|
pool = self.storage.new_stratis_pool(name="blivetTestPool", parents=[bd],
|
||||||
|
- encrypted=True, passphrase="abcde")
|
||||||
|
+ encrypted=True, passphrase="fipsneeds8chars")
|
||||||
|
self.storage.create_device(pool)
|
||||||
|
|
||||||
|
self.storage.do_it()
|
||||||
|
@@ -260,7 +260,7 @@ def test_stratis_encrypted_clevis_tpm(self):
|
||||||
|
blivet.partitioning.do_partitioning(self.storage)
|
||||||
|
|
||||||
|
pool = self.storage.new_stratis_pool(name="blivetTestPool", parents=[bd],
|
||||||
|
- encrypted=True, passphrase="abcde",
|
||||||
|
+ encrypted=True, passphrase="fipsneeds8chars",
|
||||||
|
clevis=StratisClevisConfig(pin="tpm2"))
|
||||||
|
self.storage.create_device(pool)
|
||||||
|
|
||||||
|
|
||||||
|
From ed10d97a5257c0f4fe8a2f53b0b2f787de91c355 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Fri, 8 Nov 2024 10:02:47 +0100
|
||||||
|
Subject: [PATCH 2/2] tests: Fix writing key file for LUKS tests
|
||||||
|
|
||||||
|
Related: RHEL-45173
|
||||||
|
---
|
||||||
|
tests/storage_tests/formats_test/luks_test.py | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/tests/storage_tests/formats_test/luks_test.py b/tests/storage_tests/formats_test/luks_test.py
|
||||||
|
index 93c8d7524..b8ec229ba 100644
|
||||||
|
--- a/tests/storage_tests/formats_test/luks_test.py
|
||||||
|
+++ b/tests/storage_tests/formats_test/luks_test.py
|
||||||
|
@@ -99,6 +99,7 @@ def test_setup_keyfile(self):
|
||||||
|
|
||||||
|
with tempfile.NamedTemporaryFile(prefix="blivet_test") as temp:
|
||||||
|
temp.write(b"password2")
|
||||||
|
+ temp.flush()
|
||||||
|
|
||||||
|
# create the luks format with both passphrase and keyfile
|
||||||
|
self.fmt._key_file = temp.name
|
122
0011-Make-GPT-default-label-type-on-all-architectures.patch
Normal file
122
0011-Make-GPT-default-label-type-on-all-architectures.patch
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
From c8eff25e4c25183a76e97108d4607455cfc96ae2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Thu, 14 Nov 2024 14:53:28 +0100
|
||||||
|
Subject: [PATCH] Make GPT default label type on all architectures
|
||||||
|
|
||||||
|
Exceptions are DASD drives on s390 and 32bit ARM. Everywhere else
|
||||||
|
GPT will be default.
|
||||||
|
|
||||||
|
Resolves: RHEL-52200
|
||||||
|
---
|
||||||
|
blivet/formats/disklabel.py | 11 +++++-----
|
||||||
|
.../formats_tests/disklabel_test.py | 20 +++++++++----------
|
||||||
|
2 files changed, 16 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
|
||||||
|
index f2857f07..8b39dc79 100644
|
||||||
|
--- a/blivet/formats/disklabel.py
|
||||||
|
+++ b/blivet/formats/disklabel.py
|
||||||
|
@@ -220,12 +220,13 @@ class DiskLabel(DeviceFormat):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_platform_label_types(cls):
|
||||||
|
- label_types = ["msdos", "gpt"]
|
||||||
|
+ # always prefer gpt except for configurations below
|
||||||
|
+ label_types = ["gpt", "msdos"]
|
||||||
|
if arch.is_pmac():
|
||||||
|
label_types = ["mac"]
|
||||||
|
- # always prefer gpt on aarch64, x86_64, and EFI plats except 32-bit ARM
|
||||||
|
- elif arch.is_aarch64() or arch.is_x86(bits=64) or (arch.is_efi() and not arch.is_arm()):
|
||||||
|
- label_types = ["gpt", "msdos"]
|
||||||
|
+ # prefet msdos on 32-bit ARM
|
||||||
|
+ elif arch.is_arm():
|
||||||
|
+ label_types = ["msdos", "gpt"]
|
||||||
|
elif arch.is_s390():
|
||||||
|
label_types += ["dasd"]
|
||||||
|
|
||||||
|
@@ -254,7 +255,7 @@ class DiskLabel(DeviceFormat):
|
||||||
|
if arch.is_s390():
|
||||||
|
if blockdev.s390.dasd_is_fba(self.device):
|
||||||
|
# the device is FBA DASD
|
||||||
|
- return "msdos"
|
||||||
|
+ return "gpt"
|
||||||
|
elif self.parted_device.type == parted.DEVICE_DASD:
|
||||||
|
# the device is DASD
|
||||||
|
return "dasd"
|
||||||
|
diff --git a/tests/unit_tests/formats_tests/disklabel_test.py b/tests/unit_tests/formats_tests/disklabel_test.py
|
||||||
|
index 9f6e4542..823a3663 100644
|
||||||
|
--- a/tests/unit_tests/formats_tests/disklabel_test.py
|
||||||
|
+++ b/tests/unit_tests/formats_tests/disklabel_test.py
|
||||||
|
@@ -71,7 +71,7 @@ class DiskLabelTestCase(unittest.TestCase):
|
||||||
|
arch.is_pmac.return_value = False
|
||||||
|
arch.is_x86.return_value = False
|
||||||
|
|
||||||
|
- self.assertEqual(disklabel_class.get_platform_label_types(), ["msdos", "gpt"])
|
||||||
|
+ self.assertEqual(disklabel_class.get_platform_label_types(), ["gpt", "msdos"])
|
||||||
|
|
||||||
|
arch.is_pmac.return_value = True
|
||||||
|
self.assertEqual(disklabel_class.get_platform_label_types(), ["mac"])
|
||||||
|
@@ -100,7 +100,7 @@ class DiskLabelTestCase(unittest.TestCase):
|
||||||
|
arch.is_efi.return_value = False
|
||||||
|
|
||||||
|
arch.is_s390.return_value = True
|
||||||
|
- self.assertEqual(disklabel_class.get_platform_label_types(), ["msdos", "gpt", "dasd"])
|
||||||
|
+ self.assertEqual(disklabel_class.get_platform_label_types(), ["gpt", "msdos", "dasd"])
|
||||||
|
arch.is_s390.return_value = False
|
||||||
|
|
||||||
|
def test_label_type_size_check(self):
|
||||||
|
@@ -121,14 +121,14 @@ class DiskLabelTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
with patch.object(blivet.formats.disklabel.DiskLabel, "parted_device", new=PropertyMock(return_value=None)):
|
||||||
|
# no parted device -> no passing size check
|
||||||
|
- self.assertEqual(dl._label_type_size_check("msdos"), False)
|
||||||
|
+ self.assertEqual(dl._label_type_size_check("gpt"), False)
|
||||||
|
|
||||||
|
@patch("blivet.formats.disklabel.arch")
|
||||||
|
def test_best_label_type(self, arch):
|
||||||
|
"""
|
||||||
|
1. is always in _disklabel_types
|
||||||
|
2. is the default unless the device is too long for the default
|
||||||
|
- 3. is msdos for fba dasd on S390
|
||||||
|
+ 3. is gpt for fba dasd on S390
|
||||||
|
4. is dasd for non-fba dasd on S390
|
||||||
|
"""
|
||||||
|
dl = blivet.formats.disklabel.DiskLabel()
|
||||||
|
@@ -144,17 +144,17 @@ class DiskLabelTestCase(unittest.TestCase):
|
||||||
|
arch.is_x86.return_value = False
|
||||||
|
|
||||||
|
with patch.object(dl, '_label_type_size_check') as size_check:
|
||||||
|
- # size check passes for first type ("msdos")
|
||||||
|
+ # size check passes for first type ("gpt")
|
||||||
|
size_check.return_value = True
|
||||||
|
- self.assertEqual(dl._get_best_label_type(), "msdos")
|
||||||
|
+ self.assertEqual(dl._get_best_label_type(), "gpt")
|
||||||
|
|
||||||
|
# size checks all fail -> label type is None
|
||||||
|
size_check.return_value = False
|
||||||
|
self.assertEqual(dl._get_best_label_type(), None)
|
||||||
|
|
||||||
|
- # size check passes on second call -> label type is "gpt" (second in platform list)
|
||||||
|
+ # size check passes on second call -> label type is "msdos" (second in platform list)
|
||||||
|
size_check.side_effect = [False, True]
|
||||||
|
- self.assertEqual(dl._get_best_label_type(), "gpt")
|
||||||
|
+ self.assertEqual(dl._get_best_label_type(), "msdos")
|
||||||
|
|
||||||
|
arch.is_pmac.return_value = True
|
||||||
|
with patch.object(dl, '_label_type_size_check') as size_check:
|
||||||
|
@@ -175,10 +175,10 @@ class DiskLabelTestCase(unittest.TestCase):
|
||||||
|
size_check.return_value = True
|
||||||
|
with patch("blivet.formats.disklabel.blockdev.s390") as _s390:
|
||||||
|
_s390.dasd_is_fba.return_value = False
|
||||||
|
- self.assertEqual(dl._get_best_label_type(), "msdos")
|
||||||
|
+ self.assertEqual(dl._get_best_label_type(), "gpt")
|
||||||
|
|
||||||
|
_s390.dasd_is_fba.return_value = True
|
||||||
|
- self.assertEqual(dl._get_best_label_type(), "msdos")
|
||||||
|
+ self.assertEqual(dl._get_best_label_type(), "gpt")
|
||||||
|
|
||||||
|
_s390.dasd_is_fba.return_value = False
|
||||||
|
dl._parted_device.type = parted.DEVICE_DASD
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
108
0012-Fix-crash-on-ppc64le-with-GPT.patch
Normal file
108
0012-Fix-crash-on-ppc64le-with-GPT.patch
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
From 041b320003687fb6c740f429a079dd7b7c8f7f6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Thu, 5 Dec 2024 14:28:21 +0100
|
||||||
|
Subject: [PATCH 1/2] Fix ppc64le name in devicelibs/gpt.py
|
||||||
|
|
||||||
|
Resolves: RHEL-70153
|
||||||
|
---
|
||||||
|
blivet/devicelibs/gpt.py | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/blivet/devicelibs/gpt.py b/blivet/devicelibs/gpt.py
|
||||||
|
index 4a6d364d7..c6dbf7b23 100644
|
||||||
|
--- a/blivet/devicelibs/gpt.py
|
||||||
|
+++ b/blivet/devicelibs/gpt.py
|
||||||
|
@@ -66,7 +66,7 @@
|
||||||
|
"parisc": uuid.UUID("1aacdb3b-5444-4138-bd9e-e5c2239b2346"),
|
||||||
|
"ppc": uuid.UUID("1de3f1ef-fa98-47b5-8dcd-4a860a654d78"),
|
||||||
|
"ppc64": uuid.UUID("912ade1d-a839-4913-8964-a10eee08fbd2"),
|
||||||
|
- "ppc64el": uuid.UUID("c31c45e6-3f39-412e-80fb-4809c4980599"),
|
||||||
|
+ "ppc64le": uuid.UUID("c31c45e6-3f39-412e-80fb-4809c4980599"),
|
||||||
|
"riscv32": uuid.UUID("60d5a7fe-8e7d-435c-b714-3dd8162144e1"),
|
||||||
|
"riscv64": uuid.UUID("72ec70a6-cf74-40e6-bd49-4bda08e8f224"),
|
||||||
|
"s390": uuid.UUID("08a7acea-624c-4a20-91e8-6e0fa67d23f9"),
|
||||||
|
@@ -87,7 +87,7 @@
|
||||||
|
"parisc": uuid.UUID("d212a430-fbc5-49f9-a983-a7feef2b8d0e"),
|
||||||
|
"ppc": uuid.UUID("98cfe649-1588-46dc-b2f0-add147424925"),
|
||||||
|
"ppc64": uuid.UUID("9225a9a3-3c19-4d89-b4f6-eeff88f17631"),
|
||||||
|
- "ppc64el": uuid.UUID("906bd944-4589-4aae-a4e4-dd983917446a"),
|
||||||
|
+ "ppc64le": uuid.UUID("906bd944-4589-4aae-a4e4-dd983917446a"),
|
||||||
|
"riscv32": uuid.UUID("ae0253be-1167-4007-ac68-43926c14c5de"),
|
||||||
|
"riscv64": uuid.UUID("b6ed5582-440b-4209-b8da-5ff7c419ea3d"),
|
||||||
|
"s390": uuid.UUID("7ac63b47-b25c-463b-8df8-b4a94e6c90e1"),
|
||||||
|
@@ -108,7 +108,7 @@
|
||||||
|
"parisc": uuid.UUID("15de6170-65d3-431c-916e-b0dcd8393f25"),
|
||||||
|
"ppc": uuid.UUID("1b31b5aa-add9-463a-b2ed-bd467fc857e7"),
|
||||||
|
"ppc64": uuid.UUID("f5e2c20c-45b2-4ffa-bce9-2a60737e1aaf"),
|
||||||
|
- "ppc64el": uuid.UUID("d4a236e7-e873-4c07-bf1d-bf6cf7f1c3c6"),
|
||||||
|
+ "ppc64le": uuid.UUID("d4a236e7-e873-4c07-bf1d-bf6cf7f1c3c6"),
|
||||||
|
"riscv32": uuid.UUID("3a112a75-8729-4380-b4cf-764d79934448"),
|
||||||
|
"riscv64": uuid.UUID("efe0f087-ea8d-4469-821a-4c2a96a8386a"),
|
||||||
|
"s390": uuid.UUID("3482388e-4254-435a-a241-766a065f9960"),
|
||||||
|
@@ -129,7 +129,7 @@
|
||||||
|
"parisc": uuid.UUID("dc4a4480-6917-4262-a4ec-db9384949f25"),
|
||||||
|
"ppc": uuid.UUID("7d14fec5-cc71-415d-9d6c-06bf0b3c3eaf"),
|
||||||
|
"ppc64": uuid.UUID("2c9739e2-f068-46b3-9fd0-01c5a9afbcca"),
|
||||||
|
- "ppc64el": uuid.UUID("15bb03af-77e7-4d4a-b12b-c0d084f7491c"),
|
||||||
|
+ "ppc64le": uuid.UUID("15bb03af-77e7-4d4a-b12b-c0d084f7491c"),
|
||||||
|
"riscv32": uuid.UUID("b933fb22-5c3f-4f91-af90-e2bb0fa50702"),
|
||||||
|
"riscv64": uuid.UUID("beaec34b-8442-439b-a40b-984381ed097d"),
|
||||||
|
"s390": uuid.UUID("cd0f869b-d0fb-4ca0-b141-9ea87cc78d66"),
|
||||||
|
@@ -150,7 +150,7 @@
|
||||||
|
"parisc": uuid.UUID("5843d618-ec37-48d7-9f12-cea8e08768b2"),
|
||||||
|
"ppc": uuid.UUID("df765d00-270e-49e5-bc75-f47bb2118b09"),
|
||||||
|
"ppc64": uuid.UUID("bdb528a5-a259-475f-a87d-da53fa736a07"),
|
||||||
|
- "ppc64el": uuid.UUID("ee2b9983-21e8-4153-86d9-b6901a54d1ce"),
|
||||||
|
+ "ppc64le": uuid.UUID("ee2b9983-21e8-4153-86d9-b6901a54d1ce"),
|
||||||
|
"riscv32": uuid.UUID("cb1ee4e3-8cd0-4136-a0a4-aa61a32e8730"),
|
||||||
|
"riscv64": uuid.UUID("8f1056be-9b05-47c4-81d6-be53128e5b54"),
|
||||||
|
"s390": uuid.UUID("b663c618-e7bc-4d6d-90aa-11b756bb1797"),
|
||||||
|
@@ -171,7 +171,7 @@
|
||||||
|
"parisc": uuid.UUID("450dd7d1-3224-45ec-9cf2-a43a346d71ee"),
|
||||||
|
"ppc": uuid.UUID("7007891d-d371-4a80-86a4-5cb875b9302e"),
|
||||||
|
"ppc64": uuid.UUID("0b888863-d7f8-4d9e-9766-239fce4d58af"),
|
||||||
|
- "ppc64el": uuid.UUID("c8bfbd1e-268e-4521-8bba-bf314c399557"),
|
||||||
|
+ "ppc64le": uuid.UUID("c8bfbd1e-268e-4521-8bba-bf314c399557"),
|
||||||
|
"riscv32": uuid.UUID("c3836a13-3137-45ba-b583-b16c50fe5eb4"),
|
||||||
|
"riscv64": uuid.UUID("d2f9000a-7a18-453f-b5cd-4d32f77a7b32"),
|
||||||
|
"s390": uuid.UUID("17440e4f-a8d0-467f-a46e-3912ae6ef2c5"),
|
||||||
|
|
||||||
|
From 22740da280258990d557eb45ac90d86c4f821c05 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Thu, 5 Dec 2024 14:31:15 +0100
|
||||||
|
Subject: [PATCH 2/2] Do not crash when we fail to get discoverable GPT type
|
||||||
|
UUID
|
||||||
|
|
||||||
|
No need to raise an exception if we fail to get the type UUID for
|
||||||
|
whatever reason.
|
||||||
|
|
||||||
|
Related: RHEL-70153
|
||||||
|
---
|
||||||
|
blivet/devices/partition.py | 14 ++++++++++----
|
||||||
|
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
|
||||||
|
index 2d67be81f..89470d9fb 100644
|
||||||
|
--- a/blivet/devices/partition.py
|
||||||
|
+++ b/blivet/devices/partition.py
|
||||||
|
@@ -365,10 +365,16 @@ def part_type_uuid_req(self):
|
||||||
|
hasattr(parted.Partition, "type_uuid"))
|
||||||
|
|
||||||
|
if discoverable:
|
||||||
|
- parttype = gpt_part_uuid_for_mountpoint(self._mountpoint)
|
||||||
|
- log.debug("Discovered partition type UUID %s for mount '%s'",
|
||||||
|
- parttype, self._mountpoint)
|
||||||
|
- return parttype
|
||||||
|
+ try:
|
||||||
|
+ parttype = gpt_part_uuid_for_mountpoint(self._mountpoint)
|
||||||
|
+ except errors.GPTVolUUIDError as e:
|
||||||
|
+ log.error("Failed to get partition type UUID for mount '%s': %s",
|
||||||
|
+ self._mountpoint, str(e))
|
||||||
|
+ return None
|
||||||
|
+ else:
|
||||||
|
+ log.debug("Discovered partition type UUID %s for mount '%s'",
|
||||||
|
+ parttype, self._mountpoint)
|
||||||
|
+ return parttype
|
||||||
|
return None
|
||||||
|
|
||||||
|
@property
|
@ -0,0 +1,96 @@
|
|||||||
|
From 5fc2cfb675580cecc7e583c7c6a7fb767b4507de Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Mon, 10 Mar 2025 09:52:27 +0100
|
||||||
|
Subject: [PATCH 1/2] Set persitent allow-discards flag for newly created LUKS
|
||||||
|
devices
|
||||||
|
|
||||||
|
We are currently using the "allow-discards" in /etc/crypttab to
|
||||||
|
set the discards/fstrim feature for LUKS, but that doesn't work
|
||||||
|
for Fedora Silverblue so we need to set the persistent flag in the
|
||||||
|
LUKS header instead.
|
||||||
|
|
||||||
|
Resolves: RHEL-82884
|
||||||
|
---
|
||||||
|
blivet/formats/luks.py | 9 +++++++++
|
||||||
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/blivet/formats/luks.py b/blivet/formats/luks.py
|
||||||
|
index 92c2f0bd7..151ca985a 100644
|
||||||
|
--- a/blivet/formats/luks.py
|
||||||
|
+++ b/blivet/formats/luks.py
|
||||||
|
@@ -364,6 +364,15 @@ def _create(self, **kwargs):
|
||||||
|
def _post_create(self, **kwargs):
|
||||||
|
super(LUKS, self)._post_create(**kwargs)
|
||||||
|
|
||||||
|
+ if self.luks_version == "luks2" and flags.discard_new:
|
||||||
|
+ try:
|
||||||
|
+ blockdev.crypto.luks_set_persistent_flags(self.device,
|
||||||
|
+ blockdev.CryptoLUKSPersistentFlags.ALLOW_DISCARDS)
|
||||||
|
+ except blockdev.CryptoError as e:
|
||||||
|
+ raise LUKSError("Failed to set allow discards flag for newly created LUKS format: %s" % str(e))
|
||||||
|
+ except AttributeError:
|
||||||
|
+ log.warning("Cannot set allow discards flag: not supported")
|
||||||
|
+
|
||||||
|
try:
|
||||||
|
info = blockdev.crypto.luks_info(self.device)
|
||||||
|
except blockdev.CryptoError as e:
|
||||||
|
|
||||||
|
From 8312a8cb8a4f78529174031214d3cc137c503fbc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Wed, 12 Mar 2025 11:08:00 +0100
|
||||||
|
Subject: [PATCH 2/2] Add a simple test for setting the allow-discards flag on
|
||||||
|
LUKS
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/unit_tests/formats_tests/luks_test.py | 30 ++++++++++++++++++++-
|
||||||
|
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/unit_tests/formats_tests/luks_test.py b/tests/unit_tests/formats_tests/luks_test.py
|
||||||
|
index d4322f118..70baf8f7b 100644
|
||||||
|
--- a/tests/unit_tests/formats_tests/luks_test.py
|
||||||
|
+++ b/tests/unit_tests/formats_tests/luks_test.py
|
||||||
|
@@ -18,8 +18,17 @@ def test_create_discard_option(self):
|
||||||
|
fmt = LUKS(exists=True)
|
||||||
|
self.assertEqual(fmt.options, None)
|
||||||
|
|
||||||
|
+ fmt = LUKS(passphrase="passphrase")
|
||||||
|
+ with patch("blivet.devicelibs.crypto.calculate_luks2_max_memory", return_value=None):
|
||||||
|
+ with patch("blivet.devicelibs.crypto.get_optimal_luks_sector_size", return_value=0):
|
||||||
|
+ with patch("blivet.formats.luks.blockdev") as bd:
|
||||||
|
+ fmt._create()
|
||||||
|
+ bd.crypto.luks_format.assert_called()
|
||||||
|
+ fmt._post_create()
|
||||||
|
+ bd.crypto.luks_set_persistent_flags.assert_not_called()
|
||||||
|
+
|
||||||
|
# flags.discard_new=True --> discard if creating new
|
||||||
|
- with patch("blivet.flags.flags.discard_new", True):
|
||||||
|
+ with patch("blivet.formats.luks.flags.discard_new", True):
|
||||||
|
fmt = LUKS(exists=True)
|
||||||
|
self.assertEqual(fmt.options, None)
|
||||||
|
|
||||||
|
@@ -34,6 +43,25 @@ def test_create_discard_option(self):
|
||||||
|
fmt = LUKS(exists=False, options="blah")
|
||||||
|
self.assertEqual(fmt.options, "blah,discard")
|
||||||
|
|
||||||
|
+ fmt = LUKS(passphrase="passphrase")
|
||||||
|
+ with patch("blivet.devicelibs.crypto.calculate_luks2_max_memory", return_value=None):
|
||||||
|
+ with patch("blivet.devicelibs.crypto.get_optimal_luks_sector_size", return_value=0):
|
||||||
|
+ with patch("blivet.formats.luks.blockdev") as bd:
|
||||||
|
+ fmt._create()
|
||||||
|
+ bd.crypto.luks_format.assert_called()
|
||||||
|
+ fmt._post_create()
|
||||||
|
+ bd.crypto.luks_set_persistent_flags.assert_called()
|
||||||
|
+
|
||||||
|
+ # LUKS 1 doesn't support the persistent flags
|
||||||
|
+ fmt = LUKS(passphrase="passphrase", luks_version="luks1")
|
||||||
|
+ with patch("blivet.devicelibs.crypto.calculate_luks2_max_memory", return_value=None):
|
||||||
|
+ with patch("blivet.devicelibs.crypto.get_optimal_luks_sector_size", return_value=0):
|
||||||
|
+ with patch("blivet.formats.luks.blockdev") as bd:
|
||||||
|
+ fmt._create()
|
||||||
|
+ bd.crypto.luks_format.assert_called()
|
||||||
|
+ fmt._post_create()
|
||||||
|
+ bd.crypto.luks_set_persistent_flags.assert_not_called()
|
||||||
|
+
|
||||||
|
def test_key_size(self):
|
||||||
|
# default cipher is AES-XTS with 512b key
|
||||||
|
fmt = LUKS()
|
@ -5,7 +5,7 @@ Version: 3.10.0
|
|||||||
|
|
||||||
#%%global prerelease .b2
|
#%%global prerelease .b2
|
||||||
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
|
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
|
||||||
Release: 5%{?prerelease}%{?dist}
|
Release: 16%{?prerelease}%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
License: LGPL-2.1-or-later
|
License: LGPL-2.1-or-later
|
||||||
%global realname blivet
|
%global realname blivet
|
||||||
@ -21,6 +21,13 @@ Patch1: 0002-Fix-skipping-btrfs-calls-when-libblockdev-btrfs-plugin-is-missing.p
|
|||||||
Patch2: 0003-XFS-resize-test-fix.patch
|
Patch2: 0003-XFS-resize-test-fix.patch
|
||||||
Patch3: 0004-Run-mkfs-xfs-with-force-option-by-default.patch
|
Patch3: 0004-Run-mkfs-xfs-with-force-option-by-default.patch
|
||||||
Patch4: 0005-consolidated-s390-device-configuration.patch
|
Patch4: 0005-consolidated-s390-device-configuration.patch
|
||||||
|
Patch5: 0007-Fix-checking-for-NVMe-plugin-availability.patch
|
||||||
|
Patch6: 0008-Align-sizes-up-for-growable-LVs.patch
|
||||||
|
Patch7: 0009-mod_pass_in_stratis_test.patch
|
||||||
|
Patch8: 0010-Fix_running_tests_in_FIPS_mode.patch
|
||||||
|
Patch9: 0011-Make-GPT-default-label-type-on-all-architectures.patch
|
||||||
|
Patch10: 0012-Fix-crash-on-ppc64le-with-GPT.patch
|
||||||
|
Patch11: 0013-Set-persistent-allow-discards-flag-for-new-LUKS-devices.patch
|
||||||
|
|
||||||
# Versions of required components (done so we make sure the buildrequires
|
# Versions of required components (done so we make sure the buildrequires
|
||||||
# match the requires versions of things).
|
# match the requires versions of things).
|
||||||
@ -76,10 +83,7 @@ Recommends: libblockdev-mdraid >= %{libblockdevver}
|
|||||||
Recommends: libblockdev-mpath >= %{libblockdevver}
|
Recommends: libblockdev-mpath >= %{libblockdevver}
|
||||||
Recommends: libblockdev-nvme >= %{libblockdevver}
|
Recommends: libblockdev-nvme >= %{libblockdevver}
|
||||||
Recommends: libblockdev-swap >= %{libblockdevver}
|
Recommends: libblockdev-swap >= %{libblockdevver}
|
||||||
|
|
||||||
%ifarch s390 s390x
|
|
||||||
Recommends: libblockdev-s390 >= %{libblockdevver}
|
Recommends: libblockdev-s390 >= %{libblockdevver}
|
||||||
%endif
|
|
||||||
|
|
||||||
Requires: python3-bytesize >= %{libbytesizever}
|
Requires: python3-bytesize >= %{libbytesizever}
|
||||||
Requires: util-linux >= %{utillinuxver}
|
Requires: util-linux >= %{utillinuxver}
|
||||||
@ -118,6 +122,51 @@ make DESTDIR=%{buildroot} install
|
|||||||
%{python3_sitelib}/*
|
%{python3_sitelib}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Mar 11 2025 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-16
|
||||||
|
- Set persistent allow-discards flag for newly created LUKS devices
|
||||||
|
Resolves: RHEL-82884
|
||||||
|
|
||||||
|
* Wed Jan 29 2025 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-15
|
||||||
|
- Revert "Remove support for the MD linear RAID level"
|
||||||
|
Resolves: RHEL-76808
|
||||||
|
|
||||||
|
* Thu Dec 05 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-14
|
||||||
|
- Fix crash on ppc64le with GPT
|
||||||
|
Resolves: RHEL-70153
|
||||||
|
|
||||||
|
* Tue Nov 19 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-13
|
||||||
|
- Make GPT default label type on all architectures
|
||||||
|
Resolves: RHEL-52200
|
||||||
|
|
||||||
|
* Tue Nov 12 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-12
|
||||||
|
- Fix running tests in FIPS mode
|
||||||
|
Resolves: RHEL-45173
|
||||||
|
|
||||||
|
* Fri Nov 1 2024 Jan Pokorny <japokorn@redhat.com> - 3.10.0-11
|
||||||
|
- Modified passphrase in stratis test
|
||||||
|
Resolves: RHEL-45173
|
||||||
|
|
||||||
|
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:3.10.0-10
|
||||||
|
- Bump release for October 2024 mass rebuild:
|
||||||
|
Resolves: RHEL-64018
|
||||||
|
|
||||||
|
* Thu Oct 24 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-9
|
||||||
|
- Align sizes up for growable LVs
|
||||||
|
Resolves: RHEL-45180
|
||||||
|
Resolves: RHEL-45181
|
||||||
|
|
||||||
|
* Wed Oct 09 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-8
|
||||||
|
- Fix dependency on libblockdev-s390
|
||||||
|
Resolves: RHEL-61187
|
||||||
|
|
||||||
|
* Mon Sep 30 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-7
|
||||||
|
- Fix checking for NVMe plugin availability
|
||||||
|
Resolves: RHEL-45179
|
||||||
|
|
||||||
|
* Mon Sep 09 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-6
|
||||||
|
- Remove support for the MD linear RAID level
|
||||||
|
Resolves: RHEL-38386
|
||||||
|
|
||||||
* Tue Jul 16 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-5
|
* Tue Jul 16 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.10.0-5
|
||||||
- Consolidated Device Configuration for RHEL 10
|
- Consolidated Device Configuration for RHEL 10
|
||||||
Resolves: RHEL-39381
|
Resolves: RHEL-39381
|
||||||
|
Loading…
Reference in New Issue
Block a user