customize, sysprep, v2v: handle Kali Linux as Debian

Kali Linux is a Debian derivative, so add basic support for it by using
most of the Debian code paths.  The only exception is the crypto
algorithm for passwords in passwd, which is always assumed as SHA512
(as Kali Linux is relatively new).
This commit is contained in:
Pino Toscano
2018-02-12 14:07:43 +01:00
parent 1dd11d2276
commit 5c5f69ef37
7 changed files with 9 additions and 9 deletions

View File

@@ -158,7 +158,7 @@ WantedBy=%s
install_sysvinit_redhat g
| "opensuse"|"sles"|"suse-based" ->
install_sysvinit_suse g
| "debian" ->
| ("debian"|"kalilinux") ->
install_sysvinit_debian g;
if major <= 7 then try_update_rc_d g root
| "ubuntu" ->

View File

@@ -42,7 +42,7 @@ let rec set_hostname (g : Guestfs.guestfs) root hostname =
update_etc_machine_info g hostname;
true
| "linux", ("debian"|"ubuntu"), _ ->
| "linux", ("debian"|"ubuntu"|"kalilinux"), _ ->
let old_hostname = read_etc_hostname g in
update_etc_hostname g hostname;
replace_host_in_etc_hosts g old_hostname hostname;

View File

@@ -165,7 +165,7 @@ and default_crypto g root =
| ("opensuse"|"sles"), _ -> `MD5
(* Rolling distributions, which hopefully should be updated enough. *)
| ("archlinux"|"voidlinux"), _ -> `SHA512
| ("archlinux"|"voidlinux"|"kalilinux"), _ -> `SHA512
| _, _ ->
let minor = g#inspect_get_minor_version root in

View File

@@ -49,7 +49,7 @@ let rec set_random_seed (g : Guestfs.guestfs) root =
match typ, distro with
| "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based") ->
Some "/var/lib/random-seed"
| "linux", ("debian"|"ubuntu") ->
| "linux", ("debian"|"ubuntu"|"kalilinux") ->
Some "/var/lib/urandom/random-seed"
| "linux", ("opensuse"|"sles"|"suse-based") ->
Some "/var/lib/misc/random-seed"

View File

@@ -36,7 +36,7 @@ let pacct_log_perform (g : Guestfs.guestfs) root side_effects =
side_effects#created_file ()
with G.Error _ -> ())
| "linux", ("debian"|"ubuntu") ->
| "linux", ("debian"|"ubuntu"|"kalilinux") ->
let files = g#glob_expand "/var/log/account/pacct*" in
Array.iter (
fun file ->

View File

@@ -52,7 +52,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
| "rhel" | "centos" | "scientificlinux" | "redhat-based"
| "oraclelinux" -> `RHEL_family
| "sles" | "suse-based" | "opensuse" -> `SUSE_family
| "debian" | "ubuntu" | "linuxmint" -> `Debian_family
| "debian" | "ubuntu" | "linuxmint" | "kalilinux" -> `Debian_family
| _ -> assert false in
assert (inspect.i_package_format = "rpm" || inspect.i_package_format = "deb");
@@ -1062,7 +1062,7 @@ let () =
| "rhel" | "centos" | "scientificlinux" | "redhat-based"
| "oraclelinux"
| "sles" | "suse-based" | "opensuse"
| "debian" | "ubuntu" | "linuxmint") } -> true
| "debian" | "ubuntu" | "linuxmint" | "kalilinux") } -> true
| _ -> false
in
Modules_list.register_convert_module matching "linux" convert

View File

@@ -19,8 +19,8 @@
(** 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
and Mint are supported by this module.
KVM. RHEL, SuSE, Fedora, CentOS, OracleLinux, Debian, Ubuntu,
Mint and Kali are supported by this module.
No functions are exported. When the module is linked to virt-v2v
it registers itself with