Install systemd earlier for Stretch

Debian Stretch released as stable recently, and the init system is
less tightly specified in the base dependencies (for some info, see
[1]).  It seems, probably unintentionally, that in the previous
release systemd-sysv was brought in by debootstrap, but that is no
longer happening.

Add systemd as an early dependency of debian-minimal.

Remove the package-installs.yaml as that happens too late (other
things need to know the init system to write out service files, etc
and probe for systemd utils before package-installs).  As mentioned, I
do not believe the "only install systemd on testing" idea was actually
working here, because it was being brought in during the initial
debootstrap.

Update some documentation to explain what's going on

[1] https://lists.debian.org/debian-boot/2015/05/msg00156.html

Change-Id: Id67c0cf08728407d234976f9807d3bd71d12f758
This commit is contained in:
Ian Wienand 2017-06-19 11:35:14 +10:00
parent 250aeb5d21
commit a0f747932d
6 changed files with 23 additions and 19 deletions

View File

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

View File

@ -2,5 +2,3 @@ linux-image-amd64:
arch: amd64
linux-image-686:
arch: i386
systemd:
systemd-sysv:

View File

@ -1,14 +0,0 @@
{
"release": {
"debian": {
"testing": {
"systemd": "systemd",
"systemd-sysv": "systemd-sysv"
}
}
},
"default": {
"systemd": "",
"systemd-sysv": ""
}
}

View File

@ -16,6 +16,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# dib-lint: disable=safe_sudo
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
@ -54,13 +56,23 @@ $apt_get update
$apt_get clean
$apt_get dist-upgrade -y
$apt_get install -y busybox sudo
to_install=""
# pre-stretch (9.0) 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.
to_install+="systemd-sysv "
# default required
to_install+="busybox sudo "
if [ "$DIB_PYTHON_VERSION" == "2" ]; then
$apt_get install -y python
to_install+="python "
elif [ "$DIB_PYTHON_VERSION" == "3" ]; then
$apt_get install -y python3
to_install+="python3 "
else
echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3"
exit 1
fi
$apt_get install -y $to_install

View File

@ -4,4 +4,7 @@ debian-systemd
You may want to use `systemd` instead of the classic sysv init system.
In this case, include this element in your element list.
Note that this works with the ``debian`` element, not the
``debian-minimal`` element.
.. element_deps::

View File

@ -5,4 +5,7 @@ By default Debian will use sysvinit for booting. If you want to experiment
with Upstart, or have need of it due to a need for upstart jobs, this
element will build the image with upstart as the init system.
Note that this works with the ``debian`` element, not the
``debian-minimal`` element.
.. element_deps::