123 Commits

Author SHA1 Message Date
Hilko Bengen
3f44e09cb5 Fix virt-builder tests for out-of-tree build 2013-12-07 21:40:00 +01:00
Richard W.M. Jones
f631770974 Add CentOS 6.5 image. 2013-12-07 10:30:14 +00:00
Richard W.M. Jones
023128a0eb Revert half of "builder: translate more user-visible strings"
Don't change "os-version" to "OS version".  It's intended to be the
same as the virt-builder man page, which consistently calls this the
"os-version" string.

This partially reverts commit ee0e56f43e.
2013-12-06 15:03:41 +00:00
Pino Toscano
ee0e56f43e builder: translate more user-visible strings
Translate also the "OS version" and "Notes" strings that appear in the
--long output.
2013-12-04 20:50:29 +00:00
Richard W.M. Jones
3712249f96 builder/sysprep: Allow accounts to be locked (RHBZ#1028660).
This allows you to select both locked accounts and disabled
passwords.  The two are subtly different concepts.

A locked account [cf. passwd -l] puts "!!" at the beginning of the
shadow password field.  Locking is reversible, because the "!!"  can
be removed, restoring the original password.  Therefore "locked"
acts as a flag in front of an existing selector.

A disabled account has "*" in the password field.  Therefore it has no
password.

Note that an account may be both locked and disabled, although this is
probably not useful.  The shadow password field will contain "!!*".
2013-11-22 15:10:44 +00:00
Richard W.M. Jones
02b5f00b2b builder/sysprep: Allow 'random' as a password selector.
This chooses a random password.
2013-11-22 14:16:09 +00:00
Richard W.M. Jones
91450b5f9a mllib: password: Replace password string with password_selector type.
This is just code motion, there is no functional change.
2013-11-21 17:34:59 +00:00
Richard W.M. Jones
9186438937 builder/sysprep: Describe --password/--root-password option as "selector".
It now appears in the respective man pages as:

  --root-password selector

or:

  --password selector

This avoids confusion from people who think these command line options
take the password directly.
2013-11-21 17:13:37 +00:00
Török Edwin
6a1061663f Avoid modulo bias in random password generation
Char.code (input_char chan) mod nr_chars has modulo bias because
the original interval is not a multiple of the destination interval,
i.e. 256 mod nr_chars != 0.

One way to fix this is to keep generating random numbers until they fall outside
the interval where modulo bias occurs, that is accept only c=[256 % nr_chars, 256).
That interval maps back to [0, nr_chars), and has a length of
(256 - 256 % nr_chars), which is a multiple of nr_chars.

RWMJ:
 - Modify the code so it goes into a utility library.
 - Use the same code across virt-builder and virt-sysprep.
2013-11-14 10:52:16 +00:00
Richard W.M. Jones
f013b15fa1 mllib: Add a utility function for safely reading from /dev/urandom.
OCaml's buffered 'in_channel' has a 64k buffer, so using it to read a
few bytes from /dev/urandom removes a lot of the system's entropy (for
example /proc/sys/kernel/random/entropy_avail goes from ~3000 to 128).

This patch was originally by Edwin Török for builder.ml.  I
generalized it because there are two other places where we did
over-sized reads from /dev/urandom.
2013-11-14 10:52:16 +00:00
Richard W.M. Jones
544d6b25e3 builder: Clarify architecture section of the documentation.
I have checked and cross architecture builds work fine:

