leapp-repository/0049-Use-sysinit-when-calling-vgchange-from-mount_usr.sh.patch
Petr Stodulka 8bdb7909b8 IPU 9.6-10.0: CTC 2 candidate 1
- Obsolete RHEL9 GPG key signed with SHA1
- Activate LVM VGs with `--sysinit` option to correct the use in the upgrade initramfs
- Fix output of commands executed inside systemd-nspawn containers
- Fix pes events scanner crashing when there are duplicate packages in the received instructions
- Fix pes events scanner not respecting user’s transaction configuration
- Fix remediation instructions for deprecated NM configuration
- Fix storage scanner crashing when command outputs contain colon character
- Minor improvements in preupgrade reports
- Resolves: RHEL-57043, RHEL-31428, RHEL-33373, RHEL-69829, RHEL-71517
2025-01-17 16:33:37 +01:00

55 lines
2.6 KiB
Diff

From a46f20841ef32b9de23553591dd7ae8ff5150eff Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 Jan 2025 19:57:37 +0000
Subject: [PATCH 49/53] Use --sysinit when calling vgchange from mount_usr.sh
The mount_usr.sh script runs 'lvm vgchange': if there are logical
volumes present that require monitoring (snapshots, thin pools, RAID,
etc.) the command will attempt to launch dmeventd.
Since dmeventd is not installed in the dracut initramfs this produces a
warning and causes the lvm command to exit with non-zero exit status
even though the volume group has been activated and LV block devices are
available.
This in turn triggers the retry logic in mount_usr.sh: once the retries
are exhausted the script carries on and successfully initiates the
upgrade process.
The --sysinit switch is used by the LVM dracut modules for this reason.
From vgchange(8):
--sysinit
Indicates that vgchange/lvchange is being invoked from early
system initialisation scripts (e.g. rc.sysinit or an initrd),
before writable filesystems are available. As such, some
functionality needs to be disabled and this option acts as a
shortcut which selects an appropriate set of options. Currently,
this is equivalent to using --ignorelockingfailure,
--ignoremonitoring, --poll n, and setting env var
LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES. vgchange/lvchange skip
autoactivation, and defer to pvscan autoactivation.
Testing with this change I no longer see the long delay booting the
upgrade initramfs when snapshot LVs are present.
---
.../files/dracut/85sys-upgrade-redhat/mount_usr.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
index 84f4857d..9366ac13 100755
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
@@ -107,7 +107,7 @@ try_to_mount_usr() {
# In case we have the LVM command available try make it activate all partitions
if command -v lvm 2>/dev/null 1>/dev/null; then
- lvm vgchange -a y || {
+ lvm vgchange --sysinit -a y || {
warn "Detected problem when tried to activate LVM VG."
if [ "$_last_attempt" != "true" ]; then
# this is not last execution, retry
--
2.47.1