meta-google: gbmc-ncsi-config: Support migrating old configs
Sometimes we have machines that switch between interface names when
upgrading versions, we want to keep the configs to the best of our
ability when migrating forward.
Change-Id: I58fb962b19431114dc342a3252ce2f834c160194
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-old.service.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-old.service.in
new file mode 100644
index 0000000..dceeea1
--- /dev/null
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-old.service.in
@@ -0,0 +1,10 @@
+[Unit]
+Before=systemd-networkd.service
+ConditionFileNotEmpty=/etc/systemd/network/00-bmc-@OLD_IF@.network
+
+[Service]
+Type=oneshot
+ExecStart=mv -v /etc/systemd/network/00-bmc-@OLD_IF@.network /etc/systemd/network/00-bmc-@NCSI_IF@.network
+
+[Install]
+WantedBy=multi-user.target