| #!/bin/bash |
| # Copyright 2021 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| [ ! -e /usr/share/gbmc-br-lib.sh ] && exit |
| |
| # shellcheck source=meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-lib.sh |
| source /usr/share/gbmc-br-lib.sh || exit |
| |
| update_fqdn() { |
| hostnamectl set-hostname "$1" || true |
| } |
| |
| update_pfx() { |
| # We no longer need NCSId if we are in this configuration |
| systemctl stop --no-block ncsid@"$NCSI_IF" || true |
| |
| # Save the IP address for the interface |
| gbmc_br_set_ip "$1" || true |
| |
| # DHCP Relay workaround until alternate source port is supported |
| # TODO: Remove this once internal relaying cleanups land |
| gbmc-ncsi-smartnic-wa.sh || true |
| } |
| |
| RA_IF=@NCSI_IF@ |
| IP_OFFSET=1 |
| |
| # shellcheck source=meta-google/recipes-google/networking/gbmc-bridge/gbmc-ip-from-ra.sh |
| source /usr/share/gbmc-ip-from-ra.sh || exit |