Bug 2265422

Summary: New system-wide LVM configuration requires adaptation of arm-image-installer
Product: [Fedora] Fedora Reporter: Peter Boy <pboy>
Component: arm-image-installerAssignee: Paul Whalen <pwhalen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 40CC: fmartine, pboy, pbrobinson, pwhalen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: arm-image-installer-4.1-2.fc39 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-03-06 01:05:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Boy 2024-02-21 23:48:33 UTC
A system-wide LVM configuration change was made with F39. The vg* utilities now only use those devices that are listed in the devices file /etc/lvm/devices/system.devices. Up to F38, the vg* Utilities used all devices that were connected to the system at the time of the invocation. 

This change affects arm-image-installer if the script is used on a host that uses LVM. In any case, this always applies to Fedora Server. 

The script installs a bootable file system on an mSD adapter, which is temporarily connected to the host (and later to the ARM computer). Fedora Server on the ARM system also uses LVM and arm-image-installer needs to access the local VG and root LV for the final configuration and uses vgchange to temporarily mount the root filesystem and vgrename to resolve name conflicts. This worked smoothly until F38. Since F39 it no longer works, as the host with vgchange / vgrename only accesses the devices that are configured in its devices file. The temporary device with the mSD card is of course not included. 

For this reason, the script, which worked perfectly up to F38, has failed since F39.

For details about the change see https://bugzilla.redhat.com/show_bug.cgi?id=2258764

Reproducible: Always

Steps to Reproduce:
1. Install arm-image-installer on Fedora Server 39 or 40
2. Execute arm-image-installer to create a bootable file system for any device
3.
Actual Results:  
Script fails with 
No U-Boot files found for <YOUR_DEVICE>

Expected Results:  
U-Boot files installed

Available solutions

Previous attempts to find a solution (see https://bugzilla.redhat.com/show_bug.cgi?id=2246871 and https://bugzilla.redhat.com/show_bug.cgi?id=2247872#c17) considered deleting the devices file. Deleting it in the image file does not solve the problem. The host on which vg* is executed naturally looks in its own devices file, not in the one on a temporary device. And even if so, the LV is not accessible on the temporary device without vgchange, and vgchange is failing. And deleting this file on the host is of course taboo.

According to current knowledge, 2 options are actually available:

1. 
In arm-image-installer adding "--devices /dev/<mSD_ADAPTER>" to each vg* command. This should include the device in the respective vg* operation. That would be the best option.

2. 
Before the first execution of a vg* command execute "lvmdevices --adddev  /dev/<mSD_ADAPTER>". This would add the device to the host's devices file. Before finishing the script must get removed using "lvmdevices --deldev  /dev/<mSD_ADAPTER>". However, if the script terminates prematurely, the host configuration would be compromised. That would be a second-best solution at best.

Comment 1 Fedora Update System 2024-02-26 22:36:54 UTC
FEDORA-2024-5b91f30bca (arm-image-installer-4.1-2.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-5b91f30bca

Comment 2 Fedora Update System 2024-02-27 01:21:02 UTC
FEDORA-2024-5b91f30bca has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-5b91f30bca`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-5b91f30bca

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2024-03-06 01:05:18 UTC
FEDORA-2024-5b91f30bca (arm-image-installer-4.1-2.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.