diff options
Diffstat (limited to 'meta-google/recipes-google')
-rw-r--r-- | meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in | 26 | ||||
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh | 11 |
2 files changed, 14 insertions, 23 deletions
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in index f51b033d5..e033fd2a5 100644 --- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in +++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in @@ -63,25 +63,13 @@ EOF printf '%s' "$contents" >"$file" done - # We only restart networkd if we know we have a management network available - # on the machine and networkd is already running. - if [ -e /lib/systemd/network/-bmc-gbmcbrdummy.network ] && \ - ! systemctl status systemd-networkd | grep -q inactive; then - echo "Restarting networkd" >&2 - # HACK: We can't restart systemd-networkd without coordinating with - # phosphor-networkd, otherwise it will sometimes detect interfaces as - # unmanaged because it reads administrative state to determine enabled - # status. Adding an IP to phosphor-networkd is guaranteed to trigger the - # restart we want, and systemd-network will never actually accept the - # new value. - local start=$SECONDS - while (( SECONDS - start < 30 )); do - busctl call xyz.openbmc_project.Network \ - /xyz/openbmc_project/network/gbmcbrdummy \ - xyz.openbmc_project.Network.IP.Create IP ssys \ - xyz.openbmc_project.Network.IP.Protocol.IPv6 ff02::1 128 '' && break - sleep 1 - done + # Ensure that systemd-networkd performs a reconfiguration as it doesn't + # currently check the mtime of drop-in files. + touch -c /lib/systemd/network/*-bmc-gbmcbr.network + + if [ "$(systemctl is-active systemd-networkd)" != 'inactive' ]; then + networkctl reload + networkctl reconfigure gbmcbr fi } diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh index 69897100e..8e28d3956 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh +++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh @@ -40,10 +40,13 @@ gbmc_br_ula_update() { printf '%s' "$contents" >"$netfile" done - # We have to add the address after writing the systemd config to ensure we - # don't race with reconfiguration and drop the address. - if [ -n "$addr" ]; then - ip addr replace "$addr" dev gbmcbr + # Ensure that systemd-networkd performs a reconfiguration as it doesn't + # currently check the mtime of drop-in files. + touch -c /lib/systemd/network/*-bmc-gbmcbr.network + + if [ "$(systemctl is-active systemd-networkd)" != 'inactive' ]; then + networkctl reload + networkctl reconfigure gbmcbr fi } |