From 54ca259f09d13b03c3e27c3feb31400a31fed4be Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 5 Feb 2025 13:11:04 +0100 Subject: [PATCH 1/2] Disable LVM auto-activation during installation We don't want udev randomly activating LVs during installation, any activation should be done manually by blivet. Unfortunately the only way to do this system-wide is to change LVM config. We change the config during the storage module initialization and change it back when shutting down Anaconda. Related: rhbz#2309350 --- anaconda.py | 7 +++++++ pyanaconda/modules/storage/initialization.py | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/anaconda.py b/anaconda.py index e2330a7e5ad..28e9e8d0b8b 100755 --- a/anaconda.py +++ b/anaconda.py @@ -81,6 +81,13 @@ def exitHandler(rebootData): task_proxy = STORAGE.get_proxy(task_path) sync_run_task(task_proxy) + # reenable LVM auto-activation disabled in enable_installer_mode + from blivet.devicelibs import lvm + try: + lvm.reenable_lvm_autoactivation() + except RuntimeError as e: + log.error("Failed to reenable LVM auto-activation: %s", str(e)) + # Stop the DBus session. anaconda.dbus_launcher.stop() diff --git a/pyanaconda/modules/storage/initialization.py b/pyanaconda/modules/storage/initialization.py index 595f379dcda..2c8af0ffcaa 100644 --- a/pyanaconda/modules/storage/initialization.py +++ b/pyanaconda/modules/storage/initialization.py @@ -17,7 +17,7 @@ # from blivet import arch, blockdev, udev from blivet import util as blivet_util -from blivet.devicelibs import crypto +from blivet.devicelibs import crypto, lvm from blivet.flags import flags as blivet_flags from blivet.formats import get_device_format_class from blivet.static_data import luks_data @@ -81,6 +81,13 @@ def enable_installer_mode(): # We need this so all the /dev/disk/* stuff is set up. udev.trigger(subsystem="block", action="change") + # Disable LVM auto-activation during installation + if not conf.target.is_directory and not conf.target.is_image: + try: + lvm.disable_lvm_autoactivation() + except RuntimeError as e: + log.error("Failed to disable LVM auto-activation: %s", str(e)) + def _set_default_label_type(): """Set up the default label type.""" From 13bc8123b1b211d6ff124543d1f199bd62ee6acf Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 12 Feb 2025 16:04:31 +0100 Subject: [PATCH 2/2] Bump required version of Blivet to 3.12 --- anaconda.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anaconda.spec.in b/anaconda.spec.in index 104d518a892..ede313f9215 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -40,7 +40,7 @@ Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{vers %define nmver 1.0 %define pykickstartver 3.61-1 %define pypartedver 2.5-2 -%define pythonblivetver 1:3.9.0-1 +%define pythonblivetver 1:3.12.0-1 %define rpmver 4.15.0 %define simplelinever 1.9.0-1 %define subscriptionmanagerver 1.29.31