Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta-ibm: Dynamically disable eth1.service #183

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we chose "SubModel", surely the B3 keyword has nothing to indicate the part's model?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these names can only be used in Asset.interface, it seems even more inappropriate.
So I added a new name SubModel to use (same as the name of the upstream commit).

If there are any misunderstandings or better suggestions, please let me know, thank you

xyz.openbmc_project.Inventory.Item:
VINI,DR: PrettyName
xyz.openbmc_project.Inventory.Item.Bmc:
Expand Down