Lib.pm: Use 'file' as replacement for 'zfile'.
authorRichard Jones <rjones@trick.home.annexia.org>
Tue, 28 Jul 2009 14:43:14 +0000 (15:43 +0100)
committerRichard Jones <rjones@trick.home.annexia.org>
Tue, 28 Jul 2009 14:45:16 +0000 (15:45 +0100)
perl/lib/Sys/Guestfs/Lib.pm

index 00a9bdb..4020c24 100644 (file)
@@ -1307,10 +1307,10 @@ sub _check_for_initrd
            my $version = $1;
            my @modules;
 
-           # Disregard old-style compressed ext2 files, since cpio
-           # takes ages to (fail to) process these.
-           if ($g->file ("/boot/$initrd") !~ /gzip compressed/ ||
-               $g->zfile ("gzip", "/boot/$initrd") !~ /ext2 filesystem/) {
+           # Disregard old-style compressed ext2 files and only
+           # work with real compressed cpio files, since cpio
+           # takes ages to (fail to) process anything else.
+           if ($g->file ("/boot/$initrd") =~ /cpio/) {
                eval {
                    @modules = $g->initrd_list ("/boot/$initrd");
                };