Install systemd earlier for Ubuntu Bionic

Like we did in https://review.openstack.org/475206 we need to install
systemd sooner because of the new world order of containers.

Change-Id: Ia60d751fee3af6f8d72ad664107acb337360feca
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-02-17 13:09:39 -05:00
parent 2080055155
commit e9e7ac2ee1
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
2 changed files with 18 additions and 3 deletions

View File

@ -11,4 +11,7 @@ setting can be found in the element's ``environment.d`` directory in
the variable ``DIB_RELEASE``. If a different release of Ubuntu should the variable ``DIB_RELEASE``. If a different release of Ubuntu should
be created, the variable ``DIB_RELEASE`` can be set appropriately. be created, the variable ``DIB_RELEASE`` can be set appropriately.
Note that this element installs ``systemd-sysv`` as the init system for
18.04+.
.. element_deps:: .. element_deps::

View File

@ -41,13 +41,25 @@ $apt_get update
$apt_get clean $apt_get clean
$apt_get dist-upgrade -y $apt_get dist-upgrade -y
$apt_get install -y busybox sudo to_install=""
# pre-bionic (18.04) brought this in via debootstrap, but init
# dependencies have narrowed in the container world, so now we add it
# explicitly here so it's brought in early.
if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
to_install+="systemd-sysv "
fi
# default required
to_install+="busybox sudo " # dib-lint: safe_sudo
if [ "$DIB_PYTHON_VERSION" == "2" ]; then if [ "$DIB_PYTHON_VERSION" == "2" ]; then
$apt_get install -y python to_install+="python "
elif [ "$DIB_PYTHON_VERSION" == "3" ]; then elif [ "$DIB_PYTHON_VERSION" == "3" ]; then
$apt_get install -y python3 to_install+="python3 "
else else
echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3" echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3"
exit 1 exit 1
fi fi
$apt_get install -y $to_install