Update actor.py to support NVMe device enumeration #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attempting to upgrade CentOS 7 systems with UEFI and software RAID1 on top of NVMe disks, the upgrade fails during Finalization with the following:
leapp.libraries.stdlib.CalledProcessError: Command ['/sbin/efibootmgr', '-c', '-d', '/dev/nvme0n1p', '-p', '3', '-l', '\\EFI\rocky\\shimx64.efi', '-L', 'Rocky Linux'] failed with exit code 5
The failure is due to
efidev
being parsed into/dev/nvme0n1p
instead of/dev/nvme0n1
. (NVMe device enumeration follows a different format than most typical non-NVMe block devices.)This was confirmed with
leapp-upgrade-el7toel8-0.16.0-6.el7.elevate.19.noarch
/leapp-upgrade-el7toel8-deps-0.16.0-6.el7.elevate.19.noarch
.This PR modifies
devparts
to check if the argument contains '/dev/nvme' and, if so, generateddev
andpart
slightly differently.Before this PR,
/usr/share/leapp-repository/repositories/system_upgrade/common/actors/efibootorderfix/finalization/actor.py
attempts to execute:/sbin/efibootmgr -c -d /dev/nvme0n1p -p 3 -l \\EFI\rocky\\shimx64.efi -L 'Rocky Linux'
and
/sbin/efibootmgr -c -d /dev/nvme0n2p -p 3 -l \\EFI\rocky\\shimx64.efi -L 'Rocky Linux'
which have misnamed devices. The failure is triggered when the first command is reached.
After this PR, the device names are correct and the actor attempts to execute:
/sbin/efibootmgr -c -d /dev/nvme0n1 -p 3 -l \\EFI\rocky\\shimx64.efi -L 'Rocky Linux'
and
/sbin/efibootmgr -c -d /dev/nvme0n2 -p 3 -l \\EFI\rocky\\shimx64.efi -L 'Rocky Linux'
.