diff options
author | William A. Kennington III <wak@google.com> | 2021-03-05 09:56:26 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2021-03-09 02:02:26 +0300 |
commit | 3b3c40fd23ce19ed5b15edd36cf11b18cbdf94e9 (patch) | |
tree | 71a3a93f6c1fd8392fc40444d9c98f0a67dd1b5e /meta-google/recipes-google/networking/gbmc-mac-config.bb | |
parent | 027c05505532d5cd7d21c14a9add2e4daa711710 (diff) | |
download | openbmc-3b3c40fd23ce19ed5b15edd36cf11b18cbdf94e9.tar.xz |
meta-google: gbmc-mac-config: Add package
This package allows a system to specify an IPMI FRU that contains MAC
Address information used to populated MAC addresses for specified
interfaces.
Change-Id: I457d41509da0e63db4410937b84140d4ba410b41
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/networking/gbmc-mac-config.bb')
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-mac-config.bb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-mac-config.bb b/meta-google/recipes-google/networking/gbmc-mac-config.bb new file mode 100644 index 000000000..6ca4c798b --- /dev/null +++ b/meta-google/recipes-google/networking/gbmc-mac-config.bb @@ -0,0 +1,50 @@ +SUMMARY = "Configures MAC addresses on a gBMC system" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit systemd + +SRC_URI += " \ + file://gbmc-mac-config.service \ + file://gbmc-mac-config.sh.in \ + " + +S = "${WORKDIR}" + +RDEPENDS_${PN} += " \ + bash \ + ipmi-fru-sh \ + " + +FILES_${PN} += "${systemd_unitdir}" + +SYSTEMD_SERVICE_${PN} += "gbmc-mac-config.service" + +GBMC_MAC_EEPROM_OF_NAME ?= "" + +# Maps the MAC address offset from the base address to an interface name +# in bash associative array syntax. +# Ex. "[0]=eth0 [2]=eth2" +GBMC_MAC_IF_MAP ?= "" + +do_install_append() { + if [ -z '${GBMC_MAC_EEPROM_OF_NAME}' ]; then + echo 'Missing GBMC_MAC_EEPROM_OF_NAME' >&2 + exit 1 + fi + + # Build time dictionary sanity check + bash -c 'declare -A dict=(${GBMC_MAC_IF_MAP})' + + sed gbmc-mac-config.sh.in \ + -e 's#@EEPROM@#${GBMC_MAC_EEPROM_OF_NAME}#' \ + -e 's#@NUM_TO_IF@#${GBMC_MAC_IF_MAP}#' \ + >gbmc-mac-config.sh + + install -d -m0755 ${D}${libexecdir} + install -m0755 gbmc-mac-config.sh ${D}${libexecdir}/ + + install -d -m0755 ${D}${systemd_system_unitdir} + install -m0644 gbmc-mac-config.service ${D}${systemd_system_unitdir}/ +} |