From c6a6411e0c5441fddd30abdfa3828d6bfd28a743 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Wed, 3 Aug 2022 13:13:15 -0500 Subject: [PATCH] meta-ibm: add the change-logo service for IPS and OEM (#233) * 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: https://github.com/ibm-openbmc/dev/issues/2895 Signed-off-by: George Liu * 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 Co-authored-by: George Liu --- .../webui/webui-vue/blankLogo.svg | 4 ++++ .../webui/webui-vue/change-logo.service | 13 +++++++++++ .../webui/webui-vue/changeLogo.sh | 17 ++++++++++++++ .../webui/webui-vue/inspur-login-logo.svg | 1 + .../webui/webui-vue/inspur-logo-header.svg | 1 + .../webui/webui-vue_%.bbappend | 23 +++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg create mode 100644 meta-ibm/recipes-phosphor/webui/webui-vue/change-logo.service create mode 100644 meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh create mode 100644 meta-ibm/recipes-phosphor/webui/webui-vue/inspur-login-logo.svg create mode 100644 meta-ibm/recipes-phosphor/webui/webui-vue/inspur-logo-header.svg diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg b/meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg new file mode 100644 index 0000000000..747fabda67 --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue/change-logo.service b/meta-ibm/recipes-phosphor/webui/webui-vue/change-logo.service new file mode 100644 index 0000000000..f272627c0d --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/change-logo.service @@ -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 diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh b/meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh new file mode 100644 index 0000000000..13504a2320 --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh @@ -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 diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-login-logo.svg b/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-login-logo.svg new file mode 100644 index 0000000000..61d87b33d8 --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-login-logo.svg @@ -0,0 +1 @@ +LOGO - 副本 \ No newline at end of file diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-logo-header.svg b/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-logo-header.svg new file mode 100644 index 0000000000..88d60ddf4b --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/inspur-logo-header.svg @@ -0,0 +1 @@ +Inspur_logo \ No newline at end of file diff --git a/meta-ibm/recipes-phosphor/webui/webui-vue_%.bbappend b/meta-ibm/recipes-phosphor/webui/webui-vue_%.bbappend index fe11d70df9..9864b033bc 100644 --- a/meta-ibm/recipes-phosphor/webui/webui-vue_%.bbappend +++ b/meta-ibm/recipes-phosphor/webui/webui-vue_%.bbappend @@ -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 +}