PKGBUILDs/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch
2022-11-24 16:39:57 +00:00

29 lines
780 B
Diff

From d8b51b2bfb33bfd0854a20c976eb4c9fa4c5fca5 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 e0a68e2..5ad3106 100644
--- a/functions
+++ b/functions
@@ -221,6 +221,11 @@ kver_generic() {
read _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+')
+ # 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.36.1