Bug 2217154

Summary: system fails to boot after installing new kernel, after using grubby
Product: [Fedora] Fedora Reporter: Gerald Cox <gbcox>
Component: grubbyAssignee: Peter Jones <pjones>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: fmartine, nfrayer, pjones, rharwood
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Gerald Cox 2023-06-24 14:32:09 UTC
After using grubby as follows:
grubby -args=usb_storage.quirks=0x0bc2:0x3322:,0x0bc2:0xab80:,0x0bc2:0xab81:,0x0bc2:0xab82:,0x0bc2:0xab38: --update-kernel=ALL

it appears that future kernel entries are not built properly.  System boot fails by going into recovery mode.  

Reproducible: Always

Steps to Reproduce:
1.  Modified args in F38 kernel 6.3.8 system with:  grubby --args=usb_storage.quirks=0x0bc2:0x3322:,0x0bc2:0xab80:,0x0bc2:0xab81:,0x0bc2:0xab82:,0x0bc2:0xab38: --update-kernel=ALL

2. dnf upgrade which installed f38 6.3.9 kernel

3. rebooted system, received:   systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'. L 9.3883871 charon systemd[1]: Failed to start initrd-switch-root.service- Switch Root.

4, Reviewed /boot/loader/entries.  It appears that entry for 6.3.9 kernel was not built propery.

Here is the entry for 6.3.8 kernel:
title Fedora Linux (6.3.8-200.fc38.x86_64) 38 (Workstation Edition)
version 6.3.8-200.fc38.x86_64
linux /vmlinuz-6.3.8-200.fc38.x86_64
initrd /initramfs-6.3.8-200.fc38.x86_64.img
options root=UUID=365d160f-bac9-4a1c-9ee5-7be7b4f7207d ro rhgb quiet usb_storage.quirks=0x0bc2:0x3322:,0x0bc2:0xab80:,0x0bc2:0xab81:,0x0bc2:0xab82:,0x0bc2:0xab38:
grub_users $grub_users
grub_arg --unrestricted
grub_class fedora

Here is the entry that was built for 6.3.9 kernel:
title Fedora Linux (6.3.9-200.fc38.x86_64) 38 (Workstation Edition)
version 6.3.9-200.fc38.x86_64
linux /vmlinuz-6.3.9-200.fc38.x86_64
initrd /initramfs-6.3.9-200.fc38.x86_64.img
options usb_storage.quirks=0x0bc2:0x3322:,0x0bc2:0xab80:,0x0bc2:0xab81:,0x0bc2:0xab82:,0x0bc2:0xab38:
grub_users $grub_users
grub_arg --unrestricted
grub_class fedora



Actual Results:  
options for:
root
ro
rhgb
quit

are missing from the 6.3.9 kernel

Expected Results:  
grubby command should work for all existing entries, and entries created going forward

Comment 1 Gerald Cox 2023-06-24 15:35:16 UTC
Changing priority, I tried with kernel 6.3.5 and it isn't building correct either, so wondering if using the grubby command some how
corrupted something.

Comment 2 Gerald Cox 2023-06-24 17:06:18 UTC
I found that I can workaround the issue by manually editing the /boot/loader/entry/*.conf files and correcting the option line to be:

options root=UUID=365d160f-bac9-4a1c-9ee5-7be7b4f7207d ro rhgb quiet usb_storage.quirks=0x0bc2:0x3322:,0x0bc2:
0xab80:,0x0bc2:0xab81:,0x0bc2:0xab82:,0x0bc2:0xab38:

but I shouldn’t have to do that.

Comment 3 Gerald Cox 2023-06-24 21:19:58 UTC
I found that for some reason that my /etc/default/grub file changed and for some reason this line was changed to: GRUB_CMDLINE_LINUX=""

I’m guessing that when I added the long usb_storage.quirks line that the utility that changes the /etc/default/grub file couldn’t deal with the line length and just changed it to “”. That’s a hypothesis on my part, but that is the only thing that I changed. If that indeed what happened, that's a bug and needs to be fixed.  I was able to edit the grub file manually.  Although the jury is out whether or not the change will stick.