[PATCH] added ntfscat_i api
Adding ntfscat_i command for downloading files based on their inode number. This allows the dowload of files unaccessible otherwise from a NTFS guest disk image. --- daemon/ntfs.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 15 +++++++++++++ 2 files changed, 77 insertions(+) diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 568899e..58f62fa 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors) return 0; } + +int +do_ntfscat_i (const mountable_t *mountable, int64_t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { + reply_with_perror ("%s", cmd); + return -1; + } + + /* Now we must send the reply message, before the file contents. After + * this there is no opportunity in the protocol to send any error + * message back. Instead we can only cancel the transfer. + */ + reply (NULL, NULL); + + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) { + if (send_file_write (buffer, r) < 0) { + pclose (fp); + return -1; + } + } + + if (ferror (fp)) { + fprintf (stderr, "fread: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + pclose (fp); + return -1; + } + + if (pclose (fp) != 0) { + fprintf (stderr, "pclose: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + return -1; + } + + if (send_file_end (0)) /* Normal end of file. */ + return -1; + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index eb45392..18418aa 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12891,6 +12891,21 @@ This is equivalent to C<sgdisk -e>. See also L<sgdisk(8)>." }; + { defaults with + name = "ntfscat_i"; added = (1, 33, 12); + style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], []; + proc_nr = Some 463; + progress = true; cancellable = true; + shortdesc = "download a file to the local machine given its inode"; + longdesc = "\ +Download a file given its inode from a NTFS filesystem and save it as F<filename> +on the local machine. + +This allows to download some otherwise unaccessible files such as the ones +within the $Extend folder. + +F<filename> can also be a named pipe." }; + ] (* Non-API meta-commands available only in guestfish. -- 2.7.0
On Sun, Feb 21, 2016 at 11:22:23PM +0200, Matteo Cafasso wrote:
Adding ntfscat_i command for downloading files based on their inode number.
This allows the dowload of files unaccessible otherwise from a NTFS guest disk image.
The patch seems fine, but it really needs a test otherwise this feature could silently break. Have a look at the tests/ntfsclone/ subdirectory for the general idea. One problem with writing the test (indeed, with the general idea) is how do you discover which inode numbers can be downloaded? Does NTFS have some standard inode numbers for things like the MFT? Rich.
--- daemon/ntfs.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 15 +++++++++++++ 2 files changed, 77 insertions(+)
diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 568899e..58f62fa 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors)
return 0; } + +int +do_ntfscat_i (const mountable_t *mountable, int64_t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { + reply_with_perror ("%s", cmd); + return -1; + } + + /* Now we must send the reply message, before the file contents. After + * this there is no opportunity in the protocol to send any error + * message back. Instead we can only cancel the transfer. + */ + reply (NULL, NULL); + + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) { + if (send_file_write (buffer, r) < 0) { + pclose (fp); + return -1; + } + } + + if (ferror (fp)) { + fprintf (stderr, "fread: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + pclose (fp); + return -1; + } + + if (pclose (fp) != 0) { + fprintf (stderr, "pclose: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + return -1; + } + + if (send_file_end (0)) /* Normal end of file. */ + return -1; + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index eb45392..18418aa 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12891,6 +12891,21 @@ This is equivalent to C<sgdisk -e>.
See also L<sgdisk(8)>." };
+ { defaults with + name = "ntfscat_i"; added = (1, 33, 12); + style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], []; + proc_nr = Some 463; + progress = true; cancellable = true; + shortdesc = "download a file to the local machine given its inode"; + longdesc = "\ +Download a file given its inode from a NTFS filesystem and save it as F<filename> +on the local machine. + +This allows to download some otherwise unaccessible files such as the ones +within the $Extend folder. + +F<filename> can also be a named pipe." }; + ]
(* Non-API meta-commands available only in guestfish. -- 2.7.0
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 22/02/16 17:26, Richard W.M. Jones wrote:
On Sun, Feb 21, 2016 at 11:22:23PM +0200, Matteo Cafasso wrote:
Adding ntfscat_i command for downloading files based on their inode number.
This allows the dowload of files unaccessible otherwise from a NTFS guest disk image. The patch seems fine, but it really needs a test otherwise this feature could silently break. I was thinking the same but I stumbled over an issue which prevented me from running the tests. I'm not sure this is the right place where to discuss the problem but here's few lines about it.
make blank-disk.img blank-part.img blank-fs.img blank-bootroot.img blank-bootrootlv.img debian.img fedora.img fedora-md1.img fedora-md2.img fedora-btrfs.img ubuntu.img archlinux.img coreos.img windows.img guests-all-good.xml make[3]: Entering directory '/home/noxdafox/development/libguestfs/test-data/phony-guests' make[3]: 'blank-disk.img' is up to date. make[3]: 'blank-part.img' is up to date. make[3]: 'blank-fs.img' is up to date. make[3]: 'blank-bootroot.img' is up to date. make[3]: 'blank-bootrootlv.img' is up to date. make[3]: 'debian.img' is up to date. rm -f fedora-name.db fedora-name.db-t no fedora-name.db-t < fedora-name.db.txt /bin/bash: no: command not found Makefile:1793: recipe for target 'fedora-name.db' failed make[3]: *** [fedora-name.db] Error 127 Searching around it seems some dependency is missing but ./configure is not helping me to find which one.
Have a look at the tests/ntfsclone/ subdirectory for the general idea.
This was also another issue, I was not sure ntfs was supported by the test suite and I didn't find any documentation about it. I'll take a look at these ones.
One problem with writing the test (indeed, with the general idea) is how do you discover which inode numbers can be downloaded? Does NTFS have some standard inode numbers for things like the MFT?
The $MFT file has alway 0 as index number.
Rich.
--- daemon/ntfs.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 15 +++++++++++++ 2 files changed, 77 insertions(+)
diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 568899e..58f62fa 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors)
return 0; } + +int +do_ntfscat_i (const mountable_t *mountable, int64_t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { + reply_with_perror ("%s", cmd); + return -1; + } + + /* Now we must send the reply message, before the file contents. After + * this there is no opportunity in the protocol to send any error + * message back. Instead we can only cancel the transfer. + */ + reply (NULL, NULL); + + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) { + if (send_file_write (buffer, r) < 0) { + pclose (fp); + return -1; + } + } + + if (ferror (fp)) { + fprintf (stderr, "fread: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + pclose (fp); + return -1; + } + + if (pclose (fp) != 0) { + fprintf (stderr, "pclose: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + return -1; + } + + if (send_file_end (0)) /* Normal end of file. */ + return -1; + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index eb45392..18418aa 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12891,6 +12891,21 @@ This is equivalent to C<sgdisk -e>.
See also L<sgdisk(8)>." };
+ { defaults with + name = "ntfscat_i"; added = (1, 33, 12); + style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], []; + proc_nr = Some 463; + progress = true; cancellable = true; + shortdesc = "download a file to the local machine given its inode"; + longdesc = "\ +Download a file given its inode from a NTFS filesystem and save it as F<filename> +on the local machine. + +This allows to download some otherwise unaccessible files such as the ones +within the $Extend folder. + +F<filename> can also be a named pipe." }; + ]
(* Non-API meta-commands available only in guestfish. -- 2.7.0
On Mon, Feb 22, 2016 at 07:23:45PM +0200, noxdafox wrote:
On 22/02/16 17:26, Richard W.M. Jones wrote:
On Sun, Feb 21, 2016 at 11:22:23PM +0200, Matteo Cafasso wrote:
Adding ntfscat_i command for downloading files based on their inode number.
This allows the dowload of files unaccessible otherwise from a NTFS guest disk image. The patch seems fine, but it really needs a test otherwise this feature could silently break. I was thinking the same but I stumbled over an issue which prevented me from running the tests. I'm not sure this is the right place where to discuss the problem but here's few lines about it.
make blank-disk.img blank-part.img blank-fs.img blank-bootroot.img blank-bootrootlv.img debian.img fedora.img fedora-md1.img fedora-md2.img fedora-btrfs.img ubuntu.img archlinux.img coreos.img windows.img guests-all-good.xml make[3]: Entering directory '/home/noxdafox/development/libguestfs/test-data/phony-guests' make[3]: 'blank-disk.img' is up to date. make[3]: 'blank-part.img' is up to date. make[3]: 'blank-fs.img' is up to date. make[3]: 'blank-bootroot.img' is up to date. make[3]: 'blank-bootrootlv.img' is up to date. make[3]: 'debian.img' is up to date. rm -f fedora-name.db fedora-name.db-t no fedora-name.db-t < fedora-name.db.txt /bin/bash: no: command not found
What happens here is it's trying to run ``$(DB_LOAD) fedora-name.db-t'' but the db_load program wasn't found by your configure. I think you need to install whatever is the db4-utils (Berkeley DB 4) on your OS. Alternately you can grab the pre-built databases from a recent tarball, since we distribute this stuff in the tarball so it doesn't need to be rebuilt for most end users. Rich.
Makefile:1793: recipe for target 'fedora-name.db' failed make[3]: *** [fedora-name.db] Error 127
Searching around it seems some dependency is missing but ./configure is not helping me to find which one.
Have a look at the tests/ntfsclone/ subdirectory for the general idea.
This was also another issue, I was not sure ntfs was supported by the test suite and I didn't find any documentation about it. I'll take a look at these ones.
One problem with writing the test (indeed, with the general idea) is how do you discover which inode numbers can be downloaded? Does NTFS have some standard inode numbers for things like the MFT?
The $MFT file has alway 0 as index number.
Rich.
--- daemon/ntfs.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 15 +++++++++++++ 2 files changed, 77 insertions(+)
diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 568899e..58f62fa 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors)
return 0; } + +int +do_ntfscat_i (const mountable_t *mountable, int64_t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { + reply_with_perror ("%s", cmd); + return -1; + } + + /* Now we must send the reply message, before the file contents. After + * this there is no opportunity in the protocol to send any error + * message back. Instead we can only cancel the transfer. + */ + reply (NULL, NULL); + + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) { + if (send_file_write (buffer, r) < 0) { + pclose (fp); + return -1; + } + } + + if (ferror (fp)) { + fprintf (stderr, "fread: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + pclose (fp); + return -1; + } + + if (pclose (fp) != 0) { + fprintf (stderr, "pclose: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + return -1; + } + + if (send_file_end (0)) /* Normal end of file. */ + return -1; + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index eb45392..18418aa 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12891,6 +12891,21 @@ This is equivalent to C<sgdisk -e>.
See also L<sgdisk(8)>." };
+ { defaults with + name = "ntfscat_i"; added = (1, 33, 12); + style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], []; + proc_nr = Some 463; + progress = true; cancellable = true; + shortdesc = "download a file to the local machine given its inode"; + longdesc = "\ +Download a file given its inode from a NTFS filesystem and save it as F<filename> +on the local machine. + +This allows to download some otherwise unaccessible files such as the ones +within the $Extend folder. + +F<filename> can also be a named pipe." }; + ]
(* Non-API meta-commands available only in guestfish. -- 2.7.0
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On 22/02/16 19:43, Richard W.M. Jones wrote:
On Mon, Feb 22, 2016 at 07:23:45PM +0200, noxdafox wrote:
On 22/02/16 17:26, Richard W.M. Jones wrote:
On Sun, Feb 21, 2016 at 11:22:23PM +0200, Matteo Cafasso wrote:
Adding ntfscat_i command for downloading files based on their inode number.
This allows the dowload of files unaccessible otherwise from a NTFS guest disk image. The patch seems fine, but it really needs a test otherwise this feature could silently break. I was thinking the same but I stumbled over an issue which prevented me from running the tests. I'm not sure this is the right place where to discuss the problem but here's few lines about it.
make blank-disk.img blank-part.img blank-fs.img blank-bootroot.img blank-bootrootlv.img debian.img fedora.img fedora-md1.img fedora-md2.img fedora-btrfs.img ubuntu.img archlinux.img coreos.img windows.img guests-all-good.xml make[3]: Entering directory '/home/noxdafox/development/libguestfs/test-data/phony-guests' make[3]: 'blank-disk.img' is up to date. make[3]: 'blank-part.img' is up to date. make[3]: 'blank-fs.img' is up to date. make[3]: 'blank-bootroot.img' is up to date. make[3]: 'blank-bootrootlv.img' is up to date. make[3]: 'debian.img' is up to date. rm -f fedora-name.db fedora-name.db-t no fedora-name.db-t < fedora-name.db.txt /bin/bash: no: command not found What happens here is it's trying to run ``$(DB_LOAD) fedora-name.db-t'' but the db_load program wasn't found by your configure. I think you need to install whatever is the db4-utils (Berkeley DB 4) on your OS.
Alternately you can grab the pre-built databases from a recent tarball, since we distribute this stuff in the tarball so it doesn't need to be rebuilt for most end users.
Rich. Once fixed that and few other things I got stuck with this:
SRCDIR=. LAYOUT=partitions ../../run --test ./make-fedora-img.pl Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/blib/lib /home/noxdafox/development/libguestfs/perl/blib/arch /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./make-fedora-img.pl line 27. Compilation failed in require at ./make-fedora-img.pl line 27. The module is looking for should be in /home/noxdafox/development/libguestfs/perl/lib and it's included in @INC. I'm on Debian Jessie.
Makefile:1793: recipe for target 'fedora-name.db' failed make[3]: *** [fedora-name.db] Error 127
Searching around it seems some dependency is missing but ./configure is not helping me to find which one.
Have a look at the tests/ntfsclone/ subdirectory for the general idea. This was also another issue, I was not sure ntfs was supported by the test suite and I didn't find any documentation about it. I'll take a look at these ones. One problem with writing the test (indeed, with the general idea) is how do you discover which inode numbers can be downloaded? Does NTFS have some standard inode numbers for things like the MFT? The $MFT file has alway 0 as index number. Rich.
--- daemon/ntfs.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 15 +++++++++++++ 2 files changed, 77 insertions(+)
diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 568899e..58f62fa 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors)
return 0; } + +int +do_ntfscat_i (const mountable_t *mountable, int64_t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { + reply_with_perror ("%s", cmd); + return -1; + } + + /* Now we must send the reply message, before the file contents. After + * this there is no opportunity in the protocol to send any error + * message back. Instead we can only cancel the transfer. + */ + reply (NULL, NULL); + + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) { + if (send_file_write (buffer, r) < 0) { + pclose (fp); + return -1; + } + } + + if (ferror (fp)) { + fprintf (stderr, "fread: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + pclose (fp); + return -1; + } + + if (pclose (fp) != 0) { + fprintf (stderr, "pclose: %ld: %m\n", inode); + send_file_end (1); /* Cancel. */ + return -1; + } + + if (send_file_end (0)) /* Normal end of file. */ + return -1; + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index eb45392..18418aa 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12891,6 +12891,21 @@ This is equivalent to C<sgdisk -e>.
See also L<sgdisk(8)>." };
+ { defaults with + name = "ntfscat_i"; added = (1, 33, 12); + style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], []; + proc_nr = Some 463; + progress = true; cancellable = true; + shortdesc = "download a file to the local machine given its inode"; + longdesc = "\ +Download a file given its inode from a NTFS filesystem and save it as F<filename> +on the local machine. + +This allows to download some otherwise unaccessible files such as the ones +within the $Extend folder. + +F<filename> can also be a named pipe." }; + ]
(* Non-API meta-commands available only in guestfish. -- 2.7.0
On Mon, Feb 22, 2016 at 11:58:28PM +0200, noxdafox wrote:
Once fixed that and few other things I got stuck with this:
SRCDIR=. LAYOUT=partitions ../../run --test ./make-fedora-img.pl Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/blib/lib /home/noxdafox/development/libguestfs/perl/blib/arch /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./make-fedora-img.pl line 27. Compilation failed in require at ./make-fedora-img.pl line 27.
The module is looking for should be in /home/noxdafox/development/libguestfs/perl/lib and it's included in @INC.
I'm on Debian Jessie.
It must be a missing dependency. Did you run `apt-get build-dep libguestfs'? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On 23/02/16 10:09, Richard W.M. Jones wrote:
On Mon, Feb 22, 2016 at 11:58:28PM +0200, noxdafox wrote:
Once fixed that and few other things I got stuck with this:
SRCDIR=. LAYOUT=partitions ../../run --test ./make-fedora-img.pl Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/blib/lib /home/noxdafox/development/libguestfs/perl/blib/arch /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./make-fedora-img.pl line 27. Compilation failed in require at ./make-fedora-img.pl line 27.
The module is looking for should be in /home/noxdafox/development/libguestfs/perl/lib and it's included in @INC.
I'm on Debian Jessie. It must be a missing dependency. Did you run `apt-get build-dep libguestfs'?
Rich.
I just noticed the mistake, I'm not using Debian Jessie but Stretch (testing). The missing dependency seems to be the package gfs2-utils which is present in Debian Jessie and Debian Sid but not in Stretch. # apt-get build-dep libguestfs The following packages have unmet dependencies: builddeps:libguestfs : Depends: gfs2-utils but it is not installable
On Wed, Feb 24, 2016 at 09:24:47PM +0200, noxdafox wrote:
On 23/02/16 10:09, Richard W.M. Jones wrote:
On Mon, Feb 22, 2016 at 11:58:28PM +0200, noxdafox wrote:
Once fixed that and few other things I got stuck with this:
SRCDIR=. LAYOUT=partitions ../../run --test ./make-fedora-img.pl Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/blib/lib /home/noxdafox/development/libguestfs/perl/blib/arch /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./make-fedora-img.pl line 27. Compilation failed in require at ./make-fedora-img.pl line 27.
The module is looking for should be in /home/noxdafox/development/libguestfs/perl/lib and it's included in @INC.
I'm on Debian Jessie. It must be a missing dependency. Did you run `apt-get build-dep libguestfs'?
Rich.
I just noticed the mistake, I'm not using Debian Jessie but Stretch (testing).
The missing dependency seems to be the package gfs2-utils which is present in Debian Jessie and Debian Sid but not in Stretch.
# apt-get build-dep libguestfs
The following packages have unmet dependencies: builddeps:libguestfs : Depends: gfs2-utils but it is not installable
Seems unlikely since gfs2-utils is an optional package, and has nothing to do with the error. The error might also be caused because we embed the highest API number in perl/lib/Sys/Guestfs.pm (as $VERSION), which we shouldn't really do. It means you may have to rerun ./configure && make after adding a new API. Anyway, try rerunning ./configure, doing make clean, etc. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Apply the attached patch, followed by doing: make -C perl clean ./configure make Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On 25/02/16 10:54, Richard W.M. Jones wrote:
Apply the attached patch, followed by doing:
make -C perl clean ./configure make
Rich.
I applied the patch, unfortunately the issue is still present. This is what I get if I run interactive Perl console. DB<1> use Sys::Guestfs Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. Compilation failed in require at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. main::BEGIN() called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval {...} called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1 BEGIN failed--compilation aborted at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1 I have no experience with Perl. Is it failing evaluating the module? I checked the module and it's contained in the path /home/noxdafox/development/libguestfs/perl/lib which is present in @INC.
On Thu, Feb 25, 2016 at 10:46:10PM +0200, noxdafox wrote:
On 25/02/16 10:54, Richard W.M. Jones wrote:
Apply the attached patch, followed by doing:
make -C perl clean ./configure make
Rich.
I applied the patch, unfortunately the issue is still present.
This is what I get if I run interactive Perl console.
DB<1> use Sys::Guestfs Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. Compilation failed in require at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. main::BEGIN() called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval {...} called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1 BEGIN failed--compilation aborted at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1
I have no experience with Perl. Is it failing evaluating the module?
I don't understand why this is happening, but the error means that it cannot load the binary part of the module (ie. normally libguestfs/perl/blib/arch/auto/Sys/Guestfs/Guestfs.so).
I checked the module and it's contained in the path /home/noxdafox/development/libguestfs/perl/lib which is present in @INC.
It ought to be loading the module from perl/blib/... which is the compiled copy of the module. Anyway, suggest doing something like this [NB: it will DELETE any non-checked-in files in your local directory]: git clean -xdf and rebuilding again. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On 25/02/16 23:18, Richard W.M. Jones wrote:
On 25/02/16 10:54, Richard W.M. Jones wrote:
Apply the attached patch, followed by doing:
make -C perl clean ./configure make
Rich.
I applied the patch, unfortunately the issue is still present.
This is what I get if I run interactive Perl console.
DB<1> use Sys::Guestfs Can't locate loadable object for module Sys::Guestfs in @INC (@INC contains: /home/noxdafox/development/libguestfs/perl/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. Compilation failed in require at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. main::BEGIN() called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval {...} called at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2 eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1 BEGIN failed--compilation aborted at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. at (eval 8)[/usr/share/perl/5.22/perl5db.pl:737] line 2. eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop; use Sys::Guestfs; ' called at /usr/share/perl/5.22/perl5db.pl line 737 DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110 DB::DB called at -e line 1
I have no experience with Perl. Is it failing evaluating the module? I don't understand why this is happening, but the error means that it cannot load the binary part of the module (ie. normally
On Thu, Feb 25, 2016 at 10:46:10PM +0200, noxdafox wrote: libguestfs/perl/blib/arch/auto/Sys/Guestfs/Guestfs.so). According to autogen.sh output Perl bindings and virt tools seem to be missing, could it be related to this? Are the tests relying to such dependencies?
This is how we have configured the optional components for you today: Daemon .............................. yes Appliance ........................... yes QEMU ................................ /usr/bin/qemu-system-x86_64 guestfish and C-based virt tools .... yes FUSE filesystem ..................... no GNU gettext for i18n ................ yes virt-p2v ............................ no OCaml bindings ...................... yes OCaml-based virt tools .............. yes Perl bindings ....................... no Perl-based virt tools ............... no Python bindings ..................... yes Ruby bindings ....................... no Java bindings ....................... yes Haskell bindings .................... no PHP bindings ........................ no Erlang bindings ..................... no Lua bindings ........................ no Go bindings ......................... no gobject bindings .................... no gobject introspection ............... no bash completion ..................... yes
I checked the module and it's contained in the path /home/noxdafox/development/libguestfs/perl/lib which is present in @INC. It ought to be loading the module from perl/blib/... which is the compiled copy of the module.
Anyway, suggest doing something like this [NB: it will DELETE any non-checked-in files in your local directory]:
git clean -xdf
and rebuilding again.
Unfortunately it didn't help either.
Rich.
On Fri, Feb 26, 2016 at 12:16:22AM +0200, noxdafox wrote:
According to autogen.sh output Perl bindings and virt tools seem to be missing, could it be related to this? Are the tests relying to such dependencies?
Yes, the tests rely on Perl bindings working, so I guess you need to install whatever missing dependencies are needed to make Perl work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On 26/02/16 10:12, Richard W.M. Jones wrote:
On Fri, Feb 26, 2016 at 12:16:22AM +0200, noxdafox wrote:
According to autogen.sh output Perl bindings and virt tools seem to be missing, could it be related to this? Are the tests relying to such dependencies? Yes, the tests rely on Perl bindings working, so I guess you need to install whatever missing dependencies are needed to make Perl work.
Rich.
I eventually installed the list of build dependencies from the source package. Which theoretically means I have all the required dependencies for building the library. Now it complains about missing builtin mdadm feature. SRCDIR=. LAYOUT=partitions-md ../../run --test ./make-fedora-img.pl md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103. Is it possible to skip the build of certain images and jump directly to the interested one (Windows in my case)?
On Sat, Feb 27, 2016 at 12:53:51AM +0200, noxdafox wrote:
On 26/02/16 10:12, Richard W.M. Jones wrote:
On Fri, Feb 26, 2016 at 12:16:22AM +0200, noxdafox wrote:
According to autogen.sh output Perl bindings and virt tools seem to be missing, could it be related to this? Are the tests relying to such dependencies? Yes, the tests rely on Perl bindings working, so I guess you need to install whatever missing dependencies are needed to make Perl work.
Rich.
I eventually installed the list of build dependencies from the source package. Which theoretically means I have all the required dependencies for building the library.
Now it complains about missing builtin mdadm feature.
SRCDIR=. LAYOUT=partitions-md ../../run --test ./make-fedora-img.pl md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103.
This is a bug of sorts. It should skip building these images if mdadm is not available. The reason we don't skip it is that mdadm is very commonly available on every Linux distro, so there's not much point. Do you really have all the dependencies installed? You seem to have the ones from appliance/packagelist{.in} missing: http://libguestfs.org/guestfs-building.1.html#full-list-of-requirements Try: sudo apt-get install `cat appliance/packagelist` (you can ignore any unavailable packages). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 27/02/16 01:05, Richard W.M. Jones wrote:
On Sat, Feb 27, 2016 at 12:53:51AM +0200, noxdafox wrote:
On 26/02/16 10:12, Richard W.M. Jones wrote:
On Fri, Feb 26, 2016 at 12:16:22AM +0200, noxdafox wrote:
According to autogen.sh output Perl bindings and virt tools seem to be missing, could it be related to this? Are the tests relying to such dependencies? Yes, the tests rely on Perl bindings working, so I guess you need to install whatever missing dependencies are needed to make Perl work.
Rich.
I eventually installed the list of build dependencies from the source package. Which theoretically means I have all the required dependencies for building the library.
Now it complains about missing builtin mdadm feature.
SRCDIR=. LAYOUT=partitions-md ../../run --test ./make-fedora-img.pl md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103. This is a bug of sorts. It should skip building these images if mdadm is not available. The reason we don't skip it is that mdadm is very commonly available on every Linux distro, so there's not much point.
Do you really have all the dependencies installed? You seem to have the ones from appliance/packagelist{.in} missing:
http://libguestfs.org/guestfs-building.1.html#full-list-of-requirements
Try:
sudo apt-get install `cat appliance/packagelist` This is the list of unavailable package in Stretch.
E: Package 'gfs-tools' has no installation candidate E: Package 'gfs2-tools' has no installation candidate E: Package 'gfs2-utils' has no installation candidate E: Unable to locate package libsystemd-id128-0 E: Unable to locate package libsystemd-journal0 E: Package 'linux-image' has no installation candidate E: Unable to locate package ufsutils E: Package 'module-init-tools' has no installation candidate E: Unable to locate package procps-ng E: Unable to locate package util-linux-ng All the other packages were already installed. Most of these packages seem to be available to other Debian branches but not on Stretch.
(you can ignore any unavailable packages).
Rich.
[...]
md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103.
All the other packages were already installed. Most of these packages seem to be available to other Debian branches but not on Stretch.
The Debian package 'mdadm' is installed on the machine or not? Assuming it is installed, what is the output of: rm -rf tmp/.guestfs-* ./run guestfish run : supported ? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On 27/02/16 11:23, Richard W.M. Jones wrote:
[...]
md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103. All the other packages were already installed. Most of these packages seem to be available to other Debian branches but not on Stretch. The Debian package 'mdadm' is installed on the machine or not? $ dpkg -l | grep mdadm ii mdadm 3.4-1 amd64 tool to administer Linux MD arrays (software RAID)
Assuming it is installed, what is the output of:
rm -rf tmp/.guestfs-* ./run guestfish run : supported
? That precise command fails with the following message:
libguestfs: error: you must call guestfs_add_drive before guestfs_launch If I feed a disk image I get it to work and returns: acl yes augeas yes blkdiscard yes blkdiscardzeroes yes btrfs no extlinux no fstrim yes gdisk yes grub no hivex yes inotify yes journal yes ldm no linuxcaps yes linuxfsuuid yes linuxmodules yes linuxxattrs yes luks no lvm2 yes mdadm no mknod yes ntfs3g yes ntfsprogs yes realpath yes rsync yes scrub no selinux yes syslinux no wipefs yes xfs no xz yes zerofree no
Rich.
On Sat, Feb 27, 2016 at 09:55:32PM +0200, noxdafox wrote:
On 27/02/16 11:23, Richard W.M. Jones wrote:
[...]
md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103. All the other packages were already installed. Most of these packages seem to be available to other Debian branches but not on Stretch. The Debian package 'mdadm' is installed on the machine or not? $ dpkg -l | grep mdadm ii mdadm 3.4-1 amd64 tool to administer Linux MD arrays (software RAID)
Assuming it is installed, what is the output of:
rm -rf tmp/.guestfs-* ./run guestfish run : supported
? That precise command fails with the following message:
libguestfs: error: you must call guestfs_add_drive before guestfs_launch
Ah right, that's because the default backend is 'direct', but on my machine I have it set to 'libvirt', which supports hotplugging and thus doesn't require you to specify any drives.
mdadm no
OK this is strange, and wrong. Can you try: ./run virt-rescue --scratch In the virt-rescue shell: ls -l {/bin,/sbin,/usr/bin,/usr/sbin}/mdadm That should show the mdadm binary copied into the appliance, but likely it does not, because the test here is failing: https://github.com/libguestfs/libguestfs/blob/master/daemon/md.c#L45 https://github.com/libguestfs/libguestfs/blob/master/daemon/guestfsd.c#L1076 It could be that mdadm is something odd, like a dead symlink? Anyway, I'll fire up a Debian box in my cloud and see if I can reproduce this also. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 27/02/16 22:09, Richard W.M. Jones wrote:
On 27/02/16 11:23, Richard W.M. Jones wrote:
[...]
md_create: feature 'mdadm' is not available in this build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for how to check for the availability of features. at /home/noxdafox/development/libguestfs/test-data/phony-guests/make-fedora-img.pl line 103. All the other packages were already installed. Most of these packages seem to be available to other Debian branches but not on Stretch. The Debian package 'mdadm' is installed on the machine or not? $ dpkg -l | grep mdadm ii mdadm 3.4-1 amd64 tool to administer Linux MD arrays (software RAID) Assuming it is installed, what is the output of:
rm -rf tmp/.guestfs-* ./run guestfish run : supported
? That precise command fails with the following message:
libguestfs: error: you must call guestfs_add_drive before guestfs_launch Ah right, that's because the default backend is 'direct', but on my machine I have it set to 'libvirt', which supports hotplugging and
On Sat, Feb 27, 2016 at 09:55:32PM +0200, noxdafox wrote: thus doesn't require you to specify any drives.
mdadm no
OK this is strange, and wrong.
Can you try:
./run virt-rescue --scratch
In the virt-rescue shell:
ls -l {/bin,/sbin,/usr/bin,/usr/sbin}/mdadm <rescue> ls -l {/bin,/sbin,/usr/bin,/usr/sbin}/mdadm ls: cannot access '/bin/mdadm': No such file or directory ls: cannot access '/sbin/mdadm': No such file or directory ls: cannot access '/usr/bin/mdadm': No such file or directory ls: cannot access '/usr/sbin/mdadm': No such file or directory
That should show the mdadm binary copied into the appliance, but likely it does not, because the test here is failing:
https://github.com/libguestfs/libguestfs/blob/master/daemon/md.c#L45 https://github.com/libguestfs/libguestfs/blob/master/daemon/guestfsd.c#L1076
It could be that mdadm is something odd, like a dead symlink? $ ls -l /sbin/mdadm -rwxr-xr-x 1 root root 542376 Feb 19 19:03 /sbin/mdadm
Anyway, I'll fire up a Debian box in my cloud and see if I can reproduce this also. Thanks for the time you're spending in this.
Rich.
Anyway, I'll fire up a Debian box in my cloud and see if I can reproduce this also.
I was able to install stretch, starting from jessie [from `virt-builder debian-8'], changing s/jessie/stretch/ in sources.list, and upgrading in the usual way. To install gfs2-utils I had to add jessie as another apt source [see my final sources.list attached]. That package is not in stretch, I suppose because it has not been built since jessie. I completed `apt-get build-dep libguestfs' with no errors. I built libguestfs from git (ac76081f). I had to additionally install: `db-util' and `uuid-runtime'. I think both are missing dependencies from the Debian package. The test suite basically worked after that. There were a few failures (eg. grub missing, xfs-admin lacks some patches that we added upstream), but nothing significant. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
There's one possible source of the problem: I discovered that if you don't have all the appliance packages installed on the host before your first libguestfs build, then any missing packages don't get added to appliance/supermin.d/packages. Compare your appliance/packagelist with appliance/supermin.d/packages and look for packages present in the first file and missing in the second file -- mdadm may be missing. If you later install those missing packages, the dependencies in appliance/Makefile.am never force appliance/supermin.d/packages to be rebuilt, so those packages will be forever missing from the appliance. Even 'make -C appliance clean all' will not fix this. You can work around this with: rm appliance/stamp-supermin make which forces appliance/supermin.d/packages to be rebuilt from scratch. Of course 'git clean -xdf' should have also fixed this, so I don't know if it applies to the problem you're having. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
It seems the requirement is to still have Jessie mirrors enabled as it fails even when installing the packages previously mentioned. I'll switch to use APT-Pinning with a hybrid stable/testing distro. Debian testing seems not to be the friendliest environment for building multi-dependencies binaries. Now I eventually succeeded to run the tests even though I have way more packages installed than I was expecting X-D. I'll proceed writing the tests for the new API. Thanks for the support. On 28/02/16 13:52, Richard W.M. Jones wrote:
There's one possible source of the problem:
I discovered that if you don't have all the appliance packages installed on the host before your first libguestfs build, then any missing packages don't get added to appliance/supermin.d/packages. Compare your appliance/packagelist with appliance/supermin.d/packages and look for packages present in the first file and missing in the second file -- mdadm may be missing.
If you later install those missing packages, the dependencies in appliance/Makefile.am never force appliance/supermin.d/packages to be rebuilt, so those packages will be forever missing from the appliance. Even 'make -C appliance clean all' will not fix this.
You can work around this with:
rm appliance/stamp-supermin make
which forces appliance/supermin.d/packages to be rebuilt from scratch.
Of course 'git clean -xdf' should have also fixed this, so I don't know if it applies to the problem you're having.
Rich.
participants (3)
-
Matteo Cafasso -
noxdafox -
Richard W.M. Jones