Merge "simple-init: allow for NetworkManager support"

This commit is contained in:
Zuul 2019-01-09 03:38:25 +00:00 committed by Gerrit Code Review
commit 8d3fa3a85c
7 changed files with 42 additions and 6 deletions

View File

@ -58,3 +58,13 @@ Then set your DIB env vars like this before running DIB::
DIB_INSTALLTYPE_simple_init=repo
DIB_REPOLOCATION_glean=/tmp/glean
DIB_REPOREF_glean=my-test-ref
NetworkManager
--------------
By default, this uses the "legacy" scripts on each platform. To use
NetworkManager instead, set ``DIB_SIMPLE_INIT_NETWORKMANAGER`` to
non-zero. See the glean documentation for what the implications for
this are on each platform.
This is currently only implemented for CentOS and Fedora platforms.

View File

@ -0,0 +1 @@
export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0}

View File

@ -24,4 +24,9 @@ SCRIPTDIR=$(dirname $0)
# Ensure the 8021q module is loaded so that glean can support tagged interfaces
echo "8021q" >> /etc/modules
glean-install
enable_nm=""
if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 0 ]]; then
enable_nm="--use-nm"
fi
glean-install ${enable_nm}

View File

@ -1,3 +1,7 @@
dhcp-client:
net-tools:
ifupdown:
network-scripts:
when: DIB_SIMPLE_INIT_NETWORKMANAGER = 0
NetworkManager:
when: DIB_SIMPLE_INIT_NETWORKMANAGER != 0

View File

@ -5,7 +5,8 @@
},
"debian": {
"dhcp-client": "isc-dhcp-client",
"ifupdown": "ifupdown"
"ifupdown": "ifupdown",
"NetworkManager": "network-manager"
},
"gentoo": {
"dhcp-client": "net-misc/dhcp",
@ -16,8 +17,16 @@
"dhcp-client": "dhcp-client"
}
},
"release": {
"fedora": {
"29": {
"network-scripts": "network-scripts"
}
}
},
"default": {
"dhcp-client": "isc-dhcp-client",
"ifupdown": ""
"ifupdown": "",
"network-scripts": ""
}
}

View File

@ -13,9 +13,11 @@ case "$DIB_INIT_SYSTEM" in
;;
systemd)
if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then
# NOTE(pabelanger): Glean requires network.service for
# these platforms.
systemctl enable network.service
if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 1 ]]; then
# NOTE(pabelanger): Glean requires network.service for
# these platforms when not using networkmanager
systemctl enable network.service
fi
elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then
# on suse, this is named wicked.service, but it's the same
# as network.service.

View File

@ -0,0 +1,5 @@
---
features:
- |
The `simple-init` element can now use NetworkManager instead of
legacy scripts on Red Hat platforms.