Split code to patches, as suggested.

Now there is no need for ALT_family in the code. But the code that checking
family fails without adding it. ALT is not RHEL nor Debian based distro, so
what family should be used if not adding ALT_family?

I wrongly asumed that modules should be added to existing initrd instead of
recreation. Now the part of code creating initrd is much shorter and
simpler.

There is no vmware-tools-libraries- in the ALT repository, so code for
deleting them was removed.

--
Mikhail Gordeev
--- a/docs/virt-v2v-support.pod
+++ b/docs/virt-v2v-support.pod
@@ -91,6 +91,8 @@ And hence L<virsh(1)>, L<virt-manager(1)>, and similar tools.
 
 =item OpenSUSE 10 and up
 
+=item ALT Linux 9 and up
+
 =item Debian 6 and up
 
 =item Ubuntu 10.04, 12.04, 14.04, 16.04, and up
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index a871d754..e1dba80c 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -1233,6 +1233,7 @@ let () =
                     | "rhel" | "centos" | "scientificlinux" | "redhat-based"
                     | "oraclelinux"
                     | "sles" | "suse-based" | "opensuse"
+                    | "altlinux"
                     | "debian" | "ubuntu" | "linuxmint" | "kalilinux") } -> true
     | _ -> false
   in
diff --git a/v2v/convert_linux.mli b/v2v/convert_linux.mli
index 22511b13..5823fe65 100644
--- a/v2v/convert_linux.mli
+++ b/v2v/convert_linux.mli
@@ -19,7 +19,7 @@
 (** Convert a Linux guest to run on KVM.
 
     This module converts certain Enterprise Linux guests to run on
-    KVM.  RHEL, SuSE, Fedora, CentOS, OracleLinux, Debian, Ubuntu,
+    KVM.  RHEL, SuSE, Fedora, CentOS, OracleLinux, ALT, Debian, Ubuntu,
     Mint and Kali are supported by this module.
 
     No functions are exported.  When the module is linked to virt-v2v
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -657,6 +657,16 @@ let convert (g : G.guestfs) inspect source_disks output rcaps _ =
 
         run_update_initramfs_command ()
       )
+      else if (g#is_file ~followsymlinks:true "/usr/sbin/make-initrd") then
+        ignore (
+          g#command [|
+            (* by default make-initrd running in vm add virtio and other
+             * needed to boot modules
+             *)
+            "/usr/sbin/make-initrd";
+             "-k"; kernel.ki_version;
+          |]
+        )
       else if g#is_file ~followsymlinks:true "/sbin/mkinitrd" then (
         let module_args = List.map (sprintf "--with=%s") modules in
         let args =
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -51,6 +51,7 @@ let convert (g : G.guestfs) inspect source_disks output rcaps _ =
     | "fedora"
     | "rhel" | "centos" | "scientificlinux" | "redhat-based"
     | "oraclelinux" -> `RHEL_family
+    | "altlinux" -> `ALT_family
     | "sles" | "suse-based" | "opensuse" -> `SUSE_family
     | "debian" | "ubuntu" | "linuxmint" | "kalilinux" -> `Debian_family
     | _ -> assert false in
_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to