public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Nicolas Chauvet <kwizart@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/akmods] rawhide: Re-order bootctl and grubby to get default_kernel - rhbz#2501572
Date: Wed, 29 Jul 2026 09:36:09 GMT	[thread overview]
Message-ID: <178531776976.1.7611031789164907373.rpms-akmods-80ff2542107f@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/akmods
Branch : rawhide
Commit : 80ff2542107f0d4550232b951244efcc4ee676f3
Author : Nicolas Chauvet <kwizart@gmail.com>
Date   : 2026-07-20T14:52:15+02:00
Stats  : +4/-4 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/akmods/c/80ff2542107f0d4550232b951244efcc4ee676f3?branch=rawhide

Log:
Re-order bootctl and grubby to get default_kernel - rhbz#2501572

---
diff --git a/akmods b/akmods
index 3891136..2899ff3 100755
--- a/akmods
+++ b/akmods
@@ -295,17 +295,17 @@ check_default_kernel()
 	# IMPORTANT: "bootctl is-installed" check that systemd-boot is installed only.
 	# It doesn't check if systemd-boot is the default loader.
 	# So we assume grubby results if available
-	if command -v grubby >/dev/null 2>&1 ; then
-		default_kernel=$(grubby --default-kernel | sed -e 's/^.*vmlinuz-//')
-	elif bootctl is-installed >/dev/null 2>&1 ; then
+	if bootctl is-installed >/dev/null 2>&1 ; then
 		# Leave jq as optional - isDefault requires systemd 253
 		if command -v jq >/dev/null ; then
-			default_kernel="$(bootctl list  --json=short | jq -r '.[] | select(.isDefault).version')"
+			default_kernel="$(bootctl list  --json=short 2>/dev/null |jq -r '.[] | select(.isDefault).version')"
 			# Validate the result or discard - rhbz#2270414
 			if [[ ! -f /boot/vmlinuz-"${default_kernel}" ]] ; then
 				default_kernel=""
 			fi
 		fi
+	elif command -v grubby >/dev/null 2>&1 ; then
+		default_kernel=$(grubby --default-kernel | sed -e 's/^.*vmlinuz-//')
 	else # They use neither systemd-boot nor grub2
 		echo -n "Unable to figure out the default kernel" >&2
 		echo_warning ; echo

                 reply	other threads:[~2026-07-29  9:36 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=178531776976.1.7611031789164907373.rpms-akmods-80ff2542107f@fedoraproject.org \
    --to=kwizart@gmail.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