Explicitly name element enable-serial-console

We use an element remove-serial-console in image elements.
Renaming this element to match. Also renaming allows us to use
the serial console in devtest runs.
See - https://review.openstack.org/#/c/86272/

Change-Id: I8f1138f58d0046ccdeefa3decc45c36d95c6bf4b
Allow overwriting old images

The two duplicated functions, save_image and finish_image will move
an existing image out of the way if it exists, but it isn't
configurable. Check an environment variable is 0 before doing so.

Switch save_image to just calling finish_image, rather than
duplicating its code exactly.

Change-Id: I26a5a8fa4b6e853c9440bffab195b0bc3728be40
Echo output when pkg-map fails

When the call to pkg-map fails, it prints the error to stdout. However,
this output is lost when pkg-map is executed in a subshell, so the
actual error is never seen. This change adds an explicit echo so the
error is shown.

Change-Id: Id6f4fae6acadfe2839b408fb2dd11fb65d65df6e
Lock around source repositories setup

Problems were seen when building images in parallel with
git clones and fetches interfering with each other.

Stop it.

Co-Authored-By: Michael Kerrin <michael.kerrin@hp.com>
Change-Id: Iaa48f259755d8b22327459a5c6d224a342909aee
Detail 'other' directories in the README

Elements can use arbitrary directories in diskimage-builder, so
ensure we make mention of that, and give an example of such a use.

Change-Id: I0e57ece82629c1be4e0f9612c2a565802b222687
Use readlink to get script path

So we can support usage:
ln -s ~/source/.../disk-image-create ~/bin/

Change-Id: Id54b613a247679b98cef3e9a6f37cd93155d029e
Handle non-script grub2-install

grub2-install has been re-written [1] so isn't always a shell script,
so just exec it directly.  Also use $() as that follows the rest of
the file.

[1] http://git.savannah.gnu.org/cgit/grub.git/commit?id=cd46aa6cefabd7b0fcb15cd614577e1ab8c7a841

Change-Id: Ib4fd7c6854fb485c0da6a79babf4a3d45a8a0f2c
Add dhcp support for ramdisk element.

This change adds support for retrieving the IP
through DHCP if 'ip' was not provided as a kernel
command-line argument by pxelinux.  This is used
when the kernel/ramdisk is booted by virtual media.

Change-Id: I1097ce5b56ad40f2d6dc3181681d54f924ec7145
Closes-Bug: #1321563
Update RHEL 6.5 Image name.

The default value points to old image name
which results in 404 error. So updating the
value to point to correct name.

Change-Id: Ia66f0cf4f4167926892a0786467412d277ebffc3
Merge "Allow overwriting old images"
Merge "Detail 'other' directories in the README"
Initial centos7 support

Initial support for a centos7 image.

This is separate to rhel7 because the major differences are things
like repo and image locations, which are always going to be different.
We should merge any real changes into the redhat-common layers.

Apart from the added support files in centos7/*, the other change is
mostly modifications to redhat-common's extract-image to handle
different partition layouts of the centos7 image.

Change-Id: I943abe5ff0a803f36eda266a79af0d9220edcae7
Add a ramdisk-install.d hook path.

We need to be able to do install.d like things for ramdisks
themselves, but install.d runs outside the ramdisk context - and its
likely to break peoples brains if we mangle the two together - so this
adds a new hook point, ramdisk-install, specifically for installing
things into the ramdisk.

Change-Id: I37d1660309cda6e28bd0b316b08f61db4e080613
Avoid to install a blank list of packages

There are some situations where the list of packages to install
in a image is blank (packages blacklisted).

Change-Id: I315f97fe619c25b36cf47ed1b7a65936b753312e
Merge "Echo output when pkg-map fails"
Lock around ubuntu tarball download

Make this safe for parallel builds

Change-Id: I578fa38e1d44bc205b70d087d161b471cd260fa1
Merge "Use readlink to get script path"
Merge "Add dhcp support for ramdisk element."
Merge "Update RHEL 6.5 Image name."
Update RHEL7 element since release

This patch updates the RHEL7 element to work
properly now that it has changed from beta to
release status.  It includes a repo update to
locate os-config rpms not in epel yet and an
update to the latest cloud image name.

Change-Id: I05607d62193c8f8fb1c1bece9872d456b19c5a08