Skip to content

Commit

Permalink
meta-ibm: Add the change-logo service for IPS
Browse files Browse the repository at this point in the history
Add change-logo service to detect whether there is a keyword in the
VPD, if it exists, the original logo will be replaced with a inspur
logo.

issues: ibm-openbmc/dev#2895

Signed-off-by: George Liu <[email protected]>
  • Loading branch information
lxwinspur committed Aug 3, 2022
1 parent c373a68 commit ddd5e13
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
11 changes: 11 additions & 0 deletions meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions meta-ibm/recipes-phosphor/webui/webui-vue/change-logo.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Start the change logo script
After=basic.targe
Before=bmcweb.service

[Service]
Restart=no
ExecStart=/usr/share/www/changeLogo.sh
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

model=($(busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system xyz.openbmc_project.Inventory.Decorator.Asset SubModel))
DIR=/usr/share/www/img
if [ "${model}" = '"S0"' || "${model}" = '"D0"' ]; then
echo "Using IBM logo"
elif [ "${model}" = '"J0"' ]; then
echo "loading IPS logo"
mount --bind ${DIR}/inspur-login-logo.svg.gz ${DIR}/login-company-logo.svg.gz
mount --bind ${DIR}/inspur-logo-header.svg.gz ${DIR}/logo-header.svg.gz
else
mount --bind ${DIR}/blankLogo.svg.gz ${DIR}/login-company-logo.svg.gz
mount --bind ${DIR}/blankLogo.svg.gz ${DIR}/logo-header.svg.gz
fi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions meta-ibm/recipes-phosphor/webui/webui-vue_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,26 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

EXTRA_OENPM:witherspoon-tacoma = "-- --mode ibm"
EXTRA_OENPM:p10bmc = "-- --mode ibm"

inherit obmc-phosphor-systemd

SRC_URI:append:p10bmc = " \
file://changeLogo.sh \
file://change-logo.service \
file://inspur-login-logo.svg \
file://inspur-logo-header.svg \
file://blankLogo.svg \
"

SYSTEMD_SERVICE:${PN}:append:p10bmc = " change-logo.service"

do_install:append:p10bmc() {
gzip ${WORKDIR}/inspur-login-logo.svg
gzip ${WORKDIR}/inspur-logo-header.svg
gzip ${WORKDIR}/blankLogo.svg

install -m 0755 ${WORKDIR}/inspur-login-logo.svg.gz ${D}${datadir}/www/img
install -m 0755 ${WORKDIR}/inspur-logo-header.svg.gz ${D}${datadir}/www/img
install -m 0755 ${WORKDIR}/blankLogo.svg.gz ${D}${datadir}/www/img
install -m 0755 ${WORKDIR}/changeLogo.sh ${D}${datadir}/www
}

0 comments on commit ddd5e13

Please sign in to comment.