meta-ampere: mtmitchell: network: use sync-mac for MAC from FRU
Switch to use phosphor-networkd's sync-mac feature to get and use MAC
address from FRU, replacing Ampere approach.
Tested:
1. Boot the BMC to Linux and login to console
2. Get BMC MAC address in FRU
$ ipmitool fru print 1 | grep "Board Extra"
Board Extra : B4:05:5D:E1:01:BC
3. Check eth0 HWaddr with MAC in FRU
$ ifconfig eth0 | grep HWaddr
eth0 Link encap:Ethernet HWaddr B4:05:5D:E1:01:BC
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Signed-off-by: Khang Nguyen <khangng@amperecomputing.com>
Change-Id: Ia31589bf75306ad5a3639cb46a73813957e85e9d
diff --git a/meta-ampere/meta-common/recipes-phosphor/packagegroups/packagegroup-ampere-apps.bb b/meta-ampere/meta-common/recipes-phosphor/packagegroups/packagegroup-ampere-apps.bb
index b84b4e7..b277659 100644
--- a/meta-ampere/meta-common/recipes-phosphor/packagegroups/packagegroup-ampere-apps.bb
+++ b/meta-ampere/meta-common/recipes-phosphor/packagegroups/packagegroup-ampere-apps.bb
@@ -28,7 +28,6 @@
ampere-utils \
ampere-usbnet \
ampere-ipmi-oem \
- ampere-mac-update \
ampere-driver-binder \
"
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb
deleted file mode 100644
index 7deb05a..0000000
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Ampere Computing LLC Update MAC Address from FRU Inventory Information"
-DESCRIPTION = "Update MAC Address from FRU Inventory Information for Ampere systems"
-PR = "r1"
-
-LICENSE = "Apache-2.0"
-
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
-
-inherit systemd
-inherit obmc-phosphor-systemd
-
-DEPENDS = "systemd"
-RDEPENDS:${PN} = "bash"
-
-FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
-
-SYSTEMD_SERVICE:${PN} = "ampere_update_mac.service"
-
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service
deleted file mode 100644
index c816fac..0000000
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Updating MAC Address Service From FRU inventory
-Requires=xyz.openbmc_project.EntityManager.service
-After=xyz.openbmc_project.EntityManager.service
-StartLimitInterval=25
-StartLimitBurst=5
-
-[Service]
-ExecStart=/usr/sbin/ampere_update_mac.sh eth0 14 80
-SyslogIdentifier=ampere_update_mac.sh
-RemainAfterExit=yes
-Restart=on-failure
-RestartSec=5
-
-[Install]
-WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network/config.json b/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network/config.json
new file mode 100644
index 0000000..34bb454
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network/config.json
@@ -0,0 +1,3 @@
+{
+ "eth0": ""
+}
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network_%.bbappend b/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network_%.bbappend
new file mode 100644
index 0000000..2f2ee59
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/network/phosphor-network_%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+PACKAGECONFIG:append = " sync-mac "
+
+SRC_URI:append = " file://config.json "
+FILES:${PN} += "${datadir}/network/*.json"
+
+do_install:append() {
+ install -d ${D}${datadir}/network/
+ install -m 0644 ${WORKDIR}/config.json ${D}${datadir}/network/
+}