summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-11-05 08:49:39 +0300
committerWilliam A. Kennington III <wak@google.com>2021-11-06 02:40:16 +0300
commit031785343fcf91f53857678970db1f3ba4437ce0 (patch)
tree95fcbbaeedbc3cfd044061e5e3e85d7d48d6cc6c /meta-google
parenta22b4458fe6d64b5dcd60e00acaa0ff083f6f056 (diff)
downloadopenbmc-031785343fcf91f53857678970db1f3ba4437ce0.tar.xz
meta-google: gbmc-ncsi-config: Remove override if empty
Currently this will make no difference in configuration, but it will be useful once we implement our DHCP process and need to contend with multiple configurations. Change-Id: Ia93530e67cdb88fcbe90ef2b6dfbd5a239469ff7 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rw-r--r--meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in13
1 files changed, 8 insertions, 5 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 b04f2aa8f..78af419c5 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
@@ -36,14 +36,14 @@ gbmc_ncsi_br_pub_addr_update() {
done
fi
- local contents='[Network]'$'\n'
+ local contents=
if (( ${#pfx_bytes[@]} != 0 )); then
pfx_bytes[8]=0xfd
local stateless_pfx="$(ip_bytes_to_str pfx_bytes)"
pfx_bytes[9]=0x01
local ncsi_pfx="$(ip_bytes_to_str pfx_bytes)"
- local here=
- read -r -d '' here <<EOF
+ read -r -d '' contents <<EOF
+[Network]
Address=$ncsi_pfx/128
IPv6PrefixDelegation=yes
[IPv6PrefixDelegation]
@@ -60,13 +60,16 @@ Destination=$stateless_pfx/76
Type=unreachable
Metric=1024
EOF
- contents+="$here"$'\n'
fi
local file
for file in /run/systemd/network/{00,}-bmc-gbmcbr.network.d/50-public.conf; do
mkdir -p -m 755 "$(dirname "$file")"
- printf '%s' "$contents" >"$file"
+ if [ -z "$contents" ]; then
+ rm -f "$file"
+ else
+ printf '%s' "$contents" >"$file"
+ fi
done
# Ensure that systemd-networkd performs a reconfiguration as it doesn't