From ddd5e1399f014d4326198791297002e589cd4170 Mon Sep 17 00:00:00 2001 From: George Liu Date: Mon, 1 Aug 2022 12:47:52 +0800 Subject: [PATCH] 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 --- .../webui/webui-vue/blankLogo.svg | 11 +++++++++ .../webui/webui-vue/change-logo.service | 13 +++++++++++ .../webui/webui-vue/changeLogo.sh | 14 +++++++++++ .../webui/webui-vue/inspur-login-logo.svg | 1 + .../webui/webui-vue/inspur-logo-header.svg | 1 + .../webui/webui-vue_%.bbappend | 23 +++++++++++++++++++ 6 files changed, 63 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..a888195241 --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/blankLogo.svg @@ -0,0 +1,11 @@ + + + + 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..138a31739e --- /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=basic.targe +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..6f8fc531c1 --- /dev/null +++ b/meta-ibm/recipes-phosphor/webui/webui-vue/changeLogo.sh @@ -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 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..bf3374eec8 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 ${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 +}