diff options
Diffstat (limited to 'meta-ampere/meta-common/recipes-phosphor')
7 files changed, 150 insertions, 30 deletions
diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh new file mode 100755 index 000000000..af3e2bead --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Copyright (c) 2021 Ampere Computing LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script updates the EDKII / SCP firmware. +# Author : Chanh Nguyen (chnguyen@amperecomputing.com) +# Date : Sep 7, 2021 +# Modified: + +usage () { + echo "Usage:" + echo " $(basename $0) <image path> " + echo "Where:" + echo " <image path>: the path link to folder, which include image file and MANIFEST" + echo "Example:" + echo " $(basename $0) /tmp/images/ghdh1393" +} + + +IMG_PATH="$1" +if [ ! -d $IMG_PATH ]; then + echo $IMG_PATH + echo "The folder $IMG_PATH does not exist" + usage + exit 1 +fi + +MANIFEST_PATH="${IMG_PATH}/MANIFEST" +if [ ! -f $MANIFEST_PATH ]; then + echo $MANIFEST_PATH + echo "The MANIFEST file $MANIFEST_PATH does not exist" + usage + exit 1 +fi + +EXTENDED_VERSION=$(awk '/ExtendedVersion/ {print}' ${MANIFEST_PATH} | cut -d "=" -f 2) + +# If the ExtendedVersion is empty, set default to update UEFI/EDKII on primary device +if [ -z "$EXTENDED_VERSION" ] +then + EXTENDED_VERSION="primary" +fi + +# Assign the command based on the ExtendedVersion +case ${EXTENDED_VERSION} in + "primary") + export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.bin" -o -name "*.rom" \)) + export CMD='/usr/sbin/ampere_flash_bios.sh $IMAGE 1' + ;; + + "secondary") + export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.bin" -o -name "*.rom" \)) + export CMD='/usr/sbin/ampere_flash_bios.sh $IMAGE 2' + ;; + + "scp-primary") + export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.slim" -o -name "*.rom" \)) + export CMD='/usr/sbin/ampere_firmware_upgrade.sh smpmpro $IMAGE 1' + ;; + + "scp-secondary") + export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.slim" -o -name "*.rom" \)) + export CMD='/usr/sbin/ampere_firmware_upgrade.sh smpmpro $IMAGE 2' + ;; + + "fru") + export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.bin" \)) + export CMD='/usr/sbin/ampere_firmware_upgrade.sh fru $IMAGE' + ;; + + *) + echo "Invalid ExtendedVersion: ${EXTENDED_VERSION}. Please check MANIFEST file!" + exit 1 + ;; +esac + + +if [ -z "$IMAGE" ] +then + echo "ERROR: The image file: No such file or directory" + exit 1 +else + eval $CMD +fi + +if [[ $? -ne 0 ]]; then + echo "ERROR: The firmware update not successfull" + exit 1 +fi diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service index c344600b2..036b78928 100644 --- a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service +++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service @@ -4,4 +4,4 @@ Description=Ampere service for flashing the Host firmware image [Service] Type=oneshot RemainAfterExit=no -ExecStart=/usr/sbin/ampere_flash_bios.sh /tmp/images/%I/*.img +ExecStart=/usr/sbin/firmware_update.sh /tmp/images/%I diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend index f5a250d60..853e5464a 100644 --- a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend +++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend @@ -1,7 +1,18 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += " \ + file://firmware_update.sh \ + " + PACKAGECONFIG[flash_bios] = "-Dhost-bios-upgrade=enabled, -Dhost-bios-upgrade=disabled" -PACKAGECONFIG:append_ = " flash_bios" +PACKAGECONFIG:append = " flash_bios" + +SYSTEMD_SERVICE:${PN}:updater += "${@bb.utils.contains('PACKAGECONFIG', 'flash_bios', 'obmc-flash-host-bios@.service', '', d)}" + +RDEPENDS:${PN} += "bash" -SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'flash_bios', 'obmc-flash-host-bios@.service', '', d)}" +do_install:append() { + install -d ${D}/usr/sbin + install -m 0755 ${WORKDIR}/firmware_update.sh ${D}/usr/sbin/firmware_update.sh +} diff --git a/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb b/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb new file mode 100644 index 000000000..e0a6819b6 --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb @@ -0,0 +1,32 @@ +SUMMARY = "Ampere OEM IPMI commands" +DESCRIPTION = "Ampere OEM IPMI commands" + +LICENSE = "Apache-2.0" +S = "${WORKDIR}" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +DEPENDS = "boost phosphor-ipmi-host phosphor-logging systemd libgpiod" + +inherit cmake obmc-phosphor-ipmiprovider-symlink + +EXTRA_OECMAKE="-DENABLE_TEST=0 -DYOCTO=1" + +LIBRARY_NAMES = "libzampoemcmds.so" + +S = "${WORKDIR}/git" +SRC_URI = "git://github.com/openbmc/ampere-ipmi-oem.git" +SRCREV = "1463f7013a17699081c1fbf506ee8d57827d1088" + +HOSTIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}" +NETIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}" + +FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV}" + +do_install:append(){ + install -d ${D}${includedir}/ampere-ipmi-oem + install -m 0644 -D ${S}/include/*.hpp ${D}${includedir}/ampere-ipmi-oem +} diff --git a/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend b/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend new file mode 100644 index 000000000..cbc9b80f8 --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend @@ -0,0 +1,3 @@ +PACKAGECONFIG:append = " smbios-ipmi-blob" + +PACKAGECONFIG:remove = " cpuinfo"
\ No newline at end of file diff --git a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service deleted file mode 100644 index 83f6581be..000000000 --- a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Check Host%i status on BMC reset -Wants=phosphor-ipmi-host.service -After=phosphor-ipmi-host.service -Wants=obmc-host-reset-running@%i.target -Before=obmc-host-reset-running@%i.target -Wants=op-reset-chassis-on@%i.service -After=op-reset-chassis-on@%i.service -Conflicts=obmc-host-stop@%i.target -ConditionPathExists=/run/openbmc/chassis@%i-on - -[Service] -RemainAfterExit=yes -Type=oneshot -ExecStart=/usr/sbin/ampere_host_check.sh 1 0 - -[Install] -WantedBy=obmc-host-reset@%i.target
\ No newline at end of file diff --git a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend index b25ba5d94..03df6a30e 100644 --- a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend +++ b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend @@ -4,12 +4,3 @@ DEPS_CFG = "resetreason.conf" DEPS_TGT = "phosphor-discover-system-state@.service" SYSTEMD_OVERRIDE:${PN}-discover:append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}" -FILES:${PN} += "${systemd_system_unitdir}/*" - -SRC_URI += " \ - file://ampere-reset-host-check@.service \ - " - -do_install:append() { - install -m 0644 ${WORKDIR}/ampere-reset-host-check@.service ${D}${systemd_unitdir}/system/phosphor-reset-host-check@.service -} |