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