Bug 2130342

Summary: biosdevname: actor only enabled biosdevname for current kernel version
Product: Red Hat Enterprise Linux 7 Reporter: Harald Jensås <hjensas>
Component: leapp-repositoryAssignee: Leapp Notifications Bot <leapp-notifications-bot>
Status: CLOSED MIGRATED QA Contact: upgrades-and-conversions
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9Keywords: MigratedToJIRA
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-12 13:21:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2128268    

Description Harald Jensås 2022-09-27 20:43:09 UTC
Description of problem:
The actor which enables biosdevname only does so for the currently running kernel.
When the kernel is updated and the system boots the new kernel biosdevname won't be enabled. Configuration files will reference the biosdevname consisten interface names, but the systemd consistent interface nameing scheme is active.

Version-Release number of selected component (if applicable):
leapp-repository-deps-el8-5.0.0-100.202004161145Z.de6626f.master.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. Run Leapp (RHEL7->RHEL8) on a DELL box which does not explicitly disable biosdevname.
2. Update the kernel after Leapp completed.
3.

Actual results:

biosdevname is enabled after Leapp. But, only for the kernel version actual during Leapp. When the kernel is later updated, the machine reboots without biosdevname enabled.

Can be seen in leapp-upgrade.log - biosdevname was enabled by Leapp:
  leapp/leapp-upgrade.log:2022-01-26 15:38:06.286 INFO     PID: 7786 leapp.workflow.FactsCollection.biosdevname: Biosdevname naming scheme in use, explicitely enabling biosdevname on RHEL-8


Expected results:

Leapp should add the kernel argument to enable biosdevname to the defaults, so that kernel update does not fail.

Additional info:

This actor applies the kernel command line option with:
  cmd = ['grubby', '--update-kernel=/boot/vmlinuz-{}'.format(kernel_version), '--args="{}={}"'.format(arg.key, arg.value)]
  
When you run grubby with one specific kernel, it will only add the argument to that specific kernel version.
Instead, it shoule use --update-kernel=ALL to set it for _all_ kernels See manual page GRUBBY(8).

       --args=kernel-args
              When  a  new  kernel  is added, this specifies the command line arguments which should be passed to the kernel by default (note they are merged with the arguments of the default entry if --copy-default is used).  When
              --update-kernel is used, this specifies new arguments to add to the argument list. Multiple, space separated arguments may be used. If an argument already exists the new value replaces the old values. The root= kernel
              argument gets special handling if the configuration file has special handling for specifying the root filesystem.

       --update-kernel=kernel-path
              The  entries  for  kernels matching kernel-path are updated. Currently the only items that can be updated is the kernel argument list, which is modified via the --args and --remove-args options. If the ALL argument is
              used the variable  GRUB_CMDLINE_LINUX in /etc/default/grub is updated with the latest kernel argument list, unless the --no-etc-grub-update option is used or the file does not exist (e.g., on s390x).


I believe the correct command to use would be:
    cmd = ['grubby', '--update-kernel=ALL', '--args="{}={}"'.format(arg.key, arg.value)]

Using 'ALL' should ensure the option is added to GRUB_CMDLINE_LINUX.

Comment 1 Petr Stodulka 2022-09-29 11:34:35 UTC
Hi, thank you for the report & opening already even the ticket :) For other readers, follow please the attached upstream issue where we started the discussion about the solution:
  https://github.com/oamg/leapp-repository/issues/970
we will update the BZ ticket when we have an agreement on the right solution. 

Regarding the reported issue, I am moving it to RHEL 7 as this is about IPU 7 -> 8, so the fix must be delivered on RHEL 7.

Comment 4 RHEL Program Management 2023-09-12 12:26:30 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 5 RHEL Program Management 2023-09-12 13:21:13 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.