DIB: drop some dependencies

kpartx is not called anymore in amphora creation
'jq' package is not required anymore, so drop epel element dependency
For rpm-based distributions, qemu-img package is enough
Drop Centos 6 specific check, it is not supported with current releases
Merge some Fedora/CentOS checks

Change-Id: I469486b48231489e0c4ea8b9986cb0c2347eb14f
This commit is contained in:
Bernard Cafarelli 2017-03-22 16:48:26 +01:00
parent dc98000fb7
commit d5f1ffd703
No known key found for this signature in database
GPG Key ID: D148244A3C2462BD
3 changed files with 10 additions and 43 deletions

View File

@ -9,7 +9,6 @@ function octavia_install {
setup_develop $OCTAVIA_DIR
if [ $OCTAVIA_NODE == 'main' ] || [ $OCTAVIA_NODE == 'standalone' ] ; then
if ! [ "$DISABLE_AMP_IMAGE_BUILD" == 'True' ]; then
install_package kpartx
if [[ ${DISTRO} =~ "rhel7" ]]; then
# Installing qemu would bring in the default OS qemu package,
# which is too old for Pike and later releases

View File

@ -27,14 +27,8 @@ or it can be overridden by setting the following environment variables:
| DIB_ELEMENTS = /<some directory>/diskimage-builder/elements
The following packages are required on each platform:
Ubuntu and Fedora: qemu kpartx git
CentOS and RedHat Enterprise Linux: qemu-kvm qemu-img kpartx git
CentOS requires the EPEL repo and python-argparse:
.. code:: bash
$ sudo rpm -Uvh --force http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
$ yum install python-argparse
Ubuntu: qemu git
Fedora, CentOS and RedHat Enterprise Linux: qemu-img git
Test Prerequisites
------------------

View File

@ -240,7 +240,7 @@ fi
# Make sure we have the required packages installed
if [ "$platform" = 'NAME="Ubuntu"' ]; then
PKG_LIST="qemu kpartx git"
PKG_LIST="qemu git"
for pkg in $PKG_LIST; do
if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
echo "Required package " $pkg " is not installed. Exiting."
@ -257,43 +257,17 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then
exit 1
fi
elif [ "$platform" = 'NAME=Fedora' ]; then
PKG_LIST="qemu kpartx git"
else
# fedora/centos/rhel
# Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...
# "yum install qemu-img" works for all, but search requires wildcard
PKG_LIST="qemu-img* git"
for pkg in $PKG_LIST; do
if ! yum info installed $pkg &> /dev/null; then
echo "Required package " $pkg " is not installed. Exiting."
echo "Required package " ${pkg/\*} " is not installed. Exiting."
exit 1
fi
done
else
# centos or rhel
PKG_LIST="qemu-kvm qemu-img"
for pkg in $PKG_LIST; do
# Actual name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...
# "yum install qemu-img" works for all, but search requires wildcard
if ! yum info installed ${pkg}* &> /dev/null; then
echo "Required package " $pkg " is not installed. Exiting."
exit 1
fi
done
PKG_LIST="kpartx git"
for pkg in $PKG_LIST; do
if ! yum info installed $pkg &> /dev/null; then
echo "Required package " $pkg " is not installed. Exiting."
exit 1
fi
done
if [ ${platform:0:6} = "CentOS" ]; then
# install EPEL repo, in order to install argparse
PKG_LIST="python-argparse"
if ! yum info installed $pkg &> /dev/null; then
echo "CentOS requires the python-argparse package be "
echo "installed separately from the EPEL repo."
echo "Required package " $pkg " is not installed. Exiting."
exit 1
fi
fi
fi
if [ "$AMP_WORKING_DIR" ]; then
@ -321,7 +295,7 @@ elif [ "$AMP_BASEOS" = "fedora" ]; then
export FEDORA_MIRROR="$BASE_OS_MIRROR"
fi
elif [ "$AMP_BASEOS" = "centos" ]; then
AMP_element_sequence=${AMP_element_sequence:-"base vm centos7 epel selinux-permissive"}
AMP_element_sequence=${AMP_element_sequence:-"base vm centos7 selinux-permissive"}
AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND"
if [ "$BASE_OS_MIRROR" ]; then
AMP_element_sequence="$AMP_element_sequence centos-mirror"