summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 15:18:17 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 15:19:10 +0100
commitc6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9 (patch)
tree3f090396c5b90e0829c3ab25f8c3d8275726a46e /perl
parent4dff42aa13dd726fb6b02843d0f4db4b4b330fe3 (diff)
downloadlibguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.tar.gz
libguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.tar.xz
libguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.zip
Generated code for 'initrd-list'.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs19
-rw-r--r--perl/lib/Sys/Guestfs.pm12
2 files changed, 31 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index d6ef053d..c0846d8f 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -2812,3 +2812,22 @@ 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);
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 655624a9..144e127e 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