v2v: linux: handle UEFI path for Grub1 (RHBZ#1152369)

Add also /boot/efi/EFI/redhat/grub.conf as configuration of Grub 1;
since the "grub" lens of Augeas does not handle this path, add a
transformation so Augeas can parse it.
This commit is contained in:
Pino Toscano
2016-08-19 16:21:12 +02:00
parent cf5915aee3
commit 035533d67a

View File

@@ -96,7 +96,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
] in
let locations =
match inspect.i_firmware with
| I_UEFI _ -> ("/boot/efi/EFI/redhat/grub.cfg", `Grub2) :: locations
| I_UEFI _ ->
[
"/boot/efi/EFI/redhat/grub.cfg", `Grub2;
"/boot/efi/EFI/redhat/grub.conf", `Grub1;
] @ locations
| I_BIOS -> locations in
try
List.find (
@@ -111,6 +115,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
match grub with
| `Grub2 -> ""
| `Grub1 ->
if grub_config = "/boot/efi/EFI/redhat/grub.conf" then (
g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf";
Linux.augeas_reload g;
);
let mounts = g#inspect_get_mountpoints inspect.i_root in
try
List.find (