Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1866611

Summary: Support kernel installed in different path on systems using GRUB
Product: Red Hat Enterprise Linux 8 Reporter: Kairui Song <kasong>
Component: kexec-toolsAssignee: Kairui Song <kasong>
Status: CLOSED ERRATA QA Contact: xiaoying yan <yiyan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: adeshpan, cye, dornelas, hfukumot, kfan, mfuruta, miabbott, mniranja, ruyang, smilner, travier, walters, xiawu, xtian
Target Milestone: rcKeywords: FutureFeature, ZStream
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kexec-tools-2.0.20-35.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1895246 1914715 (view as bug list) Environment:
Last Closed: 2021-05-18 14:50:48 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: 1853986, 1894575, 1895246, 1914715    

Description Kairui Song 2020-08-06 04:33:52 UTC
Description of problem:
GRUB will add a BOOT_IMAGE= parameter to kernel cmdline, so this can be used to detect the kernel and initramfs location if kernel is not installed in /boot,
This is useful to support CoreOS/Atomic/Silverblue.

We should also support /boot/<machine-id>/<kver> style of installation.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Create /boot/<machine-id>/ or use a CoreOS/Atomic/Silverblue system
2. Kernel will be installed in a different path, restart kdump.

Actual results:
Kdump service will fail.

Expected results:
Kdump service works and put the kdump initramfs next to the default initramfs.

Additional info:

Comment 13 Micah Abbott 2020-11-13 21:10:00 UTC
After seeing the `kexec_file_load failed: Required key not available` error that Kelvin saw in comment#11, I went looking for related problems/BZs and found https://access.redhat.com/solutions/5292541 + https://bugzilla.redhat.com/show_bug.cgi?id=1862072

I built a custom version of RHCOS 4.6 using the kernel linked in BZ#1862072 (and a newer version of `linux-firmware` for dependency purposes) and the linked version of `kexec-tools` on this BZ.

After appending `crashckernel=auto` to the kernel command line, I observed that the `kdump.service` successfully started without any intervention.

```
[core@cosa-devsh ~]$ rpm-ostree status
State: idle
Deployments:
* ostree://8221dfb9c9f5c204f7c7e7dcf39705a1f0790e0c995e09d678f7b74c2dab22cd
                   Version: 46.82.202011122225-0 (2020-11-12T22:28:33Z)
[core@cosa-devsh ~]$ rpm -q kernel kexec-tools linux-firmware
kernel-4.18.0-236.el8.x86_64
kexec-tools-2.0.20-35.el8.x86_64
linux-firmware-20200619-99.git3890db36.el8.noarch
[core@cosa-devsh ~]$ cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt1)/ostree/rhcos-864a012f295903d53f7dee3839542fbdfc00497dfb41e26bef30a6dd73b625ac/vmlinuz-4.18.0-236.el8.x86_64 rhcos.root=crypt_rootfs random.trust_cpu=on console=tty0 console=ttyS0,115200n8 ignition.platform.id=qemu rd.luks.options=discard ignition.firstboot ostree=/ostree/boot.1/rhcos/864a012f295903d53f7dee3839542fbdfc00497dfb41e26bef30a6dd73b625ac/0 crashkernel=auto
[core@cosa-devsh ~]$ systemctl status kdump
● kdump.service - Crash recovery kernel arming
   Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2020-11-12 22:30:22 UTC; 22h ago
  Process: 1566 ExecStart=/usr/bin/kdumpctl start (code=exited, status=0/SUCCESS)
 Main PID: 1566 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4620)
   Memory: 0B
   CGroup: /system.slice/kdump.service

Nov 12 22:30:15 cosa-devsh dracut[1891]: *** Generating early-microcode cpio image ***
Nov 12 22:30:15 cosa-devsh dracut[1891]: *** Constructing GenuineIntel.bin ****
Nov 12 22:30:15 cosa-devsh dracut[1891]: *** Store current command line parameters ***
Nov 12 22:30:15 cosa-devsh dracut[1891]: Stored kernel commandline:
Nov 12 22:30:15 cosa-devsh dracut[1891]:  rd.luks.uuid=luks-00000000-0000-4000-a000-000000000002
Nov 12 22:30:15 cosa-devsh dracut[1891]: *** Creating image file '/boot/ostree/rhcos-864a012f295903d53f7dee3839542fbdfc00497dfb41e26bef30a6dd73b625ac/initramfs-4.18.0-236.el8.x86_64kdump.img' ***
Nov 12 22:30:22 cosa-devsh dracut[1891]: *** Creating initramfs image file '/boot/ostree/rhcos-864a012f295903d53f7dee3839542fbdfc00497dfb41e26bef30a6dd73b625ac/initramfs-4.18.0-236.el8.x86_64kdump.img' done ***
Nov 12 22:30:22 cosa-devsh kdumpctl[1566]: kexec: loaded kdump kernel
Nov 12 22:30:22 cosa-devsh kdumpctl[1566]: Starting kdump: [OK]
Nov 12 22:30:22 cosa-devsh systemd[1]: Started Crash recovery kernel arming.
[core@cosa-devsh ~]$ ls -latr /boot/ostree/rhcos-864a012f295903d53f7dee3839542fbdfc00497dfb41e26bef30a6dd73b625ac/
total 132453
-rwxr-xr-x. 1 root root  9571696 Nov 12 22:29 vmlinuz-4.18.0-236.el8.x86_64
-rw-r--r--. 1 root root 81682027 Nov 12 22:29 initramfs-4.18.0-236.el8.x86_64.img
drwxrwxr-x. 3 root root     1024 Nov 12 22:29 ..
-rw-r--r--. 1 root root      160 Nov 12 22:29 .vmlinuz-4.18.0-236.el8.x86_64.hmac
-rw-------. 1 root root 44366292 Nov 12 22:30 initramfs-4.18.0-236.el8.x86_64kdump.img
drwxrwxr-x. 2 root root     1024 Nov 12 22:30 .
```

