summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2022-07-21 00:50:29 +0300
committerWilliam A. Kennington III <wak@google.com>2022-07-21 06:39:02 +0300
commitc3d512a076cd53a0b0bfda3e4ee2cce9472ace44 (patch)
tree828a740ad721514121ac3a284c0b4819e14da250 /meta-google
parentfc8c436c9e355982d9f875cffc92a932d5141431 (diff)
downloadopenbmc-c3d512a076cd53a0b0bfda3e4ee2cce9472ace44.tar.xz
meta-google: gbmc-br-dhcp: Allow termination invariants
This makes it possible to produce an error in the case that a hook sets up state for something to trigger later. Change-Id: Ied9f150153172213a98a73f6a556aa8fed87c75a Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rw-r--r--meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
index 9c61036651..f4ac5a5a53 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
@@ -19,6 +19,9 @@
# shellcheck disable=SC2034
GBMC_BR_DHCP_HOOKS=()
+# A dict of outstanding items that should prevent DHCP completion
+declare -A GBMC_BR_DHCP_OUTSTANDING=()
+
# SC can't find this path during repotest
# shellcheck disable=SC1091
source /usr/share/network/lib.sh || exit
@@ -64,7 +67,14 @@ if [ "$1" = bound ]; then
gbmc_br_run_hooks GBMC_BR_DHCP_HOOKS || exit
+ # If any of our hooks had expectations we should fail here
+ if [ "${#GBMC_BR_DHCP_OUTSTANDING[@]}" -gt 0 ]; then
+ echo "Not done with DHCP process: ${!GBMC_BR_DHCP_OUTSTANDING[*]}" >&2
+ exit 1
+ fi
+
# Ensure that the installer knows we have completed processing DHCP by
# running a service that reports completion
+ echo 'Start DHCP Done' >&2
systemctl start dhcp-done --no-block
fi