Commit Graph

705 Commits

Author SHA1 Message Date
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
Pino Toscano
afa8111b75 OCaml tools: add output selection for --machine-readable
Add an optional argument for --machine-readable to select the output,
adding a new function to specifically write data to that output stream.
The possible choices are:
* --machine-readable: to stdout, like before
* --machine-readable=file:name-of-file: to the specified file
* --machine-readable=stream:stdout: explicitly to stdout
* --machine-readable=stream:stderr: explicitly to stderr

Adapt all the OCaml-based tools to use the new function, so the
--machine-readable choice is respected.
2018-08-23 18:03:39 +02:00
Richard W.M. Jones
df11067329 mltools: JSON: unify JSON_parser type with JSON.json_t. 2018-08-23 09:56:51 +01:00
Richard W.M. Jones
279472f304 mltools: JSON: combine JSON.Int and JSON.Int64 into a single variant.
It was convenient to have these as separate variants when we were only
using this type to generate JSON.  However if we also use it to parse
JSON documents then integers in the document should only map to a
single variant.
2018-08-22 15:18:57 +01:00
Richard W.M. Jones
a63d02f8f1 mltools: JSON: Rename Yajl module as JSON_parser and move to common/mltools.
Commit bd1c5c9f4d changed all the code
to use Jansson instead of yajl.  However it didn't change the OCaml
module name (still Yajl).

This commit changes the module to a neutral name ("JSON_parser") and
moves it into common/mltools so it can be used by other tools.

This leaves us in a slightly awkward situation of having two JSON-ish
OCaml modules (JSON for creating trees and JSON_parser for parsing
them) with incompatible types.  That is left for future work to
resolve.  (It should be easier to do now that both modules live in the
same directory.)

This is just renaming and general refactoring.  There should be no
change in functionality.
2018-08-22 15:18:57 +01:00
Pino Toscano
2fa78e6dce OCaml tools: simplify machine-readable handling
Make use of the helper provided by Tools_utils.create_standard_options,
so there is no need to implement the logic in each tool.

This affects all the OCaml tools with --machine-readable, namely:
virt-builder, virt-builder-repository, virt-dib, virt-get-kernel,
virt-resize, virt-sparsify, and virt-v2v.
2018-08-20 22:25:55 +01:00
Richard W.M. Jones
13d85d722f mltools: Rename run_command std*_chan -> std*_fd.
These are file descriptors, not the high level OCaml in_channel/
out_channel type, so we would normally not refer to them as *_chan.

Just renaming, no functional change.
2018-08-20 16:50:24 +01:00
Richard W.M. Jones
1bc9facfdd builder: templates: More RHEL templates. 2018-07-12 09:44:03 +01:00
Richard W.M. Jones
1f79f2531e builder: templates: Update RHEL virt-install osinfo version for Fedora 28. 2018-07-11 10:17:19 +01:00
Richard W.M. Jones
1f983a050f builder: templates: Rebuild Ubuntu 18.04 image without proxy (RHBZ#1579047). 2018-05-21 09:58:23 +01:00
Richard W.M. Jones
3632c77bfd builder: templates: Remove bogus proxy from Ubuntu apt configuration (RHBZ#1579047).
Thanks: Lars Seipel.

See also commit 4b2e9c9264 which did the
same for Debian back in 2013.
2018-05-21 09:58:23 +01:00
Richard W.M. Jones
1c974855dc builder: templates: Add centos-7.5. 2018-05-10 22:19:13 +01:00
Richard W.M. Jones
5ddef548b0 builder: templates: Add Fedora 28 x86_64 and i686 templates. 2018-05-01 17:17:54 +01:00
Richard W.M. Jones
7631be21d7 builder: templates: Update osinfo for Fedora. 2018-05-01 17:17:54 +01:00
Richard W.M. Jones
7a2cc8ba29 builder: templates: aarch64 is now a primary architecture, fix location. 2018-05-01 17:17:53 +01:00
Richard W.M. Jones
7be88554af slow tests: Add slow tests of Ubuntu 18.04.
- firstboot
 - settings
 - password setting
 - console
 - v2v conversion
2018-04-27 14:58:28 +01:00
Richard W.M. Jones
a75c13d301 builder: templates: Add Ubuntu 18.04. 2018-04-27 14:57:17 +01:00
Richard W.M. Jones
075333ede2 common: mlstdutils: Inline unsafe ‘subdirectory’ function.
This function is ill-defined and unsafe.  As a preparation for
removing it completely, inline it in the places where it is used.
2018-04-27 10:13:04 +01:00
Richard W.M. Jones
112e3bc311 v2v: -i ova: Ignore non-existent files mentioned in *.mf.
Some OVA files generated by VMware have a *.mf file which contains
checksums for files which don't exist in the OVA.  Ignore these
checksums.

Thanks: Nisim Simsolo.
2018-04-27 10:13:04 +01:00
Richard W.M. Jones
190333b8b0 mltools: Checksums.verify_checksum{,s} returns an error type instead of throwing exception.
Simple code refactoring, making it both more difficult to ignore the
error case and easier to add other error cases in future.
2018-04-27 10:13:04 +01:00
Richard W.M. Jones
64b517608c builder: templates: rhel-7.5 kickstarts and virt-install commands. 2018-04-13 12:44:49 +01:00
Richard W.M. Jones
74edd79354 builder: templates: Fix path for RHEL 7 aarch64.
Now using ALT-ernate kernel.
2018-04-13 10:14:35 +01:00
Richard W.M. Jones
32d7b77946 builder: templates: Also update download.devel location for RHEL on s390x.
Updates commit f9395e6760.
2018-04-13 10:12:48 +01:00
Richard W.M. Jones
f9395e6760 builder: templates: Add location for RHEL on s390x.
It's not likely we can actually build templates for this architecture
since I don't think qemu fully supports the architecture yet.
2018-04-13 08:55:18 +01:00
Richard W.M. Jones
2f62020f08 builder: templates: Use --cpu=power7|power8 because of libvirt regression.
Works around libvirt regression:
https://bugzilla.redhat.com/show_bug.cgi?id=1539022
2018-04-13 08:52:08 +01:00
Hilko Bengen
802c5d2055 Fix out-of-tree builds of OCaml components
- Add $(srcdir), $(builddir) to Makefiles where required
- Post-process ocamldep output
- generate ocaml/.depends
2018-04-12 11:43:56 +02:00
Kashyap Chamarthy
bb9636acac virt-builder.pod: Update Fedora versions
This is just a mechanincal change, so that the public documentation[*]
refers to the latest release Fedora versions, instead of the EOLed
versions.

While at it, also update the `virt-cutomize` Makefile.am

[*] http://libguestfs.org/virt-builder.1.html

Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
2018-04-10 16:57:23 +01:00
Pino Toscano
5e8052dc8f make-repository: use inspect_get_osinfo
Use the newly added API instead of the local implementation.
2018-02-22 17:30:41 +01:00