[PATCH 0/2] supermin: fix with no dpkg installed
by Pino Toscano
f093ba80e0918484838dba46a747ffaecf983fb3 caused a regression (startup
failure) when dpkg is not installed.
Simple fix with simple test for it.
Pino Toscano (2):
dpkg: do not always run dpkg_primary_arch
tests: add a basic run test
src/dpkg.ml | 4 ++--
tests/Makefile.am | 3 ++-
tests/test-basic.sh | 28 ++++++++++++++++++++++++++++
3 files changed, 32 insertions(+), 3 deletions(-)
create mode 100755 tests/test-basic.sh
--
1.8.3.1
10 years, 9 months
[PATCH] Remove two more files that are generated by configure
by Hilko Bengen
---
mllib/Makefile.am | 2 +-
src/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index 0e317b2..ec624c9 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -18,7 +18,7 @@
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
- $(SOURCES)
+ $(filter-out config.ml.in,$(SOURCES))
CLEANFILES = *~ *.cmi *.cmo *.cmx *.cmxa *.o
diff --git a/src/Makefile.am b/src/Makefile.am
index 10f5203..768e716 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -58,7 +58,7 @@ EXTRA_DIST = \
$(BUILT_SOURCES) \
MAX_PROC_NR \
libguestfs.3 \
- libguestfs.pc libguestfs.pc.in \
+ libguestfs.pc.in \
guestfs.pod \
api-support/added \
api-support/README \
--
1.9.0
10 years, 9 months
[PATCH] Debian: Add systemd-related libraries (for guestfsd) to packagelist
by Hilko Bengen
---
appliance/packagelist.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index b93cd09..5e2a1aa 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -69,6 +69,8 @@ ifelse(DEBIAN,1,
libcap2
libhivex0
libpcre3
+ libsystemd-id128-0
+ libsystemd-journal0
libyajl2
linux-image
dnl syslinux 'suggests' mtools, but in reality it's a hard dependency:
--
1.9.0
10 years, 9 months
[PATCH] supermin: dpkg: Handle multiarch setups correctly
by Hilko Bengen
---
src/dpkg.ml | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/src/dpkg.ml b/src/dpkg.ml
index c0d3292..2662465 100644
--- a/src/dpkg.ml
+++ b/src/dpkg.ml
@@ -29,6 +29,10 @@ let dpkg_detect () =
Config.apt_get <> "no" &&
file_exists "/etc/debian_version"
+let dpkg_primary_arch =
+ let cmd = sprintf "%s --print-architecture" Config.dpkg in
+ List.hd (run_command_get_lines cmd)
+
let settings = ref no_settings
let dpkg_init s = settings := s
@@ -58,17 +62,20 @@ let dpkg_package_of_string str =
(quote str) in
let lines = run_command_get_lines cmd in
- (* AFAIK on Debian only a single package with a particular name
- * may be installed (ie no multilib etc crap). Hence:
- *)
- if List.length lines <> 1 then assert false;
- let line = List.hd lines in
- let line = string_split " " line in
- match line with
- | [ name; version; arch ] ->
- assert (version <> "");
- { name = name; version = version; arch = arch }
- | xs -> assert false
+ let pkgs = List.map (
+ fun line ->
+ let line = string_split " " line in
+ match line with
+ | [ name; version; arch ] ->
+ assert (version <> "");
+ { name = name; version = version; arch = arch }
+ | xs -> assert false)
+ lines in
+
+ (* On multiarch setups, only consider the primary architecture *)
+ List.find
+ (fun pkg -> pkg.arch = dpkg_primary_arch || pkg.arch = "all")
+ pkgs
(* Check if a package is installed. *)
and check_dpkg_installed name =
@@ -110,6 +117,10 @@ let dpkg_package_name pkg =
let dpkg = dpkg_of_pkg pkg in
dpkg.name
+let dpkg_package_name_arch pkg =
+ let dpkg = dpkg_of_pkg pkg in
+ sprintf "%s:%s" dpkg.name dpkg.arch
+
let dpkg_get_package_database_mtime () =
(lstat "/var/lib/dpkg/status").st_mtime
@@ -137,9 +148,9 @@ let dpkg_get_all_requires pkgs =
let dpkg_get_all_files pkgs =
let cmd =
- sprintf "%s -L %s | grep '^/' | grep -v '^/.$' | sort -u"
- Config.dpkg
- (quoted_list (List.map dpkg_package_name
+ sprintf "%s --listfiles %s | grep '^/' | grep -v '^/.$' | sort -u"
+ Config.dpkg_query
+ (quoted_list (List.map dpkg_package_name_arch
(PackageSet.elements pkgs))) in
let lines = run_command_get_lines cmd in
List.map (
--
1.9.0
10 years, 9 months
[PATCH 1/4] More fixes for situations where ocamlopt is not available
by Hilko Bengen
- run bindtests.opt only if available
- use ocamlc -custom
- Don't try to install native code if it hasn't been built (Thanks to Olaf Hering)
---
mllib/Makefile.am | 2 +-
ocaml/Makefile.am | 7 ++++++-
ocaml/examples/Makefile.am | 11 ++++-------
ocaml/run-bindtests | 2 ++
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index 2e35d1e..0e317b2 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -176,7 +176,7 @@ common_utils_tests: common_gettext.cmx common_utils.cmx common_utils_tests.cmx
else
common_utils_tests: common_gettext.cmo common_utils.cmo common_utils_tests.cmo
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
- mlguestfs.cma -linkpkg $^ -cclib -lncurses -o $@
+ mlguestfs.cma -linkpkg $^ -cclib -lncurses -custom -o $@
endif
TESTS_ENVIRONMENT = $(top_builddir)/run --test
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 708b2e7..7c8e515 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -171,13 +171,18 @@ depend: .depend
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
# Do the installation by hand, because we want to run ocamlfind.
+data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli
+if HAVE_OCAMLOPT
+data_hook_files += *.cmx *.cmxa
+endif
+
install-data-hook:
mkdir -p $(DESTDIR)$(OCAMLLIB)
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
guestfs \
- META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli
+ $(data_hook_files)
rm $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.*
rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a
diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am
index 472e180..de647fc 100644
--- a/ocaml/examples/Makefile.am
+++ b/ocaml/examples/Makefile.am
@@ -58,16 +58,13 @@ inspect_vm: inspect_vm.ml
$(OCAMLFIND) ocamlopt $(OCAMLFINDFLAGS) -package unix -linkpkg \
-warn-error A -I .. mlguestfs.cmxa $< -o $@
else
-
-# This avoids:
-# Error: Error on dynamically loaded library: ../dllmlguestfs.so: libguestfs.so.0: cannot open shared object file: No such file or directory
create_disk: create_disk.ml
- $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
- -warn-error A -I .. mlguestfs.cma $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
+ -warn-error A -I .. mlguestfs.cma -custom $< -o $@
inspect_vm: inspect_vm.ml
- $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
- -warn-error A -I .. mlguestfs.cma $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
+ -warn-error A -I .. mlguestfs.cma -custom $< -o $@
endif
endif
diff --git a/ocaml/run-bindtests b/ocaml/run-bindtests
index 3b73e8d..1fa54ec 100755
--- a/ocaml/run-bindtests
+++ b/ocaml/run-bindtests
@@ -21,5 +21,7 @@ set -e
./bindtests.bc > bindtests.tmp
diff -u $srcdir/../bindtests bindtests.tmp
+test -x ./bindtests.opt || exit 0
+
./bindtests.opt > bindtests.tmp
diff -u $srcdir/../bindtests bindtests.tmp
--
1.9.0
10 years, 9 months
[PATCH 0/8] virt-builder: use .conf files for configuration
by Pino Toscano
Hi,
attached there is a serie of patches that completes the work on making
virt-builder use .conf files, shipped in XDG directories, to configure
all the available sources of indexes used.
This also removes the hardcoded default location, replaced now with a
configuration file (which may be not used at all).
Thanks,
Pino Toscano (8):
builder: allow "no key" as key in Sigchecker
builder: use Sigchecker.gpgkey_type for the fingerprint
builder: add functions to read XDG_CONFIG_DIRS and XDG_CONFIG_PATH
builder: extract the default key to file
builder: switch sources to .conf files
builder: remove VIRT_BUILDER_SOURCE and VIRT_BUILDER_FINGERPRINT
builder: remove the default fingerprint/pubkey
builder: update documentation
.gitignore | 3 +
builder/Makefile.am | 10 +-
builder/builder.ml | 19 ++-
builder/cmdline.ml | 20 +--
builder/libguestfs.conf.in | 3 +
builder/libguestfs.gpg | 64 +++++++++
builder/list_entries.ml | 22 ++-
builder/list_entries.mli | 2 +-
builder/paths.ml | 15 ++
builder/sigchecker.ml | 87 ++----------
builder/sigchecker.mli | 3 +-
builder/sources.ml | 122 ++++++++++++++++
builder/sources.mli | 25 ++++
.../virt-builder/repos.d/test-index.conf.in | 2 +
builder/test-virt-builder-list.sh | 8 +-
builder/test-virt-builder-planner.sh | 2 +-
builder/test-virt-builder.sh | 2 +-
.../virt-builder/repos.d/libguestfs.conf.in | 3 +
builder/virt-builder.pod | 154 ++++++++++-----------
configure.ac | 9 ++
po/POTFILES-ml | 1 +
run.in | 6 +-
22 files changed, 383 insertions(+), 199 deletions(-)
create mode 100644 builder/libguestfs.conf.in
create mode 100644 builder/libguestfs.gpg
create mode 100644 builder/sources.ml
create mode 100644 builder/sources.mli
create mode 100644 builder/test-config/virt-builder/repos.d/test-index.conf.in
create mode 100644 builder/test-website/virt-builder/repos.d/libguestfs.conf.in
--
1.8.3.1
10 years, 9 months
[PATCH] supermin: Fix build with bytecode compiler
by Hilko Bengen
---
src/Makefile.am | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 7f99b8a..932881b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -104,17 +104,18 @@ supermin_CFLAGS = \
BOBJECTS = $(SOURCES_ML:.ml=.cmo)
XOBJECTS = $(SOURCES_ML:.ml=.cmx)
+OCAMLPACKAGES = -package unix,str
+OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
+
if !HAVE_OCAMLOPT
OBJECTS = $(BOBJECTS)
BEST = c
+OCAMLFLAGS += -custom
else
OBJECTS = $(XOBJECTS)
BEST = opt
endif
-OCAMLPACKAGES = -package unix,str
-OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
-
supermin_DEPENDENCIES = $(OBJECTS) ext2init-bin.o
supermin_LDADD = ext2init-bin.o ../lib/libgnu.a
--
1.9.0
10 years, 9 months
FYI: [PATCH supermin] rpm: Add support for OpenSUSE.
by Richard W.M. Jones
Olaf,
I added this patch to supermin 5, which enables support for OpenSUSE /
zypper, and allowed me to rebuild libguestfs on 13.1.
It is largely based on the previous code that you did, but I have
dropped support for the --packager-config option. I can add this back
if you want, although I'd like to avoid use of the 'inifiles' library.
If you want to try this you will need to:
- git clone supermin
- compile supermin
- either install supermin 5, or:
export SUPERMIN=/path/to/supermin/src/supermin
- configure & compile libguestfs (>= 1.25.38) in the usual way
Rich.
10 years, 9 months
Frugalware / pacman-g2 support in supermin 5
by Richard W.M. Jones
Hello Daniel,
Supermin was recently rewritten upstream. As part of this rewrite,
existing package managers had to be ported to the new codebase. I did
this for all existing drivers *except* for Frugalware/pacman-g2. This
is the purpose of this email.
The new API that package managers have to use is here:
https://github.com/libguestfs/supermin/blob/master/src/package_handler.ml...
For pacman-g2 it requires that there is a way to:
(1) quickly
(2) list the dependencies of
(3) installed packages
(4) without downloading anything
Unfortunately I cannot find a way to do satisfy all of these
conditions. The previous driver did it as a side-effect of
downloading/installing packages into a chroot, but this does not
satisfy conditions (1) & (4).
Arch Linux has a tool called 'pactree -u' which is ideal, and is how
we solve this with pacman. However Frugalware does not appear to
package this tool.
It may also be possible to do something using libalpm, but I did not
look at this in detail.
Anyway the above explains why the Frugalware driver in supermin 5 does
not work. If you can suggest how to do the above, or provide patches,
then I may be able to help to re-enable this driver, however at this
time I don't intend to investigate this further.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
10 years, 9 months