[PATCH] builder: Remove a few unnecessary 'virt-builder' strings from error messages.
by Richard W.M. Jones
---
builder/cmdline.ml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index 7aa0c45..67a279d 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -234,11 +234,11 @@ read the man page virt-builder(1).
)
| `List ->
if format <> None then
- error (f_"virt-builder --list: use '--list-format', not '--format'");
+ error (f_"--list: use '--list-format', not '--format'");
(match args with
| [] -> ""
| _ ->
- error (f_"virt-builder --list does not need any extra arguments")
+ error (f_"--list option does not need any extra arguments")
)
| `Notes ->
(match args with
@@ -246,7 +246,7 @@ read the man page virt-builder(1).
| [] ->
error (f_"virt-builder --notes os-version\nMissing 'os-version'. Use '--list' to list available template names.")
| _ ->
- error (f_"virt-builder: too many parameters, expecting 'os-version'");
+ error (f_"--notes: too many parameters, expecting 'os-version'");
)
| `Cache_all
| `Print_cache
@@ -254,7 +254,7 @@ read the man page virt-builder(1).
(match args with
| [] -> ""
| _ ->
- error (f_"virt-builder --cache-all-templates/--print-cache/--delete-cache does not need any extra arguments")
+ error (f_"--cache-all-templates/--print-cache/--delete-cache does not need any extra arguments")
)
| `Get_kernel ->
(match args with
@@ -262,7 +262,7 @@ read the man page virt-builder(1).
| [] ->
error (f_"virt-builder --get-kernel image\nMissing 'image' (disk image file) argument")
| _ ->
- error (f_"virt-builder --get-kernel: too many parameters")
+ error (f_"--get-kernel: too many parameters")
) in
(* Check source(s) and fingerprint(s). *)
--
2.3.1
9 years, 7 months
[PATCH] When calling getline first time, initialize length to zero.
by Richard W.M. Jones
The man page for getline says:
ssize_t getline(char **lineptr, size_t *n, FILE *stream);
[...]
If *lineptr is set to NULL and *n is set 0 before the call, then get‐
line() will allocate a buffer for storing the line. This buffer should
be freed by the user program even if getline() failed.
which seems to indicate that we must initialize both line and len to 0
before the first call to getline.
In several places we were not initializing len. The program still
worked fine, but it seems better to initialize the length anyway.
---
df/estimate-max-threads.c | 2 +-
examples/libvirt-auth.c | 2 +-
fuse/test-fuse.c | 2 +-
p2v/main.c | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/df/estimate-max-threads.c b/df/estimate-max-threads.c
index 7d5b090..ca1fd42 100644
--- a/df/estimate-max-threads.c
+++ b/df/estimate-max-threads.c
@@ -60,7 +60,7 @@ read_line_from (const char *cmd)
{
FILE *pp;
char *ret = NULL;
- size_t allocsize;
+ size_t allocsize = 0;
pp = popen (cmd, "r");
if (pp == NULL)
diff --git a/examples/libvirt-auth.c b/examples/libvirt-auth.c
index 699dd87..8a5db77 100644
--- a/examples/libvirt-auth.c
+++ b/examples/libvirt-auth.c
@@ -109,7 +109,7 @@ auth_callback (guestfs_h *g,
size_t i;
char *prompt;
char *reply = NULL;
- size_t allocsize;
+ size_t allocsize = 0;
char *pass;
ssize_t len;
int r;
diff --git a/fuse/test-fuse.c b/fuse/test-fuse.c
index 84d58e8..6e91d71 100644
--- a/fuse/test-fuse.c
+++ b/fuse/test-fuse.c
@@ -250,7 +250,7 @@ test_fuse (void)
fflush (stdout)
FILE *fp;
char *line = NULL;
- size_t len;
+ size_t len = 0;
struct stat statbuf;
char buf[128];
ssize_t r;
diff --git a/p2v/main.c b/p2v/main.c
index 15628ba..1f8370b 100644
--- a/p2v/main.c
+++ b/p2v/main.c
@@ -306,7 +306,7 @@ partition_parent (dev_t part_dev)
{
CLEANUP_FCLOSE FILE *fp = NULL;
CLEANUP_FREE char *path = NULL, *content = NULL;
- size_t len;
+ size_t len = 0;
unsigned parent_major, parent_minor;
if (asprintf (&path, "/sys/dev/block/%d:%d/../dev",
@@ -521,7 +521,7 @@ read_cmdline (void)
{
CLEANUP_FCLOSE FILE *fp = NULL;
char *ret = NULL;
- size_t len;
+ size_t len = 0;
fp = fopen ("/proc/cmdline", "re");
if (fp == NULL) {
--
2.3.1
9 years, 7 months
[PATCH] resize: show sector infor in debug_partition
by Chen Hanxiao
Show partition sector data and target partition sector data
in debug_partition.
Also, if --verbose, call debug_partition again before
parted partitions.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
resize/resize.ml | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/resize/resize.ml b/resize/resize.ml
index 8e69d44..ae8339d 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -80,11 +80,15 @@ and partition_type =
| LogicalPartition
| NoTypePartition
-let rec debug_partition p =
+let rec debug_partition ?(sectsize=512L) p =
printf "%s:\n" p.p_name;
printf "\tpartition data: %ld %Ld-%Ld (%Ld bytes)\n"
p.p_part.G.part_num p.p_part.G.part_start p.p_part.G.part_end
p.p_part.G.part_size;
+ printf "\tpartition sector data: %Ld-%Ld\n"
+ (p.p_part.G.part_start /^ sectsize) (p.p_part.G.part_end /^ sectsize);
+ printf "\ttarget partition sector data: %Ld-%Ld \n"
+ p.p_target_start p.p_target_end;
printf "\tbootable: %b\n" p.p_bootable;
printf "\tpartition ID: %s\n"
(match p.p_id with
@@ -545,7 +549,7 @@ read the man page virt-resize(1).
if verbose then (
printf "%d partitions found\n" (List.length partitions);
- List.iter debug_partition partitions
+ List.iter (debug_partition ~sectsize:sectsize) partitions
);
(* Build a data structure describing LVs on the source disk. *)
@@ -1119,6 +1123,11 @@ read the man page virt-resize(1).
calculate_target_partitions 1 start ~create_surplus:true partitions in
+ if verbose then (
+ printf "After calculate target partitions:\n";
+ List.iter (debug_partition ~sectsize:sectsize) partitions
+ );
+
let mbr_part_type x =
match parttype, x.p_part.G.part_num <= 4_l, x.p_type with
(* for GPT, all partitions are regarded as Primary Partition. *)
--
2.1.0
9 years, 7 months
[PATCH 1/2] build: factor out the OCaml link.sh scripts
by Pino Toscano
Create a single ocaml-link.sh script, which supports a -cclib parameter
so it can be used instead of the per-project link.sh scripts.
As result, the libraries for each OCaml application can be moved back to
each Makefile.am.
---
.gitignore | 7 -------
builder/Makefile.am | 14 ++++++++++++--
builder/link.sh.in | 22 ----------------------
configure.ac | 14 --------------
customize/Makefile.am | 13 +++++++++++--
customize/link.sh.in | 22 ----------------------
mllib/Makefile.am | 13 +++++++++++--
mllib/link.sh.in | 22 ----------------------
ocaml-link.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
resize/Makefile.am | 11 +++++++++--
resize/link.sh.in | 22 ----------------------
sparsify/Makefile.am | 7 +++++--
sparsify/link.sh.in | 22 ----------------------
sysprep/Makefile.am | 12 ++++++++++--
sysprep/link.sh.in | 22 ----------------------
v2v/Makefile.am | 17 +++++++++++++----
v2v/link.sh.in | 22 ----------------------
17 files changed, 114 insertions(+), 191 deletions(-)
delete mode 100644 builder/link.sh.in
delete mode 100644 customize/link.sh.in
delete mode 100644 mllib/link.sh.in
create mode 100755 ocaml-link.sh
delete mode 100644 resize/link.sh.in
delete mode 100644 sparsify/link.sh.in
delete mode 100644 sysprep/link.sh.in
delete mode 100644 v2v/link.sh.in
diff --git a/.gitignore b/.gitignore
index 318cfa0..29f9d6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,7 +59,6 @@ Makefile.in
/builder/index-parse.h
/builder/index-scan.c
/builder/libguestfs.conf
-/builder/link.sh
/builder/*.qcow2
/builder/stamp-virt-builder.pod
/builder/stamp-virt-index-validate.pod
@@ -95,7 +94,6 @@ Makefile.in
/customize/customize_cmdline.mli
/customize/customize-options.pod
/customize/customize-synopsis.pod
-/customize/link.sh
/customize/stamp-virt-customize.pod
/customize/virt-customize
/customize/virt-customize.1
@@ -311,7 +309,6 @@ Makefile.in
/mllib/dummy
/mllib/JSON_tests
/mllib/libdir.ml
-/mllib/link.sh
/mllib/oUnit-*
/ocaml/bindtests.bc
/ocaml/bindtests.opt
@@ -423,7 +420,6 @@ Makefile.in
/rescue/virt-rescue
/rescue/virt-rescue.1
/resize/.depend
-/resize/link.sh
/resize/stamp-virt-resize.pod
/resize/virt-resize
/resize/virt-resize.1
@@ -441,7 +437,6 @@ Makefile.in
/ruby/stamp-rdoc
/run
/sparsify/.depend
-/sparsify/link.sh
/sparsify/stamp-virt-sparsify.pod
/sparsify/virt-sparsify
/sparsify/virt-sparsify.1
@@ -476,7 +471,6 @@ Makefile.in
/stamp-guestfs-release-notes.pod
/stamp-h1
/sysprep/.depend
-/sysprep/link.sh
/sysprep/stamp-script1.sh
/sysprep/stamp-script2.sh
/sysprep/stamp-script4.sh
@@ -566,7 +560,6 @@ Makefile.in
/v2v/centos-6.img
/v2v/centos-7.0.img
/v2v/fedora-20.img
-/v2v/link.sh
/v2v/oUnit-*
/v2v/rhel-5.10.img
/v2v/rhel-6.5.img
diff --git a/builder/Makefile.am b/builder/Makefile.am
index bfe2f79..182f5a4 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -150,6 +150,16 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ -pthread -lpthread \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBCRYPT_LIBS) \
+ $(LIBLZMA_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -162,9 +172,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_builder_DEPENDENCIES = $(OBJECTS)
+virt_builder_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_builder_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/builder/link.sh.in b/builder/link.sh.in
deleted file mode 100644
index 964617f..0000000
--- a/builder/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-pthread -lpthread -lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBLZMA_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
diff --git a/configure.ac b/configure.ac
index 7a609cb..1807666 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1708,14 +1708,8 @@ mkdir -p \
dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
[chmod +x,-w appliance/libguestfs-make-fixed-appliance])
-AC_CONFIG_FILES([builder/link.sh],
- [chmod +x,-w builder/link.sh])
-AC_CONFIG_FILES([customize/link.sh],
- [chmod +x,-w customize/link.sh])
AC_CONFIG_FILES([inspector/test-xmllint.sh],
[chmod +x,-w inspector/test-xmllint.sh])
-AC_CONFIG_FILES([mllib/link.sh],
- [chmod +x,-w mllib/link.sh])
AC_CONFIG_FILES([p2v/virt-p2v-make-disk],
[chmod +x,-w p2v/virt-p2v-make-disk])
AC_CONFIG_FILES([p2v/virt-p2v-make-kickstart],
@@ -1726,16 +1720,8 @@ AC_CONFIG_FILES([pick-guests.pl],
[chmod +x,-w pick-guests.pl])
AC_CONFIG_FILES([podwrapper.pl],
[chmod +x,-w podwrapper.pl])
-AC_CONFIG_FILES([resize/link.sh],
- [chmod +x,-w resize/link.sh])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
-AC_CONFIG_FILES([sparsify/link.sh],
- [chmod +x,-w sparsify/link.sh])
-AC_CONFIG_FILES([sysprep/link.sh],
- [chmod +x,-w sysprep/link.sh])
-AC_CONFIG_FILES([v2v/link.sh],
- [chmod +x,-w v2v/link.sh])
AC_CONFIG_FILES([Makefile
align/Makefile
diff --git a/customize/Makefile.am b/customize/Makefile.am
index d36721a..8f0a2d8 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -109,6 +109,15 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBCRYPT_LIBS) \
+ $(LIBVIRT_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -121,9 +130,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_customize_DEPENDENCIES = $(OBJECTS)
+virt_customize_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_customize_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/customize/link.sh.in b/customize/link.sh.in
deleted file mode 100644
index 15b6e66..0000000
--- a/customize/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index 0b43684..c7967b8 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -95,6 +95,15 @@ if HAVE_OCAML_PKG_OUNIT
OCAMLPACKAGES_TESTS += -package oUnit
endif
+OCAMLCLIBS = \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBCRYPT_LIBS) \
+ $(LIBVIRT_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -107,9 +116,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-dummy_DEPENDENCIES = $(OBJECTS)
+dummy_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
dummy_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/mllib/link.sh.in b/mllib/link.sh.in
deleted file mode 100644
index 15b6e66..0000000
--- a/mllib/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
diff --git a/ocaml-link.sh b/ocaml-link.sh
new file mode 100755
index 0000000..bbb9b98
--- /dev/null
+++ b/ocaml-link.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# (C) Copyright 2015 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Hack automake to link OCaml-based binaries properly.
+# There is no other way to add the -cclib parameter to the end of
+# the command line.
+
+# Usage:
+# ./ocaml-link.sh -cclib '...' -- ARGS
+# Pass the cclib argument separately, and the rest as separated
+# arguments.
+
+TEMP=`getopt -a -o '' --long 'cclib:' \
+ -n "$(basename $0)" -- "$@"`
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+eval set -- "$TEMP"
+
+cclib=
+
+while true ; do
+ case "$1" in
+ -cclib|--cclib) cclib="$2" ; shift 2 ;;
+ --) shift ; break ;;
+ *) echo "Internal error!" ; exit 1 ;;
+ esac
+done
+
+exec "$@" -linkpkg -cclib "${cclib}"
diff --git a/resize/Makefile.am b/resize/Makefile.am
index 12afd09..657b626 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -75,6 +75,13 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -87,9 +94,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_resize_DEPENDENCIES = $(OBJECTS)
+virt_resize_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_resize_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/resize/link.sh.in b/resize/link.sh.in
deleted file mode 100644
index 2835f0e..0000000
--- a/resize/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index 205641d..98ab729 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -71,6 +71,9 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ $(LIBTINFO_LIBS)
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -83,10 +86,10 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_sparsify_DEPENDENCIES = $(OBJECTS)
+virt_sparsify_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_sparsify_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/sparsify/link.sh.in b/sparsify/link.sh.in
deleted file mode 100644
index 9892b07..0000000
--- a/sparsify/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '@LIBTINFO_LIBS@'
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index c57060d..c1d1245 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -138,6 +138,14 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBCRYPT_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -150,9 +158,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_sysprep_DEPENDENCIES = $(OBJECTS)
+virt_sysprep_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_sysprep_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
diff --git a/sysprep/link.sh.in b/sysprep/link.sh.in
deleted file mode 100644
index 7d8ccec..0000000
--- a/sysprep/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 8315eb1..03f818c 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -160,6 +160,15 @@ if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
+OCAMLCLIBS = \
+ -lutils \
+ $(LIBTINFO_LIBS) \
+ $(LIBCRYPT_LIBS) \
+ $(LIBVIRT_LIBS) \
+ $(LIBXML2_LIBS) \
+ $(LIBINTL) \
+ -lgnu
+
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR)
if !HAVE_OCAMLOPT
@@ -172,9 +181,9 @@ BEST = opt
OCAMLLINKFLAGS = mlguestfs.cmxa
endif
-virt_v2v_DEPENDENCIES = $(OBJECTS)
+virt_v2v_DEPENDENCIES = $(OBJECTS) $(top_srcdir)/ocaml-link.sh
virt_v2v_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(OBJECTS) -o $@
@@ -319,9 +328,9 @@ v2v_unit_tests_THEOBJECTS = $(v2v_unit_tests_XOBJECTS)
v2v_unit_tests.cmx: OCAMLPACKAGES += -package oUnit
endif
-v2v_unit_tests_DEPENDENCIES = $(v2v_unit_tests_THEOBJECTS)
+v2v_unit_tests_DEPENDENCIES = $(v2v_unit_tests_THEOBJECTS) $(top_srcdir)/ocaml-link.sh
v2v_unit_tests_LINK = \
- ./link.sh \
+ $(top_srcdir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) \
$(OCAMLPACKAGES) -package oUnit \
$(OCAMLLINKFLAGS) \
diff --git a/v2v/link.sh.in b/v2v/link.sh.in
deleted file mode 100644
index 15b6e66..0000000
--- a/v2v/link.sh.in
+++ /dev/null
@@ -1,22 +0,0 @@
-# libguestfs Makefile.am
-# @configure_input@
-# (C) Copyright 2014 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Hack automake to link binary properly. There is no other way to add
-# the -cclib parameter to the end of the command line.
-
-exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
--
2.1.0
9 years, 7 months
about libguestfs 'AVAILABILITY'
by fu lirong
Hi all:
I installed libguestfs-1.29.40 on both ubuntu 12.04 and ubuntu
14.04. Both of them have the same problems,It is about the 'AVAILABILITY'
. I build libguestfs by tarball , everything is ok except the commond :
make check .
on ubuntu 12.04 the error is
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
/usr/Libvmi/libguestfs-1.29.40/tests/guests/guest-aux/make-fedora-img.pl
line 103.
/usr/Libvmi/libguestfs-1.29.40/run: command failed with exit code 2
make[2]: *** [stamp-fedora-md.img] Error 2
make[2]: Leaving directory `/usr/ /libguestfs-1.29.40/tests/guests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/usr/Libvmi/libguestfs-1.29.40/tests/guests'
on ubuntu 14.04 the error is
feature 'lvm2' 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.
then I execute :libguestfs-test-tool
there is something wrong
I execute make quickcheck
there is something wrong too!
I just I have no idea about the 'AVAILABILITY' problems . I will be
very excited if the problem can be solved.
thanks again ! hope you have a good day!
sincerely
9 years, 7 months