From 42b3c64ecdd18cc4627fd2dc1af1fbb6c83984e2 Mon Sep 17 00:00:00 2001 From: Yuriy Kohut Date: Sat, 29 Aug 2026 10:40:41 +0300 Subject: [PATCH] Update AlmaLinux ELevate and Vendors patch: Drop inherited rd.lvm.lv args from the upgrade boot entry With rd.lvm.lv=/ inherited via `grubby --copy-default`, dracut's lvm_scan activates only the listed LVs (root/swap) in the upgrade initramfs, so LVs backing /var, /home, etc. stay inactive and the upgrade drops into the emergency shell. Remove the args from the ELevate-Upgrade-Initramfs entry (fork commit 9743db49). The package version 0.25.0-1.elevate.2 --- SOURCES/leapp-repository-0.25.0-elevate.patch | 88 ++++++++++++++++++- SPECS/leapp-repository.spec | 5 +- 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/SOURCES/leapp-repository-0.25.0-elevate.patch b/SOURCES/leapp-repository-0.25.0-elevate.patch index 3a0eb5c..77bda0d 100644 --- a/SOURCES/leapp-repository-0.25.0-elevate.patch +++ b/SOURCES/leapp-repository-0.25.0-elevate.patch @@ -3525,10 +3525,31 @@ index 00000000..c6694a8e +### Useful for packages that have identical version strings but contain binary changes between major OS versions +### Packages that aren't installed will be skipped diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py -index 8fb2e404..b2c960a4 100644 +index 8fb2e404..99382cd5 100644 --- a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py +++ b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py -@@ -93,7 +93,7 @@ def figure_out_commands_needed_to_add_entry(kernel_path, initramfs_path, args_to +@@ -48,7 +48,19 @@ def collect_undesired_args(livemode_enabled): + args = {} + if livemode_enabled: + args = dict(zip(('ro', 'rhgb', 'quiet'), itertools.repeat(None))) +- args['rd.lvm.lv'] = _get_rdlvm_arg_values() ++ ++ # ELevate: rd.lvm.lv=/ args inherited from the default entry via ++ # `grubby --copy-default` make dracut's lvm_scan activate *only* the listed ++ # LVs (typically root and swap) and skip the `vgchange -ay` of whole VGs. ++ # On a regular boot the remaining LVs are activated later by the real root ++ # system, but the upgrade initramfs never switches root - it mounts all ++ # fstab entries under /sysroot inside the initramfs. LVs backing e.g. /var, ++ # /home or /srv thus stay inactive, sysroot-*.mount units time out and the ++ # system drops into the emergency shell. Drop the args so that lvm_scan ++ # activates all volume groups (upstream does the same for the live mode). ++ rd_lvm_values = _get_rdlvm_arg_values(required=livemode_enabled) ++ if rd_lvm_values: ++ args['rd.lvm.lv'] = rd_lvm_values + + undesired = set(args.items()) + undesired |= collect_set_of_kernel_args_from_msgs(UpgradeKernelCmdlineArgTasks, 'to_remove') +@@ -93,7 +105,7 @@ def figure_out_commands_needed_to_add_entry(kernel_path, initramfs_path, args_to '/usr/sbin/grubby', '--add-kernel', '{0}'.format(kernel_path), '--initrd', '{0}'.format(initramfs_path), @@ -3537,8 +3558,33 @@ index 8fb2e404..b2c960a4 100644 '--copy-default', '--make-default', '--args', args_to_add_str +@@ -310,16 +322,20 @@ def _get_device_uuid(mount_point): + return None + + +-def _get_rdlvm_arg_values(): ++def _get_rdlvm_arg_values(required=True): + # should we not check args returned by grubby instead? + cmdline_msg = next(api.consume(KernelCmdline), None) + + if not cmdline_msg: +- raise StopActorExecutionError('Did not receive any KernelCmdline arguments.') ++ if required: ++ raise StopActorExecutionError('Did not receive any KernelCmdline arguments.') ++ api.current_logger().debug('No KernelCmdline message received; no rd.lvm.lv args to drop.') ++ return tuple() + + rd_lvm_values = sorted(arg.value for arg in cmdline_msg.parameters if arg.key == 'rd.lvm.lv') +- api.current_logger().debug('Collected the following rd.lvm.lv args that are undesired for the squashfs: %s', +- rd_lvm_values) ++ api.current_logger().debug( ++ 'Collected the following rd.lvm.lv args that are undesired for the upgrade boot entry: %s', rd_lvm_values ++ ) + + return tuple(rd_lvm_values) + diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py -index 09632c0c..f5cd7808 100644 +index 09632c0c..4df099bc 100644 --- a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py +++ b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py @@ -54,7 +54,7 @@ run_args_add = [ @@ -3550,6 +3596,42 @@ index 09632c0c..f5cd7808 100644 '--copy-default', '--make-default', '--args', +@@ -400,6 +400,7 @@ def test_modify_grubenv_to_have_separate_blsdir(monkeypatch, has_separate_boot): + + def test_collect_undesired_args_includes_upgrade_to_remove(monkeypatch): + msgs = [ ++ KernelCmdline(parameters=[]), + UpgradeKernelCmdlineArgTasks(to_remove=[ + KernelCmdlineArg(key='rd.luks.uuid', value='luks-aaa'), + KernelCmdlineArg(key='rd.luks.uuid', value='luks-bbb'), +@@ -414,8 +415,26 @@ def test_collect_undesired_args_includes_upgrade_to_remove(monkeypatch): + + + def test_collect_undesired_args_no_upgrade_to_remove(monkeypatch): +- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[])) ++ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[KernelCmdline(parameters=[])])) + + undesired = addupgradebootentry.collect_undesired_args(livemode_enabled=False) + + assert undesired == set() ++ ++ ++def test_collect_undesired_args_drops_rd_lvm_lv(monkeypatch): ++ """rd.lvm.lv args from the booted cmdline are removed from the upgrade entry even outside live mode.""" ++ msgs = [ ++ KernelCmdline(parameters=[ ++ KernelCmdlineArg(key='rd.lvm.lv', value='vg00/lv_root'), ++ KernelCmdlineArg(key='rd.md.uuid', value='aaaa:bbbb'), ++ KernelCmdlineArg(key='rd.lvm.lv', value='vg00/lv_swap'), ++ ]), ++ ] ++ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs)) ++ ++ undesired = addupgradebootentry.collect_undesired_args(livemode_enabled=False) ++ ++ assert undesired == {('rd.lvm.lv', ('vg00/lv_root', 'vg00/lv_swap'))} ++ assert 'rd.lvm.lv=vg00/lv_root rd.lvm.lv=vg00/lv_swap' == \ ++ addupgradebootentry.format_grubby_args_from_args_set(undesired) diff --git a/repos/system_upgrade/common/actors/checkenabledvendorrepos/actor.py b/repos/system_upgrade/common/actors/checkenabledvendorrepos/actor.py new file mode 100644 index 00000000..52f5af9d diff --git a/SPECS/leapp-repository.spec b/SPECS/leapp-repository.spec index e981000..5a8c178 100644 --- a/SPECS/leapp-repository.spec +++ b/SPECS/leapp-repository.spec @@ -53,7 +53,7 @@ py2_byte_compile "%1" "%2"} Epoch: 1 Name: leapp-repository Version: 0.25.0 -Release: 1%{?dist}.elevate.1 +Release: 1%{?dist}.elevate.2 Summary: Repositories for leapp License: ASL 2.0 @@ -352,6 +352,9 @@ fi %changelog +* Sat Aug 29 2026 Yuriy Kohut - 0.25.0-1.elevate.2 +- Drop inherited rd.lvm.lv args from the upgrade boot entry so that all LVs get activated in the upgrade initramfs + * Tue Aug 25 2026 Yuriy Kohut - 0.25.0-1.elevate.1 - Rebase the ELevate Vendors patch based on the v0.25.0