You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt-v2v/SOURCES/0033-convert-linux-Add-supp...

49 lines
2.0 KiB

From 380fa6663e9b373d87e446fc03601e9e44f985f6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 9 Aug 2022 19:09:08 +0100
Subject: [PATCH] convert: linux: Add support for Zstandard compressed kernel
modules
OpenSUSE uses *.ko.zst for kernel modules. This commit adds support
in the same way as the existing support for *.ko.xz. Note this
requires a corresponding change to libguestfs to support Zstandard
compression in the guestfs_file_architecture API:
https://github.com/libguestfs/libguestfs/commit/0e784824e82a88e522873fec5db1a11943d637ed
Reported-by: Xiaodai Wang
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2116811
(cherry picked from commit 315c016dbea899587649a4bbf1865390cb4e1d3c)
---
convert/linux_kernels.ml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/convert/linux_kernels.ml b/convert/linux_kernels.ml
index 307de572..6e9d2bdd 100644
--- a/convert/linux_kernels.ml
+++ b/convert/linux_kernels.ml
@@ -65,8 +65,8 @@ let print_kernel_info chan prefix ki =
ki.ki_supports_isa_pvpanic ki.ki_supports_virtio_socket
ki.ki_is_xen_pv_only_kernel ki.ki_is_debug
-let rex_ko = PCRE.compile "\\.k?o(?:\\.xz)?$"
-let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.xz)?$"
+let rex_ko = PCRE.compile "\\.k?o(?:\\.(?:xz|zst))?$"
+let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.(?:xz|zst))?$"
let detect_kernels (g : G.guestfs) inspect family bootloader =
(* What kernel/kernel-like packages are installed on the current guest? *)
@@ -203,7 +203,11 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
let all_candidates = List.flatten (
List.map (
fun f ->
- [ "/" ^ f ^ ".o"; "/" ^ f ^ ".ko"; "/" ^ f ^ ".ko.xz" ]
+ [ "/" ^ f ^ ".o";
+ "/" ^ f ^ ".ko";
+ "/" ^ f ^ ".ko.xz";
+ "/" ^ f ^ ".ko.zst";
+ ]
) candidates
) in
let candidate =