2022-04-25 21:31:26 +02:00
|
|
|
--- a/src/format_ext2_kernel.ml
|
|
|
|
+++ b/src/format_ext2_kernel.ml
|
2024-01-04 21:05:17 +01:00
|
|
|
@@ -252,6 +252,16 @@ and get_kernel_version debug kernel_file
|
2021-02-06 00:31:15 +01:00
|
|
|
| None ->
|
|
|
|
(* Try to work it out from the filename instead. *)
|
|
|
|
let basename = Filename.basename kernel_file in
|
|
|
|
+ let basename =
|
|
|
|
+ let len = String.length basename in
|
|
|
|
+ if Filename.check_suffix basename ".xz" || Filename.check_suffix basename ".gz"
|
|
|
|
+ then (
|
|
|
|
+ let basename = String.sub basename 0 (len-3) in
|
|
|
|
+ basename
|
|
|
|
+ )
|
|
|
|
+ else (
|
|
|
|
+ basename
|
|
|
|
+ ) in
|
|
|
|
if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename
|
|
|
|
then (
|
|
|
|
let version = String.sub basename 8 (String.length basename - 8) in
|