summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-gsj
diff options
context:
space:
mode:
authorHank Liou <Hank.Liou@quantatw.com>2019-06-26 09:00:20 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-07-09 05:23:35 +0300
commitf16037c36b9243a735cdc1345ebbc9287d7dec45 (patch)
tree0b08334852bc50d4eb337d1cb44620409d0d7472 /meta-quanta/meta-gsj
parent1fe98971dc99dfbc0239e8ff21b643fa3a1d3b29 (diff)
downloadopenbmc-f16037c36b9243a735cdc1345ebbc9287d7dec45.tar.xz
meta-gsj: mac-address: Initialize MAC addresses
This commit is to assign MAC address to eth1, usb0_dev, usb0_host and eth0 ports. The address of eth1 is read from EEPROM, while others are obtained by adding one, two and three to eth1 respectively. We will randomly generate address of eth1 once an error occurs. The randomly-generated MAC address is of the form "00:1B:24:XX:XX:XX". (From meta-quanta rev: b1c33ab8eb04ccf7ac77df58dca661a964cce293) Signed-off-by: Hank Liou <Hank.Liou@quantatw.com> Change-Id: I000f818058989af2fe1f9457e22b4568ce47a8d5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-quanta/meta-gsj')
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service11
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb27
2 files changed, 38 insertions, 0 deletions
diff --git a/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service b/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service
new file mode 100644
index 000000000..e18d69493
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Initialize MAC Address
+Before=usb_network.service network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/mac-address
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb b/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb
new file mode 100644
index 000000000..8d3fbf376
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb
@@ -0,0 +1,27 @@
+SRC_URI = "git://github.com/quanta-bmc/mac-address.git;protocol=git"
+SRCREV = "${AUTOREV}"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit autotools pkgconfig
+inherit systemd
+
+DEPENDS += "systemd"
+DEPENDS += "autoconf-archive-native"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append = " file://mac-address.service"
+
+HASHSTYLE = "gnu"
+S = "${WORKDIR}/git"
+CXXFLAGS += "-std=c++17"
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/mac-address.service \
+ ${D}${systemd_unitdir}/system
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} += "mac-address.service" \ No newline at end of file