X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs%2FLib.pm;h=bc8be9db93cdfbcb59a74f9f4ede1f95510a307e;hp=00a9bdb87a8891787ed47bc1db9b124812d4252e;hb=7cbd1bbdd5e613561ea7227081f7ddd666b98ee0;hpb=22eb7fc966bafebedfde437c9b9c9fb903a8bc35 diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 00a9bdb..bc8be9d 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -1049,13 +1049,14 @@ sub _find_filesystem =head2 mount_operating_system - mount_operating_system ($g, \%os); + mount_operating_system ($g, \%os, [$ro]); This function mounts the operating system described in the C<%os> hash according to the C table in that hash (see C). -The partitions are mounted read-only. +The partitions are mounted read-only unless the third parameter +is specified as zero explicitly. To reverse the effect of this call, use the standard libguestfs API call C<$g-Eumount_all ()>. @@ -1067,9 +1068,9 @@ sub mount_operating_system local $_; my $g = shift; my $os = shift; - my $ro = shift; # Read-only? + my $ro = shift; # Read-only? - $ro = 1 unless(defined($ro)); # ro defaults to 1 if unspecified + $ro = 1 unless defined $ro; # ro defaults to 1 if unspecified my $mounts = $os->{mounts}; @@ -1307,10 +1308,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"); };