[Libguestfs] [PATCH 7/8] v2v: linux: adapt initrd name for Debian

Pino Toscano ptoscano at redhat.com
Mon Aug 8 16:38:54 UTC 2016


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 1800d3d..cfe46b8 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -141,7 +141,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
         )
     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
-- 
2.7.4




More information about the Libguestfs mailing list