Fix openSUSE cloud image download and extraction

Use the latest available version of the rootfs (instead of a qcow2
image) to simplify rootfs extraction.

Change-Id: Ic3a646b923738464b5217d799758b6980b2deaf2
Make diskimage-builder work in Docker.

When running inside a Docker container, we cannot rely on devices in
/dev/mapper to be automagically created by udev, because we probably
don't have a udev at all.  To work around this, run dmsetup mknodes
after every kpartx run.

Change-Id: If7e30579224ce54c5ed26d08974d8293c144719a
Handle non-existing *generic kernel and initrd

Finding the Debian boot kernel and initrd is collapsed into a
single statement so that the script doesn't bail out when
'set -o pipefail' is set and the *generic kernel and initrd are
absent.

Change-Id: Ifd616818f7387e6f102636c7cf186be6097f1d5c
Closes-Bug: 1335016
Refactor ramdisk element to allow alternate implementations

In preparation for enabling Dracut-based ramdisks, this change
factors out functionality that is common to both busybox and Dracut
ramdisks.  Said functionality is moved to a ramdisk-base element
which is added as a dependency of the ramdisk element.  ramdisk now
only contains the functionality specific to building busybox-based
ramdisks.

bp tripleo-juno-dracut-ramdisks
Change-Id: Iad2907c8be491c88727d87ed5e5a720e5beb66c3
Add svc-map element.

Adds a new svc-map element which can be used to install
services based on an in element 'svc-map' YAML config
file format.

This change is intended to decouple elements from DIB
and allow new elements to support multiple distributions
(with various service naming schemes) without having to
constantly maintain DIB's various bin/map-services files.

This patch ensures all of the YAML files are compiled into
a single file without namespaces.  The YAML compilation
process occurs during image creation time and errors if
conflicting mappings are found.

Change-Id: Id11433ea342aace71a358936a7ca3151ec11d506
Merge "Add svc-map element."
Merge "Refactor ramdisk element to allow alternate implementations"
Allow custom rootfs labels

Per [1], our current root label of cloudimg-root does not work with
XFS because XFS only allows 12 character labels.  This change
addresses that by allowing a custom rootfs label to be specified
in the call to disk-image-create.  There should be no backwards
compatibility concerns as the default label is unchanged.  Any
external elements dealing with the label would need to be updated
to support this new feature, but should continue to work as before
as long as a custom label is not specified.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1139584

Change-Id: I596104d1a63b5dc6549e8460a1ae3da00165ef04
Move dpkg manifest creation to finalise

As some finalise steps can install packages we need to generate the
dpkg manifest after that has occurred.

Change-Id: I2177db2e64d4d9c21deeac7cf017919888a2d524
Updated from global requirements

Change-Id: Ibd80a5e3a7bd7d255dc3e1779e57353ca2d6ca89
Install openstack-selinux on RHEL

The openstack-selinux package contains policy updates for OpenStack.
Updates are accrued in openstack-selinux before they are merged into
the upstream selinux-policy package.

Change-Id: I7c00e5cae17489202fe7aee3e656fca27ab630ba
Use $((EXPRESSION)) instead of $[EXPRESSION]

$((EXPRESSION)) is POSIX-conform and should be preferred.

Change-Id: Ibd0524194aeda40961e202b6761dbaed2ea27dfa
Add unit test for cache-url

A sanity check that cache-url does the right thing when presented
with the appropriate curl return codes.  This change brings in the
test code for scripts from tripleo-image-elements, which needs to
be factored out into a place both projects can use it.

I'm stubbing out curl so we don't have a dep on curl in our unit
tests, and because I've seen some strange behavior out of curl in
the gate that caused random failures in this test.

Change-Id: I31e6b06b45415feec7285511d07e65eb78d0d045
Merge "Use $((EXPRESSION)) instead of $[EXPRESSION]"
Fix $DISTRO_NAME usage for centos7 element

In both of the changed files in this patch, the $DISTRO_NAME usage
is checking against "centos".  The valid value for the centos7
element for $DISTRO_NAME is "centos7"[1].

[1] http://git.io/8IvuTw

Change-Id: I0c4a4b2ecf87c7a9283d10071f6feb494a6c716a
Update EPEL release rpm

EPEL 7 was released September 30. The beta release rpm was removed
from the repo and was replaced with the final release rpm.

Change-Id: I103a2f7abd7563869b9e39ccc1fbb3cfbd9ff6ae
Merge "Fix $DISTRO_NAME usage for centos7 element"
Ensure epel7 is installed only on rhel7/centos7

Change-Id: I5812812f7d2cb5ba2e310e33d6e01cda8823c1c4
Merge "Add unit test for cache-url"
Merge "Install openstack-selinux on RHEL"