Bug 2306497 - sdubby is blocked when config_file is empty
Summary: sdubby is blocked when config_file is empty
Keywords:
Status: CLOSED DUPLICATE of bug 2271533
Alias: None
Product: Fedora
Classification: Fedora
Component: sdubby
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jeremy Linton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-08-21 10:14 UTC by Nicolas Chauvet (kwizart)
Modified: 2024-08-27 00:41 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-08-27 00:41:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
bootctl list (3.72 KB, text/plain)
2024-08-21 10:23 UTC, Nicolas Chauvet (kwizart)
no flags Details

Description Nicolas Chauvet (kwizart) 2024-08-21 10:14:19 UTC
sdubby is blocked when config_file is empty

Reproducible: Always

Steps to Reproduce:
1. grubby --update-kernel=ALL --args="rd.driver.blacklist=nouveau" 
2.
3.
Actual Results:  
Command is blocked

Expected Results:  
It should update the bootargs as appropriate and handle cases to avoid blocking.

Using bash -x on the command shows:

++ set -- --update-kernel ALL --args rd.driver.blacklist=nouveau --
+ '[' 5 -gt 0 ']'
+ case "$1" in
+ info_kernel=ALL
+ shift 1
+ shift
+ '[' 3 -gt 0 ']'
+ case "$1" in
+ modify_args=rd.driver.blacklist=nouveau
+ utilmode=add
+ shift 1
+ shift
+ '[' 1 -gt 0 ']'
+ case "$1" in
+ shift
+ '[' 0 -gt 0 ']'
+ case "$utilmode" in
++ bootctl list
++ grep -B7 -A2 '.*linux:.*ALL'
++ grep '^.*source:'
++ cut -d: -f2-
+ config_file=
+ grep rd.driver.blacklist=nouveau


bootctl list attached...

Comment 1 Nicolas Chauvet (kwizart) 2024-08-21 10:23:02 UTC
Side note, I need the --update-kernel=ALL options in compatibility with grubby

Also it seems like the "ALL" in grep -B7 -A2 '... {ALL}' is bogus. But the info_kernel=ALL is appropriate...

Comment 2 Nicolas Chauvet (kwizart) 2024-08-21 10:23:28 UTC
Created attachment 2044532 [details]
bootctl list

Comment 3 Jeremy Linton 2024-08-22 21:21:24 UTC
Hi,

Your running this by hand, or there is a utility using grubby this way? 

The usage doc in updateloaderentries.sh is obviously wrong, because the "ALL" parameter actually only works with --info. This probably isn't hard to fix...

But i'm asking the above because the goal with sdubby isn't 100% compatibility with grubby, but rather a shim for existing utilities/etc which are using grubby rather than updating bls files themselves or with some other utility. Since AFAIK the long term goal is to remove grubby too. For example adding a rd.driver.blacklist might be better done simply by updating the kernel parameters in /etc/kernel/cmdline and letting the systemd kernel install/update process set the bls entries rather than using grubby, or just using the utility in merge mode to update everything with the new cmdline options.

Comment 4 Jeremy Linton 2024-08-22 21:44:14 UTC
Right, because the other way to have the same effect should be without the --update-kernel= parameter.

`grubby --args="rd.driver.blacklist=nouveau"`

But like I mentioned it looks like just converting "ALL" to unset for add/remove is probably an easy fix.

Comment 5 Jeremy Linton 2024-08-22 22:15:26 UTC
See if this fixes it for you: https://src.fedoraproject.org/fork/jlinton/rpms/sdubby/blob/test_args_all/f/updateloaderentries.sh

just replace the one on your filesystem with that one after backing up the existing file.

Comment 6 Nicolas Chauvet (kwizart) 2024-08-23 09:13:04 UTC
(In reply to Jeremy Linton from comment #4)
> Right, because the other way to have the same effect should be without the
> --update-kernel= parameter.
> 
> `grubby --args="rd.driver.blacklist=nouveau"`
It's looks relevant, but this doesn't work with the original grubby script. So I need to specify the --update-kernel=ALL argument there.

This is in the context of nvidia packaging for rpmfusion.

The fix in test_args_all works fine

Hopefully this can be propagated to branches.
Thanks.

Comment 7 Jeremy Linton 2024-08-27 00:41:58 UTC
I've built a rawhide version, and am going to dupe this against the earlier request to support =ALL

*** This bug has been marked as a duplicate of bug 2271533 ***


Note You need to log in before you can comment on or make changes to this bug.