SHA256
1
0
forked from pool/supermin
supermin/supermin-kernel_version_compressed.patch
Charles Arnold f0bd32279f - Update to 5.2.2 bug fix release
* Open Unix.LargeFile to avoid "lstat: Value too large for
    defined data type"
  * pacman: Skip over detached signatures when unpacking
  * ext2, rpm: Don't redefine Val_none or Some_val.
  * Don't attempt to build man page if perldoc is not available
  * Ignore zfcpdump kernel on s390x
  * Ignore unbootable kernels in /lib/modules
  * Ignore debug kernels
  * maintainer: Add our usual maintainer rules
- Drop
  Avoid-lstat-Value-too-large-for-defined-data-type.patch
  detect-aarch64-kernel.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=75
2022-04-25 19:31:26 +00:00

20 lines
722 B
Diff

--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -225,6 +225,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