Skip to content

Commit

Permalink
meta-ibm: add the change-logo service for IPS and OEM (#233)
Browse files Browse the repository at this point in the history
* meta-ibm: Add the change-logo service for IPS

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]>

* meta-ibm: change-logo fixes

Some fixes found in testing this PR

Tested:
- Verified default path when brand is IBM
- Verified IPS logo loaded in GUI when brand is J0
- Verified transparent logo loaded for any other brand

Signed-off-by: Andrew Geissler <[email protected]>

Co-authored-by: George Liu <[email protected]>
  • Loading branch information
2 people authored and rfrandse committed Oct 24, 2022
1 parent 06df9c8 commit c6a6411
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
4 changes: 4 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=system-vpd.service
Before=bmcweb.service

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

[Install]
WantedBy=multi-user.target
17 changes: 17 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,17 @@
#!/bin/sh -e

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[1]}" = '"S0"' ] || [ "${model[1]}" = '"D0"' ]; then
echo "Using IBM logo"
elif [ "${model[1]}" = '"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
mount --bind ${DIR}/blankLogo.svg.gz /usr/share/www/bee-2-light.svg.gz
else
echo "loading OEM logo"
mount --bind ${DIR}/blankLogo.svg.gz ${DIR}/login-company-logo.svg.gz
mount --bind ${DIR}/blankLogo.svg.gz ${DIR}/logo-header.svg.gz
mount --bind ${DIR}/blankLogo.svg.gz /usr/share/www/bee-2-light.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 -f -k ${WORKDIR}/inspur-login-logo.svg
gzip -f -k ${WORKDIR}/inspur-logo-header.svg
gzip -f -k ${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 c6a6411

Please sign in to comment.