another missing link in febootstrap; failing tests for libguestfs
After the last round of patches to febootstrap, the image-based test in libguestfs still failed. It turned out that this happens because Debian started replacing /var/run and /var/lock with symlinks that point to a tmpfs mounted to /run. The symlinks were copied to the appliance but /run/lock did not exist, so pvcreate refused to run (script 'images/guest-aux/make-debian-img.sh'). After I added the following patch to helper/init.c, the image-based test worked. I am not certain whether this is the right approach, though. The next thing I'll be looking at are the following failed libguestfs tests: test-getlogin_r.c:42: assertion failed /bin/bash: line 5: 18338 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-getlogin_r test-readlink.h:41: assertion failed /bin/bash: line 5: 18514 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-readlink test-readlink.h:41: assertion failed /bin/bash: line 5: 18624 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-symlinkat -Hilko diff --git a/helper/init.c b/helper/init.c index 50ed19e..8f3834f 100644 --- a/helper/init.c +++ b/helper/init.c @@ -181,6 +181,12 @@ main () chdir ("/"); mount_proc (); + if (mount ("tmpfs", "/run", "tmpfs", + MS_NOEXEC|MS_NOSUID, "size=10%,mode=0755") == -1) { + perror ("mount: /run"); + exit (EXIT_FAILURE); + } +y mkdir ("/run/lock", 01777); print_uptime (); /* Run /init from ext2 filesystem. */
On Mon, Jun 06, 2011 at 12:57:40AM +0200, Hilko Bengen wrote:
After the last round of patches to febootstrap, the image-based test in libguestfs still failed. It turned out that this happens because Debian started replacing /var/run and /var/lock with symlinks that point to a tmpfs mounted to /run. The symlinks were copied to the appliance but /run/lock did not exist, so pvcreate refused to run (script 'images/guest-aux/make-debian-img.sh').
After I added the following patch to helper/init.c, the image-based test worked. I am not certain whether this is the right approach, though.
I think it's better to push this into libguestfs/appliance/init, instead of adding hacks to febootstrap. BTW this works OK for me (without hacks/patches) with Debian.
The next thing I'll be looking at are the following failed libguestfs tests:
test-getlogin_r.c:42: assertion failed /bin/bash: line 5: 18338 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-getlogin_r
This is a bug in gnulib. It's probably been fixed upstream, but it's hard to update gnulib in libguestfs without rewriting the ./bootstrap script. I started on this a while back but never finished it, with the result that we haven't updated gnulib in quite a while (almost exactly 1 year in fact). In Fedora we added this workaround at build time: http://pkgs.fedoraproject.org/gitweb/?p=libguestfs.git;a=blob;f=libguestfs.s...
test-readlink.h:41: assertion failed /bin/bash: line 5: 18514 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-readlink
test-readlink.h:41: assertion failed /bin/bash: line 5: 18624 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP.EUC-JP' LOCALE_ZH_CN='zh_CN.GB18030' MAKE='make' ${dir}$tst FAIL: test-symlinkat
I've not seen these bugs before, but they are both bugs in gnulib also. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
* Richard W.M. Jones:
I think it's better to push this into libguestfs/appliance/init, instead of adding hacks to febootstrap.
Not handling symlinks correctly (whatever "correct" means) would break other uses of febootstrap, too, so I think that it makes sense to handle this in febootstrap.
BTW this works OK for me (without hacks/patches) with Debian.
On a Squeeze system (6.0.1 according to /etc/debian_version), /var/lock and /var/run are still normal directories. The change that broke the test must have been introduced later. (The workstation I tested this on runs unstable.) -Hilko
Richard W.M. Jones wrote: ...
This is a bug in gnulib. It's probably been fixed upstream, but it's hard to update gnulib in libguestfs without rewriting the ./bootstrap script. I started on this a while back but never finished it, with the result that we haven't updated gnulib in quite a while (almost exactly 1 year in fact).
Hi Rich, With the following patches, libguestfs now bootstraps from cloned sources (via ./autogen.sh) using the very latest (as of a day or two ago) from gnulib. I did hit this failure: make libguestfs.pot-update make[1]: Entering directory `/var/tmp/libguestfs/po' make[1]: *** No rule to make target `../tools/virt-edit.pl',\ needed by `libguestfs.pot-update'. Stop. but got past it by running this: make -C po update-po Once I got it to build and pass "make check" I didn't try to narrow down precisely which patch(es) made the difference, so some of these changes may be unnecessary. Iterating to find a smaller set set didn't seem worthwhile. Here's shortlog output: build: update to latest gnulib bootstrap: use --libtool include config.h, even from examples examples/Makefile.am: link with libgnu.la for use of rpl_getcwd
On Fri, Jun 10, 2011 at 12:15:09PM +0200, Jim Meyering wrote:
With the following patches, libguestfs now bootstraps from cloned sources (via ./autogen.sh) using the very latest (as of a day or two ago) from gnulib. I did hit this failure:
make libguestfs.pot-update make[1]: Entering directory `/var/tmp/libguestfs/po' make[1]: *** No rule to make target `../tools/virt-edit.pl',\ needed by `libguestfs.pot-update'. Stop.
but got past it by running this:
make -C po update-po
This is a missing dependency or something like that. It's a "well known" step you have to take after checking out a fresh libguestfs from git ...
Once I got it to build and pass "make check" I didn't try to narrow down precisely which patch(es) made the difference, so some of these changes may be unnecessary. Iterating to find a smaller set set didn't seem worthwhile.
Here's shortlog output:
build: update to latest gnulib bootstrap: use --libtool include config.h, even from examples examples/Makefile.am: link with libgnu.la for use of rpl_getcwd
Thanks, I've applied this. It appears to be working for me, but I'm just running through 'make check' to be sure. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Fri, Jun 10, 2011 at 12:13:54PM +0100, Richard W.M. Jones wrote:
Thanks, I've applied this. It appears to be working for me, but I'm just running through 'make check' to be sure.
OK, I pushed the first two (gnulib changes), but I didn't push the second two (changes in examples/). I think it's better if the examples are truly standalone, and don't try to include <config.h>. If there's something in the examples which is not POSIX, it's better to remove it from the examples, instead of having them require gnulib. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (3)
-
Hilko Bengen -
Jim Meyering -
Richard W.M. Jones