http://rwmj.wordpress.com/2013/11/09/virt-builder-running-on-arm/#content
2013-11-12 19:57:29 +00:00
Richard W.M. Jones
4b2e9c9264 builder: debian: Remove bogus proxy from apt configuration.
Thanks: Daniel Miranda
2013-11-11 13:35:17 +00:00
Richard W.M. Jones
50aca447ea builder: After building a template, print fields for index file. 2013-11-11 13:17:18 +00:00
Richard W.M. Jones
300b357eb9 builder/website: Add some missing files to EXTRA_DIST. 2013-11-08 16:13:35 +00:00
Richard W.M. Jones
63ec023f19 builder: Allow /tmp or /Temp to be symlinks to a directory. 2013-11-07 15:30:13 +00:00
Richard W.M. Jones
7a8addb485 builder: Allow upload to directory when target is a symlink to a directory. 2013-11-07 15:29:51 +00:00
Richard W.M. Jones
55795e652e builder/website: Add support for RHEL 5 releases to internal RHEL script. 2013-11-06 21:42:54 +00:00
Richard W.M. Jones
133ae6a34b builder/website: Don't use http_proxy in internal RHEL script. 2013-11-06 21:42:54 +00:00
Richard W.M. Jones
e906d30c62 builder: After compressing the template, calculate the SHA-512 hash. 2013-11-06 21:39:52 +00:00
Richard W.M. Jones
f459fe47f8 builder: Add a Scientific Linux 6 image. 2013-11-06 21:39:34 +00:00
Richard W.M. Jones
7147d41564 builder: Old OCaml didn't have List.iteri, so add a utility function. 2013-11-06 19:22:57 +00:00
Richard W.M. Jones
e9294668b4 builder: Add script for making Red Hat Enterprise Linux instances.
This uses some internal Red Hat repositories so it's not generally
useful, but could be easily adapted by users.
2013-11-06 16:54:20 +00:00
Richard W.M. Jones
4dd6e4328c builder: Use common code to sysprep, sparsify and compress images. 2013-11-06 13:42:58 +00:00
Adam Huffman
c76912cd77 builder: Add script for making Scientific Linux instances.
RWMJ:
 - Renamed the script from sl.sh -> scientificlinux.sh
 - The output file is called scientificlinux-$version
 - I fixed some whitespace issues so it's now similar to the CentOS script.
2013-11-06 13:32:32 +00:00
Richard W.M. Jones
4339b55d10 builder: Add dependencies which automake doesn't generate correctly.
This is a further attempt, earlier commits:
commit e3ac293e86
commit dfe97b352d
2013-11-05 17:40:20 +00:00
Richard W.M. Jones
663012c5ff builder: Fix centos script - output filename was wrong.
This fixes commit 2f3fb2420e.
2013-11-05 16:51:08 +00:00
Richard W.M. Jones
e3ac293e86 builder: Add dependency from index-parse.h to index-validate.
For some reason automake doesn't get this dependency right,
resulting in occasional build failures if yacc races the
rest of the build.
2013-11-05 15:56:34 +00:00
Richard W.M. Jones
01551e5462 builder: Add some generated files to CLEANFILES.
This updates commit a4800e2d4f.
2013-11-05 15:43:27 +00:00
Richard W.M. Jones
dfe97b352d builder: Add missing dependency.
index-parser-c.c depends on index-parse.h being created first.
However without an explicit dependency, this is not done (and implicit
deps don't work because automake doesn't sufficiently understand OCaml
programs).

This fixes commit a4800e2d4f.
2013-11-05 15:42:05 +00:00
Richard W.M. Jones
92206e8d09 builder/website: Add validate.sh test script to EXTRA_DIST.
This fixes commit 154bfb7dd4.
2013-11-05 15:15:17 +00:00
Richard W.M. Jones
2f3fb2420e builder: Replace centos-6.sh with a single script.
Just use:

  ./centos.sh 6

Note that you don't need to be root.
2013-11-05 14:25:24 +00:00
Richard W.M. Jones
af9e9299bf builder: Replace debian-<NN>.sh with a single script.
Just use:

  ./debian.sh 6 squeeze

Note that you don't need to be root.
2013-11-05 14:25:24 +00:00
Richard W.M. Jones
91b5e7fb37 builder: Replace ubuntu-<NN>.sh with a single script.
Just use:

  ./ubuntu.sh 10.04 lucid

