PKGBUILDs/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch
Kevin Mihelich e41ce1a6db core/mkinitcpio to 31-2.1
closes #1904
2022-03-16 04:27:16 +00:00

30 lines
769 B
Diff

From 65887576ad60bb29783a294b3ab09f87e345912e Mon Sep 17 00:00:00 2001
From: Janne Grunau <j@jannau.net>
Date: Sun, 30 Jan 2022 10:01:43 +0000
Subject: [PATCH 2/2] functions: handle gzip compressed kernels in kver_generic
Signed-off-by: Janne Grunau <j@jannau.net>
---
functions | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/functions b/functions
index 48cfd7a..e90c743 100644
--- a/functions
+++ b/functions
@@ -160,6 +160,11 @@ kver_generic() {
read _ _ kver _ < <(grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+' "$1")
+ # try if the image is gzip compressed
+ if [[ -z "$kver" ]]; then
+ read _ _ kver _ < <(gzip -c -d "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+')
+ fi
+
printf '%s' "$kver"
}
--
2.35.1