meta-phosphor: change systemd.bbclass to match upstream override syntax

Upstream bbclasses changed to typically use the `:${PN}` override
syntax, including the SYSTEMD_ variables.  Change our systemd.bbclass
to do the same for consistency and perform a tree-wide variable
replacement.

Spot checked by building bletchley and witherspoon and checking
some of the SYSTEMD_LINK directives on installed packages under qemu.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I20a9dd809bff8af8759488734f80486c7228c6eb
diff --git a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
index c6ee5d0..03f0d58 100644
--- a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
+++ b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
@@ -24,12 +24,12 @@
 HOST_WARM_REBOOT_FORCE_INSTMPL = "ampere-host-force-reset@{0}.service"
 HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
 HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_INSTMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
 SYSTEMD_SERVICE:${PN} += "${HOST_WARM_REBOOT_FORCE_TGT}"
 
 HOST_ON_RESET_HOSTTMPL = "ampere-host-on-host-check@.service"
 HOST_ON_RESET_HOSTINSTMPL = "ampere-host-on-host-check@{0}.service"
 HOST_ON_RESET_HOSTTGTFMT = "obmc-host-startmin@{0}.target"
 HOST_ON_RESET_HOSTFMT = "../${HOST_ON_RESET_HOSTTMPL}:${HOST_ON_RESET_HOSTTGTFMT}.requires/${HOST_ON_RESET_HOSTINSTMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_ON_RESET_HOSTFMT', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_ON_RESET_HOSTFMT', 'OBMC_HOST_INSTANCES')}"
 SYSTEMD_SERVICE:${PN} += "${HOST_ON_RESET_HOSTTMPL}"
diff --git a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
index e8ef45d..b25ba5d 100644
--- a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
+++ b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
@@ -2,7 +2,7 @@
 
 DEPS_CFG = "resetreason.conf"
 DEPS_TGT = "phosphor-discover-system-state@.service"
-SYSTEMD_OVERRIDE_${PN}-discover:append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}"
+SYSTEMD_OVERRIDE:${PN}-discover:append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}"
 
 FILES:${PN} += "${systemd_system_unitdir}/*"
 
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-gpio-config.bb b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-gpio-config.bb
index cc79f5b..8886fec 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-gpio-config.bb
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/mtjade-gpio-config.bb
@@ -28,14 +28,14 @@
 CHASSIS_POWERON_INSTMPL = "ampere-gpio-poweron@{0}.service"
 CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
 CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_INSTMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
 
 # chassis power off
 CHASSIS_POWEROFF_SVC = "ampere-gpio-poweroff@.service"
 CHASSIS_POWEROFF_INSTMPL = "ampere-gpio-poweroff@{0}.service"
 CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
 CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_INSTMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
 
 do_install() {
     install -d ${D}/usr/sbin
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor.bb
index 49376ee..4994183 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor.bb
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor.bb
@@ -19,7 +19,7 @@
 
 OBMC_FAULT_MONITOR_INSTANCES = "s0_fault_alert s1_fault_alert"
 
-SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/gpio/s0_fault_alert \
+SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/gpio/s0_fault_alert \
                                    obmc/gpio/s1_fault_alert \
                                   "
 
@@ -29,5 +29,5 @@
 FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
 
 SYSTEMD_SERVICE:${PN} += "ampere_fault_led.service"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_FAULT_MONITOR_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_FAULT_MONITOR_INSTANCES')}"
 
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb
index cde625f..79bfb72 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb
@@ -10,7 +10,7 @@
 
 OBMC_HOST_ACK_MONITOR_INSTANCES = "reboot_ack shutdown_ack"
 
-SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/reboot_ack \
+SYSTEMD_ENVIRONMENT_FILE:${PN} +="obmc/gpio/reboot_ack \
                                   obmc/gpio/shutdown_ack \
                                  "
 
@@ -20,4 +20,4 @@
 FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
 
 SYSTEMD_SERVICE:${PN} += "ampere-host-shutdown-ack@.service"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_ACK_MONITOR_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_ACK_MONITOR_INSTANCES')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button.bb
index 8e57c3e..c1a616a 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button.bb
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button.bb
@@ -16,7 +16,7 @@
             ${D}${bindir}/toggle_identify_led.sh
 }
 
-SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/id_button"
+SYSTEMD_ENVIRONMENT_FILE:${PN} +="obmc/gpio/id_button"
 
 ID_BUTTON_SERVICE = "id_button"
 
@@ -26,4 +26,4 @@
 FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
 
 SYSTEMD_SERVICE:${PN} += "id-button-pressed.service"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'ID_BUTTON_SERVICE')}"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'ID_BUTTON_SERVICE')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index c6400c2..527cbbd 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -5,8 +5,8 @@
 POWERSUPPLY_TGT = "multi-user.target"
 FMT_POWERSUPPLY = "../${TMPL_POWERSUPPLY}:${POWERSUPPLY_TGT}.requires/${INSTFMT_POWERSUPPLY}"
 
-SYSTEMD_LINK_${PN}-presence:append:mtjade = " ${@compose_list(d, 'FMT_POWERSUPPLY', 'OBMC_POWER_SUPPLY_INSTANCES')}"
+SYSTEMD_LINK:${PN}-presence:append:mtjade = " ${@compose_list(d, 'FMT_POWERSUPPLY', 'OBMC_POWER_SUPPLY_INSTANCES')}"
 
 POWERSUPPLY_ENV_FMT  = "obmc/gpio/phosphor-power-supply-{0}.conf"
 
-SYSTEMD_ENVIRONMENT_FILE_${PN}-presence:append:mtjade = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"
+SYSTEMD_ENVIRONMENT_FILE:${PN}-presence:append:mtjade = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset.bb
index 2ca18a0..839c6d4 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset.bb
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset.bb
@@ -13,7 +13,7 @@
 
 # Copies config file having arguments for psu
 # via GPIO assertion
-SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/PSU1_B25 \
+SYSTEMD_ENVIRONMENT_FILE:${PN} +="obmc/gpio/PSU1_B25 \
                                   obmc/gpio/PSU2_B25 \
                                  "
 SYSTEMD_SERVICE:${PN} ?= "psu1_hotswap_reset.service psu2_hotswap_reset.service"
@@ -29,4 +29,4 @@
 GPIO_MONITOR_TGTFMT = "phosphor-gpio-monitor@{0}.service"
 TGT = "multi-user.target"
 PSU_MONITOR_FMT = "../${GPIO_MONITOR_TMPL}:${TGT}.requires/${GPIO_MONITOR_TGTFMT}"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'PSU_MONITOR_FMT', 'OBMC_PSU_MONITOR_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PSU_MONITOR_FMT', 'OBMC_PSU_MONITOR_INSTANCES', 'OBMC_HOST_INSTANCES')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
index d7128f4..5150e23 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
+++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
@@ -16,11 +16,11 @@
 EEPROMS_ESCAPED = "${@compose_list(d, 'EEPROM_ESCAPEDFMT', 'EEPROM_NAMES')}"
 
 ENVFMT = "obmc/eeproms/{0}"
-SYSTEMD_ENVIRONMENT_FILE_${PN}:append:mtjade := "${@compose_list(d, 'ENVFMT', 'EEPROMS')}"
+SYSTEMD_ENVIRONMENT_FILE:${PN}:append:mtjade := "${@compose_list(d, 'ENVFMT', 'EEPROMS')}"
 
 TMPL = "obmc-read-eeprom@.service"
 TGT = "multi-user.target"
 INSTFMT = "obmc-read-eeprom@{0}.service"
 FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}"
 
-SYSTEMD_LINK_${PN}:append:mtjade := "${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
+SYSTEMD_LINK:${PN}:append:mtjade := "${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
index 43a6f17..a77a59b 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
+++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -21,7 +21,7 @@
 ITEMS += "iio-hwmon.conf iio-hwmon-adc14.conf iio-hwmon-battery.conf"
 
 ENVS = "obmc/${MACHINE}/hwmon/{0}"
-SYSTEMD_ENVIRONMENT_FILE_${PN}:append:mtjade = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
+SYSTEMD_ENVIRONMENT_FILE:${PN}:append:mtjade = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
 
 do_install:append:mtjade() {
   SOURCEDIR="${WORKDIR}/obmc/${MACHINE}/hwmon"