diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-intel/nic')
3 files changed, 48 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics.bb b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics.bb new file mode 100644 index 000000000..50c8bd63e --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics.bb @@ -0,0 +1,24 @@ +SUMMARY = "One time automatically enable every NIC" +DESCRIPTION = "Re-enable NIC accidentally disabled by earlier BMC firmware." + +S = "${WORKDIR}" +SRC_URI = "file://enable-nics.sh \ + file://enable-nics.service \ + " + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +RDEPENDS_${PN} += "bash" + +inherit systemd + +FILES_${PN} += "${systemd_system_unitdir}/enable-nics.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/enable-nics.service ${D}${systemd_system_unitdir} + install -d ${D}${bindir} + install -m 0755 ${S}/enable-nics.sh ${D}/${bindir}/enable-nics.sh +} + +SYSTEMD_SERVICE_${PN} += " enable-nics.service" diff --git a/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.service b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.service new file mode 100644 index 000000000..c1d0f602f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.service @@ -0,0 +1,10 @@ +[Unit] +Description=Re-enable NICs mistakenly disabled by earlier BMC firmware +Wants=multi-user.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/enable-nics.sh + +[Install] +WantedBy=network.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.sh b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.sh new file mode 100755 index 000000000..ce1473be1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/nic/enable-nics/enable-nics.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +SEMAPHORE_FILE=/var/cache/private/nic_fixup_complete + +if [ -a $SEMAPHORE_FILE ]; then + exit 0 +fi + +for nicFile in /etc/systemd/network/*.network +do + sed -i -e"/Unmanaged/d" $nicFile +done + +touch $SEMAPHORE_FILE |