PKGBUILDs/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch

30 lines
780 B
Diff
Raw Normal View History

2022-12-10 01:25:14 +00:00
From efe14b76219f065b99983f305ac0d71e8c8658a4 Mon Sep 17 00:00:00 2001
2022-03-16 04:26:49 +00:00
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
2022-12-10 01:25:14 +00:00
index 9939e25..7e58d57 100644
2022-03-16 04:26:49 +00:00
--- a/functions
+++ b/functions
2022-12-10 01:25:14 +00:00
@@ -222,6 +222,11 @@ kver_generic() {
2022-03-16 04:26:49 +00:00
2022-11-24 16:39:57 +00:00
read _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+')
2022-03-16 04:26:49 +00:00
+ # 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"
}
--
2022-10-25 12:34:17 +00:00
2.36.1
2022-03-16 04:26:49 +00:00