2024-05-04 03:02:06 +00:00
|
|
|
From f31b1dd5ef56948ade0292c812cec782a726b266 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
|
2023-03-22 01:05:52 +00:00
|
|
|
Subject: [PATCH 2/3] functions: handle gzip compressed kernels in kver_generic
|
2022-03-16 04:26:49 +00:00
|
|
|
|
|
|
|
Signed-off-by: Janne Grunau <j@jannau.net>
|
|
|
|
---
|
|
|
|
functions | 5 +++++
|
|
|
|
1 file changed, 5 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/functions b/functions
|
2024-05-04 03:02:06 +00:00
|
|
|
index 3dbc2e4..4e77418 100755
|
2022-03-16 04:26:49 +00:00
|
|
|
--- a/functions
|
|
|
|
+++ b/functions
|
2024-05-04 03:02:06 +00:00
|
|
|
@@ -444,6 +444,11 @@ kver_generic() {
|
|
|
|
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/version-timestamp.c?h=v6.7#n28
|
|
|
|
read -r _ _ kver _ < <(decompress_cat "$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
|
|
|
|