forked from pool/supermin
37af610807
* Add support for OCaml 5 * Add kylinsecos support * rpm: Detect dnf5 and omit missing options * ocamlc: Use -output-complete-exe instead of -custom * Fix kernel filtering for aarch64 architecture * Uncompress kernel on RISC-V - Drop patches contained in new tarball 001-Improved-debugging-of-the-supermin-if-newer-calculation.patch 002-Fix-if-newer-copy-kernel.patch 003-Fix-kernel-filtering-for-aarch64-architecture.patch 004-Use-output-complete-exe-instead-of-custom.patch 005-Only-supply-output-complete-exe-to-final-link.patch 006-Rename-function-file-kernel.patch 007-Uncompress-kernel-on-RISC-V.patch 008-Fix-link-to-renamed-kernel-documentation.patch 009-New-mailing-list-email-address.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=90
20 lines
722 B
Diff
20 lines
722 B
Diff
--- a/src/format_ext2_kernel.ml
|
|
+++ b/src/format_ext2_kernel.ml
|
|
@@ -252,6 +252,16 @@ and get_kernel_version debug kernel_file
|
|
| 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
|