meta-google: gbmc-bridge: Add optional fixed IP offset

Some of our machines do not support receiving DHCP packets to determine
their addresses, and need a workaround to piggyback off DHCPd nodes in
the system.

This change allows a machine to set a fixed numeric offset address,
where it can read the correct BMC prefix from RAs of other nodes and
then generate a fixed address for itself.

Tested: Ran on a 2 node BMC machine with one using this fixed scheme.
Verified that it correctly found an address and hostname.

Change-Id: Ibd79f800a582db44cf2ad469dbe0a75f13dcaeed
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ip-from-ra.sh.in b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ip-from-ra.sh.in
new file mode 100755
index 0000000..8fc4c8e
--- /dev/null
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ip-from-ra.sh.in
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Copyright 2024 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.
+
+# 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() {
+  # Save the IP address for the interface
+  gbmc_br_set_ip "$1" || true
+}
+
+RA_IF=gbmcbr
+IP_OFFSET=@IP_OFFSET@
+
+# shellcheck source=meta-google/recipes-google/networking/gbmc-bridge/gbmc-ip-from-ra.sh
+source /usr/share/gbmc-ip-from-ra.sh || exit