Commit Graph

732 Commits

Author SHA1 Message Date
Richard W.M. Jones
3f5d080d02 builder: templates: Add Fedora 33 2020-11-02 10:13:22 +00:00
Richard W.M. Jones
75abec1f70 include: Move lib/guestfs.h to include/guestfs.h
This brings libguestfs into line with other projects which have a
separate include/ directory for the public header.

It's also the case that <guestfs.h> has never particularly belonged in
the lib/ subdirectory.  Some tools add -Ilib/ but they only need
<guestfs.h> and not any other headers from that directory, and
separating out the public header allows us to clean those up.  This is
certainly the case for examples, and some language bindings and some
tests.

In future I'm hopeful we can use this as the basis to tease out other
dependencies, as a prelude to separating them out from the repo.
2020-09-21 18:38:28 +01:00
Richard W.M. Jones
4837698d83 builder: templates: Add CentOS 8.2 and RHEL 8.2. 2020-06-16 12:51:09 +01:00
Richard W.M. Jones
6670dc0fbf builder: templates: Add centos-7.8, fedora-32, rhel-7.8.
Ubuntu 20.04 could not be built because their installer has changed in
a way which is not compatible with the current build script.  This
needs some work to fix.
2020-06-04 15:22:38 +01:00
Richard W.M. Jones
26324d5445 builder: templates: Add Ubuntu 20.04 code name (focal). 2020-05-05 22:23:49 +01:00
Richard W.M. Jones
a6ed62b0a6 builder: Fix all download.devel links.
All broken in early 2020 for no discernible reason.
2020-04-30 12:33:11 +01:00
Geoff Toole
ef2761eaa0 build: Fix linking of OCaml components when srcdir != builddir
ocaml-link.sh is a generated file, so run it from the build directory.
Remove it from EXTRA_DIST and also adjust docs/guestfs-hacking.pod
accordingly.
2020-04-20 09:31:35 +01:00
Pino Toscano
b45b7cc08f builder: templates: add the AppStream repo
It is generally used together with BaseOS (which contains a restricted
set of packages), so add it to the preconfigured repositories by
default.
2020-03-12 10:13:03 +01:00
Richard W.M. Jones
0e17236d7d Update copyright dates to 2020. 2020-03-06 19:32:32 +00:00
Richard W.M. Jones
d6fcf519f2 builder: Fix const correctness for OCaml 4.10.
String_val now returns a const char *.
2020-02-06 10:33:39 +00:00
Pino Toscano
78a18b20e1 tests: fix srcdir references
Make sure to properly reference to files in the source directory.
2019-12-17 15:33:21 +01:00
Richard W.M. Jones
5469db383a builder: templates: Build RHEL 8.1 image internally. 2019-12-12 15:22:50 +00:00
Richard W.M. Jones
9c693ca0e8 builder: templates: Add Fedora 31. 2019-11-12 09:58:46 +00:00
Richard W.M. Jones
20c2dfbe00 generator, customize, v2v: Only place generated files in libguestfs or common.
After the proposed split of the libguestfs repo, we will end up with
the following layout:

  libguestfs.git
      common -> git submodule libguestfs-common.git
      generator

  virt-v2v.git
      common -> git submodule libguestfs-common.git

  guestfs-tools.git
      common -> git submodule libguestfs-common.git

The generator will only be able to write to libguestfs directories and
the common directory/submodule.  This is mostly the case already with
only 6 exceptions:

  customize/customize-options.pod
  customize/customize-synopsis.pod
  customize/customize_cmdline.ml
  customize/customize_cmdline.mli
  v2v/uefi.ml
  v2v/uefi.mli

This commit moves these files around so they appear under common/ml*

It is somewhat unsatisfactory because it involves copying files
around, but there are some mitigating factors:

(1) Any changes now give us more freedom to develop faster and thus
clean things up in future.

(2) The v2v/uefi files ought to go away in future anyway.

This is simple code motion and should have no effect on the built
programs or tests.
2019-10-14 18:37:29 +01:00
Richard W.M. Jones
ddfec6a97d customize: Move Firstboot and SELinux_relabel modules to common/mlcustomize.
These two modules are a dependency of virt-v2v.  Since we intend to
split virt-v2v from the other OCaml virt-* programs, we cannot have a
dependency between virt-v2v and virt-customize.  Instead we must move
the modules to a common directory (common/mlcustomize) and have both
tools depending on the modules from there.

