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

assetTag: Add persistent configuration of AssetTag for IPS #251

Merged
merged 1 commit into from
Nov 15, 2022
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
24 changes: 24 additions & 0 deletions meta-ibm/recipes-phosphor/ips-asset-tag/ips-asset-tag.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SUMMARY = "Add persistent configuration of AssetTag for IPS"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

inherit allarch obmc-phosphor-systemd

SRC_URI:append:p10bmc = " \
file://ips-asset-tag.path \
file://ips-update-asset-tag.service \
file://ips-recover-asset-tag.service \
file://ips-asset-tag.sh \
"

SYSTEMD_SERVICE:${PN}:append:p10bmc = " ips-asset-tag.path"
SYSTEMD_SERVICE:${PN}:append:p10bmc = " ips-update-asset-tag.service"
SYSTEMD_SERVICE:${PN}:append:p10bmc = " ips-recover-asset-tag.service"

do_install:append:p10bmc() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/ips-asset-tag.sh ${D}${bindir}/ips-asset-tag.sh
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Monitor the AssetTag file for IPS
After=system-vpd.service

[Path]
PathModified=/var/lib/phosphor-inventory-manager/xyz/openbmc_project/inventory/system/xyz.openbmc_project.Inventory.Decorator.AssetTag
Unit=ips-update-asset-tag.service

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

subModel=($(busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system xyz.openbmc_project.Inventory.Decorator.Asset SubModel))

if [ "${subModel[1]}" = '"J0"' ]; then
echo "Loading ibm-asset-tag.sh: "$1
if [ "$1" == "update" ]; then
assetTag=($(busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system xyz.openbmc_project.Inventory.Decorator.AssetTag AssetTag))
assetTag=`echo ${assetTag[1]} | sed 's/\"//g'`
/sbin/fw_setenv ipsAssetTag ${assetTag}
elif [ "$1" == "recover" ]; then
assetTag=($(/sbin/fw_printenv ipsAssetTag | awk -F= '{print $2}'))
busctl set-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system xyz.openbmc_project.Inventory.Decorator.AssetTag AssetTag s ${assetTag}
fi
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Reset the AssetTag file for IPS
After=system-vpd.service

[Service]
ExecStart=/usr/bin/ips-asset-tag.sh recover
Restart=no
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Unit]
Description=Copy the AssetTag file for IPS

[Service]
ExecStart=/usr/bin/ips-asset-tag.sh update
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RDEPENDS:${PN}-extras:append:ibm-ac-server = " ${POWER_SERVICE_PACKAGES_AC_SERVE
RDEPENDS:${PN}-extras:append:p10bmc = " ${POWER_SERVICE_PACKAGES_P10} webui-vue dbus-sensors phosphor-virtual-sensor"
RDEPENDS:${PN}-extras:append:p10bmc = " pldm openpower-hw-diags srvcfg-manager biosconfig-manager phosphor-post-code-manager phosphor-host-postd debug-trigger libmctp panel mux-workarounds phosphor-boot-indicator"
RDEPENDS:${PN}-extras:append:p10bmc = " platform-fru-detect"
RDEPENDS:${PN}-extras:append:p10bmc = " gdbserver strace opkg"
RDEPENDS:${PN}-extras:append:p10bmc = " gdbserver strace opkg ips-asset-tag"
RDEPENDS:${PN}-extras:append:mihawk = " phosphor-webui phosphor-image-signing wistron-ipmi-oem ${POWER_SERVICE_PACKAGES_AC_SERVER}"
RDEPENDS:${PN}-extras:append:witherspoon-tacoma = " pldm srvcfg-manager webui-vue biosconfig-manager phosphor-post-code-manager phosphor-host-postd kexec-tools makedumpfile kdump vmcore-dmesg debug-trigger"
RDEPENDS:${PN}-extras:append:witherspoon-tacoma = " openpower-hw-diags panel"
Expand Down