diff options
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-bridge.bb | 7 | ||||
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh.in (renamed from meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh) | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge.bb b/meta-google/recipes-google/networking/gbmc-bridge.bb index 3c51c16e70..44d0ff0169 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge.bb +++ b/meta-google/recipes-google/networking/gbmc-bridge.bb @@ -25,7 +25,7 @@ SRC_URI += " \ file://gbmc-br-gw-src.sh \ file://gbmc-br-nft.sh \ file://gbmc-br-dhcp.sh \ - file://50-gbmc-psu-hardreset.sh \ + file://50-gbmc-psu-hardreset.sh.in \ file://gbmc-br-dhcp.service \ file://gbmc-br-dhcp-term.sh \ file://gbmc-br-dhcp-term.service \ @@ -76,6 +76,9 @@ GBMC_BR_FIXED_OFFSET ?= "" # system of multiple network endpoints. GBMC_ULA_PREFIX = "fdb5:0481:10ce:0" +# coordinated powercycle +GBMC_COORDINATED_POWERCYCLE ?= "true" + def mac_to_eui64(mac): if not mac: return '' @@ -148,6 +151,8 @@ do_install() { install -m0644 ${WORKDIR}/gbmc-br-dhcp-term.service ${D}${systemd_system_unitdir}/ install -m0644 ${WORKDIR}/gbmc-br-load-ip.service ${D}${systemd_system_unitdir}/ install -d -m0755 ${D}${datadir}/gbmc-br-dhcp + + sed 's,@COORDINATED_POWERCYCLE@,${GBMC_COORDINATED_POWERCYCLE},' ${WORKDIR}/50-gbmc-psu-hardreset.sh.in >${WORKDIR}/50-gbmc-psu-hardreset.sh install -m0644 ${WORKDIR}/50-gbmc-psu-hardreset.sh ${D}${datadir}/gbmc-br-dhcp/ install -m0644 ${WORKDIR}/gbmc-br-lib.sh ${D}${datadir}/ diff --git a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh.in index ace4ac5598..1a5e055f70 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh +++ b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh.in @@ -17,6 +17,8 @@ gbmc_psu_hardreset_needed= +COORDINATED_POWERCYCLE=@COORDINATED_POWERCYCLE@ + gbmc_psu_hardreset_hook() { # We don't always need a powercycle, allow skipping if [ -z "${gbmc_psu_hardreset_needed-}" ]; then @@ -24,8 +26,13 @@ gbmc_psu_hardreset_hook() { return 0 fi - echo "Powercycling" >&2 - update-dhcp-status 'POWERCYCLE' "netboot powercycle" + if [ "${COORDINATED_POWERCYCLE}" == "true" ]; then + echo "Requesting powercyce" >&2 + update-dhcp-status 'POWERCYCLE' "netboot powercycle" || return + else + echo "Powercycling" >&2 + systemctl start gbmc-psu-hardreset.target || return + fi # Ensure that we don't continue the DHCP process while waiting for the # powercycle. |