Update incorrect comment in Lib.pm
[libguestfs.git] / perl / lib / Sys / Guestfs / Lib.pm
index 1e5638e..bbc583f 100644 (file)
@@ -381,6 +381,8 @@ sub _elf_arch_to_canonical
        return "i486";  # probably not in the wild
     } elsif ($_ eq "x86-64") {
        return "x86_64";
+    } elsif ($_ eq "AMD x86-64") {
+       return "x86_64";
     } elsif (/SPARC32/) {
        return "sparc";
     } elsif (/SPARC V9/) {
@@ -433,16 +435,14 @@ sub file_architecture
        $g->download ($path, "$dir/initrd");
 
        my $bins = join " ", map { "bin/$_" } @_initrd_binaries;
-       my $cmd = "cd $dir && $zcat initrd | cpio -id $bins";
+       my $cmd = "cd $dir && $zcat initrd | cpio --quiet -id $bins";
        my $r = system ($cmd);
        die __x("cpio command failed: {error}", error => $?)
            unless $r == 0;
 
        foreach my $bin (@_initrd_binaries) {
            if (-f "$dir/bin/$bin") {
-               open PIPE, "file $dir/bin/$bin |";
-               local $/ = undef;
-               $_ = <PIPE>;
+               $_ = `file $dir/bin/$bin`;
                if (/ELF.*executable, (.+?),/) {
                    return _elf_arch_to_canonical ($1);
                }
@@ -1342,7 +1342,7 @@ sub inspect_in_detail
     _check_for_applications ($g, $os);
     _check_for_kernels ($g, $os);
     if ($os->{os} eq "linux") {
-       _check_for_modprobe_aliases ($g, $os);
+       _find_modprobe_aliases ($g, $os);
        _check_for_initrd ($g, $os);
     }
 }
@@ -1436,16 +1436,14 @@ sub _check_for_kernels
     $os->{kernels} = \@kernels;
 }
 
-# Check /etc/modprobe.conf to see if there are any specified
-# drivers associated with network (ethX) or hard drives.  Normally
-# one might find something like:
-#
-#  alias eth0 xennet
-#  alias scsi_hostadapter xenblk
-#
-# XXX This doesn't look beyond /etc/modprobe.conf, eg. in /etc/modprobe.d/
+# Find all modprobe aliases. Specifically, this looks in the following
+# locations:
+#  * /etc/conf.modules
+#  * /etc/modules.conf
+#  * /etc/modprobe.conf
+#  * /etc/modprobe.d/*
 
-sub _check_for_modprobe_aliases
+sub _find_modprobe_aliases
 {
     local $_;
     my $g = shift;