Skip to content

Commit

Permalink
v2v: Rebuild initrd last.
Browse files Browse the repository at this point in the history
Old virt-v2v rebuilt the initrd late.  Currently we rebuild the initrd
right after choosing a kernel, but it's best to update the initrd
at the end since mkinitrd may depend on other configuration files
that we are changing (especially see next commit).
  • Loading branch information
rwmjones committed Sep 17, 2014
1 parent 5fed8df commit f982ce2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions v2v/convert_linux.ml
Expand Up @@ -749,10 +749,10 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
if best_kernel <> List.hd grub_kernels then
grub_set_bootable best_kernel;

rebuild_initrd best_kernel;

(* Does the best/bootable kernel support virtio? *)
best_kernel.ki_supports_virtio
let virtio = best_kernel.ki_supports_virtio in

best_kernel, virtio

and grub_set_bootable kernel =
let cmd =
Expand Down Expand Up @@ -1234,7 +1234,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
unconfigure_efi ();
unconfigure_kudzu ();

let virtio = configure_kernel () in
let kernel, virtio = configure_kernel () in

if keep_serial_console then (
configure_console ();
Expand All @@ -1255,6 +1255,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
*)

remap_block_devices virtio;
rebuild_initrd kernel;

let guestcaps = {
gcaps_block_bus = if virtio then Virtio_blk else IDE;
Expand Down

0 comments on commit f982ce2

Please sign in to comment.