From the RHCOS perspective, it appears that the changes to `kexec-tools` are working as intended.

Comment 15 Colin Walters 2020-11-18 15:59:11 UTC
OK now we need to decide whether to backport this to 8.3.z or just cherry-pick into RHCOS 4.7.

Do you guys have a preference?  I lean a bit to the latter because this fix only helps CoreOS systems as far as I know, and it's a low-impact package.
Assuming the 8.4 binary build works on 8.3 (no new glibc versions or shared library deps) then that seems viable.

Comment 16 Kairui Song 2020-11-19 04:15:44 UTC
(In reply to Colin Walters from comment #15)
> OK now we need to decide whether to backport this to 8.3.z or just
> cherry-pick into RHCOS 4.7.
> 
> Do you guys have a preference?  I lean a bit to the latter because this fix
> only helps CoreOS systems as far as I know, and it's a low-impact package.
> Assuming the 8.4 binary build works on 8.3 (no new glibc versions or shared
> library deps) then that seems viable.

I also prefer the cherry-pick way, 8.4 package should just work on 8.3

Comment 17 Dave Young 2020-11-19 06:12:08 UTC
(In reply to Kairui Song from comment #16)
> (In reply to Colin Walters from comment #15)
> > OK now we need to decide whether to backport this to 8.3.z or just
> > cherry-pick into RHCOS 4.7.
> > 
> > Do you guys have a preference?  I lean a bit to the latter because this fix
> > only helps CoreOS systems as far as I know, and it's a low-impact package.
> > Assuming the 8.4 binary build works on 8.3 (no new glibc versions or shared
> > library deps) then that seems viable.
> 
> I also prefer the cherry-pick way, 8.4 package should just work on 8.3

Hmm, directly use 8.4 rpm in 8.3 might not work for some cases, such as we have some Hyper-V workarounds in 8.3 but reverted in 8.4 because of the kernel backport.  But I think cherry-pick the patches for this bz should just work fine.

Comment 20 Kairui Song 2020-12-03 02:23:35 UTC
(In reply to Colin Walters from comment #15)
> OK now we need to decide whether to backport this to 8.3.z or just
> cherry-pick into RHCOS 4.7.
> 
> Do you guys have a preference?  I lean a bit to the latter because this fix
> only helps CoreOS systems as far as I know, and it's a low-impact package.
> Assuming the 8.4 binary build works on 8.3 (no new glibc versions or shared
> library deps) then that seems viable.

Dave Young just mentioned some issue with cherry-picking, there are some kernel workaround for HyperV issue in 8.3 that are reverted in 8.4, if simply cherry-pick the package, it might break kdump on HyperV machines. So maybe it's better to create a zstream bug and backport the patches for this bug.

Comment 26 errata-xmlrpc 2021-05-18 14:50:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (kexec-tools bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1607