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
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"
Merge "Add unit test for cache-url"
Merge "Install openstack-selinux on RHEL"
Save extended attributes when creating tar

The way redhat-common's extract-image script was creating the base
tarball caused file capabilities to get dropped, which meant that
things like ping in RHEL 7 images was unusable for regular users.
This change adds the necessary options to the tar call to maintain
as many extended attributes as possible.

--acls and --selinux are intentionally omitted, and the selinux
xattrs are filtered out because all of those items cause issues
in our chroot environment.  We restore selinux attributes at the
end of the build anyway so that shouldn't be a problem.

bz reference: https://bugzilla.redhat.com/show_bug.cgi?id=1144149

Change-Id: Ibff99ce9bde01bc5ecf95dc3a5d3e2cebe5015b9
Use DIB_IMAGE_CACHE everywhere

disk-image-create processes a DIB_IMAGE_CACHE variable and exports it,
but there are several elements that ignore the value and wrote out
the base location themselves. Use the variable everywhere so that it
will get overridden everywhere.

Change-Id: I00fff354d6c931ad67cf3052d055f0e4604dfdc8
Merge "Fix openSUSE cloud image download and extraction"