v2v: linux: adapt initrd name for Debian

The name of the initrd image on Debian-based systems is different from
what used on Fedora/RHEL/SUSE and derived; set a different regexp to
avoid making the current regexp even more complex.
This commit is contained in:
Pino Toscano
2016-08-26 15:22:54 +02:00
parent bb3da3b074
commit 7882fb7247

View File

@@ -96,7 +96,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
let installed_kernels : kernel_info list =
let rex_ko = Str.regexp ".*\\.k?o\\(\\.xz\\)?$" in
let rex_ko_extract = Str.regexp ".*/\\([^/]+\\)\\.k?o\\(\\.xz\\)?$" in
let rex_initrd = Str.regexp "^initr\\(d\\|amfs\\)-.*\\(\\.img\\)?$" in
let rex_initrd =
if family = `Debian_family then
Str.regexp "^initrd.img-.*$"
else
Str.regexp "^initr\\(d\\|amfs\\)-.*\\(\\.img\\)?$" in
filter_map (
function
| { G.app2_name = name } as app