public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jeremy Linton <jlinton@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/sdubby] epel10.2: grubby: compatiblity with --update-kernel=ALL
Date: Tue, 07 Jul 2026 07:20:36 GMT	[thread overview]
Message-ID: <178340883621.1.14812876782456940738.rpms-sdubby-99971e1c56c8@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/sdubby
            Branch : epel10.2
            Commit : 99971e1c56c8441cf85c1ee35dcdf29d9b1e91b3
            Author : Jeremy Linton <jlinton@redhat.com>
            Date   : 2024-08-26T18:39:31-05:00
            Stats  : +11/-9 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/sdubby/c/99971e1c56c8441cf85c1ee35dcdf29d9b1e91b3?branch=epel10.2

            Log:
            grubby: compatiblity with --update-kernel=ALL

grubby has a wildcard option ALL for which kernels have an option
added/removed. sdubby can do this without specifying ALL
but for compatiliby (and to fix a bug with add) we should probably
tweak it a bit.

Signed-off-by: Jeremy Linton <jlinton@redhat.com>

---
diff --git a/updateloaderentries.sh b/updateloaderentries.sh
index df08d57..e19a094 100755
--- a/updateloaderentries.sh
+++ b/updateloaderentries.sh
@@ -93,6 +93,10 @@ while [ ${#} -gt 0 ]; do
     shift
 done
 
+if [[ "$info_kernel" == "ALL" ]]; then
+    unset info_kernel
+fi
+
 case "$utilmode" in
     help)
 	echo "updateloaderentries.sh: When run as updateloaderentries it doesn't require any parameters and merges"
@@ -107,17 +111,15 @@ case "$utilmode" in
 	;;
     add)
 	config_file=`bootctl list |grep -B7 -A2 ".*linux:.*${info_kernel}"|grep "^.*source:" |cut -d: -f2- `
-	grep ${modify_args} $config_file
-	if [[ "$?" == "1" ]]; then
-	    sed -i -e "s/^options    /options    ${modify_args} /" $config_file
-	fi
+	for fn in $config_file; do
+	    grep ${modify_args} $fn >/dev/null
+	    if [[ "$?" == "1" ]]; then
+		sed -i -e "s/^options    /options    ${modify_args} /" $fn
+	    fi
+	done
 	;;
     info)
-	if [[ "$info_kernel" == "ALL" ]];then
-	   bootctl list | grep -B7 -A2 "linux:" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}"  | eval "${BOOTCTL_QUOTING}"
-        else
-	   bootctl list | grep -B7 -A2 ".*linux:.*$info_kernel" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}"
-	fi
+	bootctl list | grep -B7 -A2 ".*linux:.*$info_kernel" | awk "$CAPTUREROOT" | eval "${BOOTCTL_REMOVE_UNUSED}" | eval "${BOOTCTL_TO_GRUBBY_INFO}" | eval "${BOOTCTL_QUOTING}"
 	;;
     defaultkernel)
 	bootctl list |grep -A6 ".*title:.*(default)" | grep "linux:" | cut -c16-

                 reply	other threads:[~2026-07-07  7:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178340883621.1.14812876782456940738.rpms-sdubby-99971e1c56c8@fedoraproject.org \
    --to=jlinton@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox