From fe89856d7dcc54dc42061a57a2c96ac543a8dc83 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 18 Mar 2021 15:24:48 +0100 Subject: [PATCH] simple-init: allow disabling DHCP fallback In some cases this is not desired (see the dependecy for details). Change-Id: Ie549d0c9769a2b6c58de9e61cb621ca96c1cd886 Depends-On: https://review.opendev.org/c/opendev/glean/+/781500 --- diskimage_builder/elements/simple-init/README.rst | 9 +++++++++ .../elements/simple-init/install.d/50-simple-init | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/diskimage_builder/elements/simple-init/README.rst b/diskimage_builder/elements/simple-init/README.rst index d146ffd59..2716dd29b 100644 --- a/diskimage_builder/elements/simple-init/README.rst +++ b/diskimage_builder/elements/simple-init/README.rst @@ -68,3 +68,12 @@ 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. + +Fallback +-------- + +Glean falls back to DHCPv4 for all interfaces that do not have an explicit +configuration. If this is not desired, set the following variable to disable +the fallback and leave such interfaces unconfigured:: + + export DIB_SIMPLE_INIT_NO_DHCP_FALLBACK=1 diff --git a/diskimage_builder/elements/simple-init/install.d/50-simple-init b/diskimage_builder/elements/simple-init/install.d/50-simple-init index cae36b837..759ed9193 100755 --- a/diskimage_builder/elements/simple-init/install.d/50-simple-init +++ b/diskimage_builder/elements/simple-init/install.d/50-simple-init @@ -29,4 +29,9 @@ if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 0 ]]; then enable_nm="--use-nm" fi -glean-install ${enable_nm} +no_dhcp_fallback="" +if [[ ${DIB_SIMPLE_INIT_NO_DHCP_FALLBACK:-0} != 0 ]]; then + no_dhcp_fallback="--no-dhcp-fallback" +fi + +glean-install ${enable_nm} ${no_dhcp_fallback}