This is simple refactoring and should not affect how the programs work
or are tested.
2019-10-14 12:36:47 +01:00
Richard W.M. Jones
a3320aaa50 builder: templates: Add CentOS 8.0 2019-10-04 09:01:32 +01:00
Richard W.M. Jones
f7733f44c3 builder: templates: Work around for CentOS 8.0 kickstart brokenness. 2019-10-04 09:01:05 +01:00
Richard W.M. Jones
9f516b4fcc builder: templates: Increase RAM for installation to 4G on all architectures.
We thought this could solve the CentOS problem, but it did not.
However it's probably a useful change anyway.
2019-10-02 10:23:31 +01:00
Richard W.M. Jones
b8372310cc builder: templates: Add support for centos-8.0.
Unfortunately I could not get the install to work yet:
https://lists.centos.org/pipermail/centos-devel/2019-September/017813.html
2019-10-02 10:23:31 +01:00
Pino Toscano
02890096d5 builder: templates: set "unassigned" hostname
By default the installer will set the hostname to what the DHCP returns,
exposing details of the machine where make-template.ml runs.

Instead, force "unassigned-hostname.unassigned-domain" as hostname, so
plays nicely with the hostname setting code in virt-customize.
2019-09-26 13:32:50 +02:00
Richard W.M. Jones
bbf4aeaf2b builder: templates: Add centos-7.7. 2019-09-18 10:52:12 +01:00
Richard W.M. Jones
cece35e114 builder: templates: Add rhel-7.7 kickstart and virt-install command. 2019-09-18 10:52:12 +01:00
Richard W.M. Jones
11923627cd builder: templates: Add Debian 10 (buster). 2019-08-20 16:59:56 +01:00
Pino Toscano
0cafcc0e88 build: build C sources using OCaml API with CAML_NAME_SPACE
This way no non-namespaced OCaml C symbols are used, reducing the risk
of clashes with other code.

The only exception is ocaml-augeas, which does not build with
CAML_NAME_SPACE; it will be fixed upstream, and it affects only
ocaml-augeas itself.
2019-05-28 11:39:20 +02:00
Richard W.M. Jones
052d2be483 builder: templates: Add RHEL 8.0 (x86-64 only for now). 2019-05-10 16:24:53 +01:00
Richard W.M. Jones
652e8de397 builder: templates: Remove RHEL 8 Alpha temporary hacks. 2019-05-10 16:24:53 +01:00
Richard W.M. Jones
05decc6976 builder: Fedora 30 templates. 2019-05-04 21:07:05 +01:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Richard W.M. Jones
d9f5e47f82 tests: Fix console for slow tests on Ubuntu 18.04.
Use the same fix as for Debian and Ubuntu 16.04.
2018-12-11 16:38:55 +00:00
Richard W.M. Jones
0d2ce92e55 builder: Add a second archive repo to the virt-builder repos.
builder.libguestfs.org has almost run out of space.  I would like to
move templates for older guests to the archive site (which is slower
but has unlimited space).  The easiest way to do this is to add a
second repo.

This only affects obsolete/unsupported Fedora releases.
2018-12-07 11:23:23 +00:00
Richard W.M. Jones
217002b2e2 builder: Fix redirect in virt-builder configuration.
For a while libguestfs.org/builder has redirected to
builder.libguestfs.org.  This change just makes virt-builder go direct
to the subsite instead of via the redirect.
2018-12-07 11:23:23 +00:00
Richard W.M. Jones
b8a7672936 builder: templates: Build CentOS 7.6. 2018-12-06 15:48:27 +00:00
Richard W.M. Jones
9c8d133455 Replace -nodefconfig with -no-user-config.
This option was removed from qemu for no apparent reason except to
break existing consumers.  It does the same as -no-user-config, added
in May 2012, so use that instead.
2018-11-30 12:18:01 +00:00
Richard W.M. Jones
3430c2dd65 builder: templates: Set 0644 permissions on final disk image.
I think libvirt or virt-install has changed recently so that it
creates disk images which are not public readable.  This has lead to
me uploading two sets of non-readable templates for virt-builder.  Set
the mode explicitly to 0644.

