Skip to content

Commit

Permalink
Merge pull request #183 from wistron-corporation/op940-disableETH1
Browse files Browse the repository at this point in the history
meta-ibm: Dynamically disable eth1.service
  • Loading branch information
rfrandse committed Aug 30, 2021
2 parents 4b69796 + bd1bddc commit 3ded1af
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

SubModel=($(busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/bmc xyz.openbmc_project.Inventory.Decorator.Asset SubModel))
echo "SubModel="${SubModel[1]}

if [ "${SubModel[1]}" = '"ETH"' ]
then
echo "SubModel="${SubModel[1]}" was detected, so first-boot-set-mac@eth1.service is disabled"
systemctl disable first-boot-set-mac@eth1.service
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Stop the ethernet link failover
After=op-vpd-parser.service

[Service]
Restart=no
ExecStart=/usr/bin/env ncsi-netlink --set -x 2 -p 0 -c 0
ExecStartPost=sh /usr/bin/disableETH1.sh
SyslogIdentifier=disableETH1.sh
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/network:"
SRC_URI_append_ibm-ac-server = " file://ncsi-netlink.service"
SRC_URI_append_mihawk = " file://ncsi-netlink.service"
SRC_URI_append_mowgli = " file://ncsi-netlink.service"
SRC_URI_append_mowgli = " file://ncsi-netlink-mowgli.service"
SRC_URI_append_mowgli = " file://disableETH1.sh"
SRC_URI_append_mowgli = " file://0001-Let-usb-network-be-static-ip.patch"

SYSTEMD_SERVICE_${PN}_append_ibm-ac-server = " ncsi-netlink.service"
SYSTEMD_SERVICE_${PN}_append_mihawk = " ncsi-netlink.service"
SYSTEMD_SERVICE_${PN}_append_mowgli = " ncsi-netlink.service"
SYSTEMD_SERVICE_${PN}_append_mowgli = " ncsi-netlink-mowgli.service"

do_install_append_ibm-ac-server() {
install -d ${D}${systemd_system_unitdir}
Expand All @@ -18,5 +19,6 @@ do_install_append_mihawk() {
}
do_install_append_mowgli() {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/ncsi-netlink.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/ncsi-netlink-mowgli.service ${D}${systemd_system_unitdir}
install -m 0755 ${WORKDIR}/disableETH1.sh ${D}/usr/bin
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BMC:
OPFR,VS: SerialNumber
OPFR,VN: Manufacturer
VNDR,IN: Model
VINI,B3: SubModel
xyz.openbmc_project.Inventory.Item:
VINI,DR: PrettyName
xyz.openbmc_project.Inventory.Item.Bmc:
Expand Down

0 comments on commit 3ded1af

Please sign in to comment.