|
|
46b2f6 |
From 6239ce21ea4d47914aa149cee724e998c287d26c Mon Sep 17 00:00:00 2001
|
|
|
46b2f6 |
From: Pino Toscano <ptoscano@redhat.com>
|
|
|
46b2f6 |
Date: Wed, 20 Mar 2019 16:55:05 +0100
|
|
|
46b2f6 |
Subject: [PATCH] v2v: linux: canonicalize module path for arch detection
|
|
|
46b2f6 |
(RHBZ#1690574)
|
|
|
46b2f6 |
|
|
|
46b2f6 |
Kernel modules can be also symlinks to files available outside the
|
|
|
46b2f6 |
"canonical" module directory; the "file" API, used by the
|
|
|
46b2f6 |
"file-architecture" API, return the actual type of a file (so symlinks,
|
|
|
46b2f6 |
block devices, etc), and thus "file-architecture" fails on symlinks.
|
|
|
46b2f6 |
|
|
|
46b2f6 |
To prevent this situation, canonicalize the path of the module picked
|
|
|
46b2f6 |
for architecture detection: this way, "file-architecture" will act on a
|
|
|
46b2f6 |
real file.
|
|
|
46b2f6 |
|
|
|
46b2f6 |
(cherry picked from commit 0a093035d485b3c2e66d56541ebe159f1b632ba6)
|
|
|
46b2f6 |
---
|
|
|
46b2f6 |
v2v/linux_kernels.ml | 2 +-
|
|
|
46b2f6 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
46b2f6 |
|
|
|
46b2f6 |
diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml
|
|
|
46b2f6 |
index 3313aabc7..889ec2f2a 100644
|
|
|
46b2f6 |
--- a/v2v/linux_kernels.ml
|
|
|
46b2f6 |
+++ b/v2v/linux_kernels.ml
|
|
|
46b2f6 |
@@ -189,7 +189,7 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
|
|
|
46b2f6 |
*)
|
|
|
46b2f6 |
let arch =
|
|
|
46b2f6 |
let any_module = modpath ^ List.hd modules in
|
|
|
46b2f6 |
- g#file_architecture any_module in
|
|
|
46b2f6 |
+ g#file_architecture (g#realpath any_module) in
|
|
|
46b2f6 |
|
|
|
46b2f6 |
(* Just return the module names, without path or extension. *)
|
|
|
46b2f6 |
let modules = List.filter_map (
|
|
|
46b2f6 |
--
|
|
|
b155d0 |
2.26.2
|
|
|
46b2f6 |
|