Thanks: Laine Stump, Jacob Shivers.
2018-11-06 21:46:20 +00:00
Richard W.M. Jones
97a8833a1b builder: Add RHEL 7.6 templates. 2018-11-01 12:12:21 +00:00
Richard W.M. Jones
9bc1eda0a9 builder: Add Fedora 29 templates. 2018-11-01 12:12:21 +00:00
Richard W.M. Jones
d23b89f217 builder: templates: Add RHEL 6.9, 6.10. 2018-10-15 22:15:37 +01:00
Richard W.M. Jones
34c23403c5 tools: Ensure CFLAGS and LDFLAGS are passed to all OCaml binaries (RHBZ#1624130).
After this commit, all annocheck errors are fixed except for:

  Hardened: virt-get-kernel: MAYB: Gaps were detected in the annobin coverage.  Run with -v to list.

After discussion with the annocheck maintainers this gap in coverage
(which corresponds to the OCaml runtime) seems to be caused either by
the runtime not being linked with the right flags, or might be a bug
in annocheck itself.  In any case it's not something that can be
resolved within the scope of libguestfs.
2018-09-21 10:16:34 +01:00
Pino Toscano
ec438b7b85 mltools: create a cmdline_options struct
Instead of returning directly a Getopt.t handle, now
Tools_utils.create_standard_options returns a struct, which at the
moment contains only the Getopt.t handle.  This way, it will be easy to
add more data needed for handling standard command line options.

This is mostly refactoring, with no functional changes.
2018-09-20 17:52:53 +02:00
Richard W.M. Jones
089f0345f4 builder: templates: Add Windows template support.
Provides support for building:

 - Windows 7
 - Windows Server 2008 R2
 - Windows Server 2012
 - Windows Server 2012 R2
 - Windows Server 2016

Note that these images cannot be released to the public because of
obvious licensing issues.  But this documents how we build them for
internal consumption so that others can also build them.

Thanks: Christophe Fergeau, Tomáš Golembiovský.
2018-09-13 09:51:58 +01:00
Richard W.M. Jones
755834c797 builder: templates: Use virt-sparsify --in-place (instead of copying).
virt-sparsify in copying mode takes a huge amount of temporary space
and takes a very long time.  In any case it's not really necessary for
modern guests since in-place sparsification is fully supported now.
2018-09-13 09:17:21 +01:00
Richard W.M. Jones
e6895bd9d2 builder: templates: Specify --arch explicitly, even on x86_64. 2018-09-11 16:52:10 +01:00
Richard W.M. Jones
cc01166a24 builder: templates: Make UEFI code arch-independent.
Previously it only worked for aarch64.
2018-09-11 16:52:10 +01:00
Richard W.M. Jones
613c1782ea builder: templates: Refactor code for using UEFI.
Simple refactoring.
2018-09-11 16:52:10 +01:00
Richard W.M. Jones
00fff03485 builder: templates: Refactor code for adding --initrd-inject.
Initrd is a Linux thing, so this code should only be used for
Linux-based OSes.  Refactor to make it a bit cleaner.
2018-09-11 16:52:10 +01:00
Richard W.M. Jones
d0ff42dfa2 builder: templates: Add a can_sysprep_os function.
Does virt-sysprep know how to sysprep this disk image?  Add a function
to find out.

Just refactoring.
2018-09-11 16:52:10 +01:00
Richard W.M. Jones
112880e61b builder: templates: Rename make_kickstart function.
This function will soon be used to generate Windows unattended.xml
files (as well as Debian preseed) so just rename it back to
‘make_kickstart’ rather than attempting to explain in the name every
way it could be used.
2018-09-11 16:52:10 +01:00
Richard W.M. Jones
e9bd010f6a builder: templates: Add generic method for deleting files on exit.
Simple refactoring.
2018-09-11 16:52:10 +01:00
Pino Toscano
d7772fb78b builder: index_parser_tests: really use parameter
Really use the parameter of the "read_file" function, instead of
hardcoding "out".  This does not change the behaviour, since all the
callers already use "out" as the file name to read.

Fixes commit 7e3689bfe0.
2018-08-24 13:06:36 +02:00
Pino Toscano
ec345aca02 builder: use the new json_parser_tree_parse_file
No need to read the whole file manually.
2018-08-23 19:12:46 +02:00