summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs31
-rw-r--r--perl/lib/Sys/Guestfs.pm18
2 files changed, 49 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index d6ef053d..f19ea1a1 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -2812,3 +2812,34 @@ PREINIT:
OUTPUT:
RETVAL
+void
+initrd_list (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ char **filenames;
+ int i, n;
+ PPCODE:
+ filenames = guestfs_initrd_list (g, path);
+ if (filenames == NULL)
+ croak ("initrd_list: %s", guestfs_last_error (g));
+ for (n = 0; filenames[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (filenames[i], 0)));
+ free (filenames[i]);
+ }
+ free (filenames);
+
+void
+mount_loop (g, file, mountpoint)
+ guestfs_h *g;
+ char *file;
+ char *mountpoint;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_mount_loop (g, file, mountpoint);
+ if (r == -1)
+ croak ("mount_loop: %s", guestfs_last_error (g));
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 655624a9..f0eb6a0f 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -755,6 +755,18 @@ Because of the message protocol, there is a transfer limit
of somewhere between 2MB and 4MB. To transfer large files you should use
FTP.
+=item @filenames = $h->initrd_list ($path);
+
+This command lists out files contained in an initrd.
+
+The files are listed without any initial C</> character. The
+files are listed in the order they appear (not necessarily
+alphabetical). Directory names are listed as separate items.
+
+Old Linux kernels (2.4 and earlier) used a compressed ext2
+filesystem as initrd. We I<only> support the newer initramfs
+format (compressed cpio files).
+
=item $busy = $h->is_busy ();
This returns true iff this handle is busy processing a command
@@ -950,6 +962,12 @@ on the underlying device.
The filesystem options C<sync> and C<noatime> are set with this
call, in order to improve reliability.
+=item $h->mount_loop ($file, $mountpoint);
+
+This command lets you mount C<file> (a filesystem image
+in a file) on a mount point. It is entirely equivalent to
+the command C<mount -o loop file mountpoint>.
+
=item $h->mount_options ($options, $device, $mountpoint);
This is the same as the C<$h-E<gt>mount> command, but it