From 7882fb7247cee3b209ed319a1bf4d2b027b7f017 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 26 Aug 2016 15:22:54 +0200 Subject: [PATCH] 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. --- v2v/convert_linux.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 48321b3de..3cf16a027 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -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