Note that you don't need to be root.
2013-11-05 14:25:24 +00:00
Richard W.M. Jones
ade0f1a97d builder: Replace fedora-<NN> shell & kickstart with a single script.
Just use:

  ./fedora.sh 18

Note that you don't need to be root.
2013-11-05 14:25:24 +00:00
Richard W.M. Jones
681c88ef5d builder: Internal implementation of parallel xzcat (pxzcat).
Instead of calling out to the pxzcat program, use an internal
implementation.  This requires liblzma to be available at build time.
If it's not available, fall back to using regular xzcat.

It is intended that eventually this code will go away when regular
xzcat / unxz is able to use threads.
2013-11-05 12:45:42 +00:00
Richard W.M. Jones
154bfb7dd4 builder/website: Add index validation test script. 2013-11-05 07:27:35 +00:00
Richard W.M. Jones
cd10f6f4db builder: Add an extra Makefile.am to builder/website. 2013-11-05 07:25:14 +00:00
Richard W.M. Jones
2035a75d66 builder: Fix missing files in EXTRA_DIST.
This fixes commit a4800e2d4f.
2013-11-05 07:15:19 +00:00
Richard W.M. Jones
2dca9d7194 builder: Fix 'check-valgrind' so it does something in this directory. 2013-11-04 22:13:23 +00:00
Richard W.M. Jones
a4800e2d4f builder: Add a real scanner/parser for index files.
This adds a tool called virt-index-validate to validate index files.
2013-11-04 21:49:01 +00:00
Richard W.M. Jones
3ffdddbedf builder: Don't use git tree / libguestfs.git to refer to the source.
git is just a VCS.
2013-11-04 21:36:22 +00:00
Richard W.M. Jones
5280e3031b builder: Only warn about unknown fields in the index if -v option is used.
Allows us to add new fields in future without having pointless
warnings from old versions of virt-builder.
2013-11-01 16:47:37 +00:00
Richard W.M. Jones
8d14abb0df builder: Allow checksum= as an alias for checksum[sha512]=.
This is for backwards compatibility with virt-builder 1.24.0 which
could not parse a key that contains square brackets and numbers.

This updates commit 4b73e0be29.
2013-11-01 16:45:52 +00:00
Richard W.M. Jones
e9d908929f builder: Add missing files to EXTRA_DIST. 2013-11-01 14:45:46 +00:00
Richard W.M. Jones
bb4e882d61 builder: Allow multiple source paths to be specified.
Users can now specify multiple source paths, eg:

  virt-builder --source http://example.com/foo \
    --source http://example.com/bar

to get templates from multiple places.

There is still only one built-in path, but we can add more later.
2013-11-01 14:16:34 +00:00
Richard W.M. Jones
b25e8da6d6 builder: When debugging, print curl command before running it. 2013-11-01 13:48:30 +00:00
Richard W.M. Jones
4b73e0be29 builder: index: Add checksum[sha512]=... option and deprecate template sigs.
We don't need to sign individual templates, provided the signed index
file contains the cryptographically secure checksums of the templates.
Since the index file cannot be interfered with and the checksums
cannot be spoofed, this is sufficient to ensure the integrity of the
templates.

Note the template signatures are now deprecated and will be removed in
libguestfs 1.26.  To avoid any backwards compatibility issues, I will
backport the relevant changes to the stable-1.24 branch.

Thanks Dennis Gilmore for pointing out that we could do this.
2013-11-01 08:21:52 +00:00
Richard W.M. Jones
984b024c5a builder: Whitespace change in error message. 2013-10-29 21:03:01 +00:00
Richard W.M. Jones
124f20a1ca builder: Be more careful about deleting temporary files on exit. 2013-10-29 21:02:39 +00:00
Richard W.M. Jones
9ac076c269 builder: Whitespace fix in Index_parser module. 2013-10-29 21:01:54 +00:00