libguestfs/0020-daemon-inspect-Add-some-debugging-of-usr-merging.patch
Richard W.M. Jones f0aae59556 Fix virt-v2v conversion of split /usr Ubuntu 22+
resolves: RHEL-87493
2025-04-16 21:38:07 +01:00

70 lines
2.7 KiB
Diff

From 68cecb64758b8ff6d3af842721cb7cf706cb5d0c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 16 Apr 2025 10:01:33 +0100
Subject: [PATCH] daemon: inspect: Add some debugging of /usr merging
(cherry picked from commit 2d1e8941301373d04a436333219358a72f9660f1)
---
daemon/inspect.ml | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/daemon/inspect.ml b/daemon/inspect.ml
index f6e0ce1f..bec9d567 100644
--- a/daemon/inspect.ml
+++ b/daemon/inspect.ml
@@ -47,18 +47,21 @@ let rec inspect_os () =
* multiple filesystems. Gather all the inspected information in the
* inspect_fs struct of the root filesystem.
*)
+ eprintf "inspect_os: collect_coreos_inspection_info\n%!";
let fses = collect_coreos_inspection_info fses in
(* Check if the same filesystem was listed twice as root in fses.
* This may happen for the *BSD root partition where an MBR partition
* is a shadow of the real root partition probably /dev/sda5
*)
+ eprintf "inspect_os: check_for_duplicated_bsd_root\n%!";
let fses = check_for_duplicated_bsd_root fses in
(* For Linux guests with a separate /usr filesystem, merge some of the
* inspected information in that partition to the inspect_fs struct
* of the root filesystem.
*)
+ eprintf "inspect_os: collect_linux_inspection_info\n%!";
let fses = collect_linux_inspection_info fses in
(* Save what we found in a global variable. *)
@@ -194,6 +197,9 @@ and collect_linux_inspection_info fses =
* or other ways to identify the OS).
*)
and collect_linux_inspection_info_for fses root =
+ eprintf "inspect_os: collect_linux_inspection_info_for %s\n"
+ (string_of_location root.fs_location);
+
let root_fstab =
match root with
| { role = RoleRoot { fstab = f } } -> f
@@ -207,14 +213,21 @@ and collect_linux_inspection_info_for fses root =
(* This checks that this usr is found in the fstab of
* the root filesystem.
*)
+ eprintf "inspect_os: checking if %s found in fstab of this root\n"
+ (string_of_location usr_mp);
List.exists (
fun (mountable, _) ->
+ eprintf "inspect_os: collect_linux_inspection_info_for: \
+ compare %s = %s\n"
+ (Mountable.to_string usr_mp.mountable)
+ (Mountable.to_string mountable);
usr_mp.mountable = mountable
) root_fstab
| _ -> false
) fses in
- eprintf "collect_linux_inspection_info_for: merging:\n%sinto:\n%s"
+ eprintf "inspect_os: collect_linux_inspection_info_for: merging:\n\
+ %sinto:\n%s"
(string_of_fs usr) (string_of_fs root);
merge usr root;
root