diff options
Diffstat (limited to 'meta-phosphor/recipes-phosphor/flash')
37 files changed, 1041 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv b/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv new file mode 100644 index 000000000..223d31809 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAPvSDLu6slkP1gri +PaeQXL9ysD69J/HjbBCIQ0RPfeWBb75US1tRTjPP0Ub8CtH8ExVf8iF1ulsZA78B +zIjBYZVp9pyD6LbpZ/hjV7rIH6dTNhoVpdA+F8LzmQ7cyhHG8l2JMvdunwF2uX5k +D4WDcZt/ITKZNQNavPtmIyD5HprdAgMBAAECgYEAuQkTSi5ZNpAoWz76xtGRFSwU +zUT4wQi3Mz6tDtjKTYXasiQGa0dHC1M9F8fDu6BZ9W7W4Dc9hArRcdzEighuxoI/ +nZI/0uL89iUEywnDEIHuS6D5JlZaj86/nx9YvQnO8F/seM+MX0EAWVrd5wC7aAF1 +h6Fu7ykZB4ggUjQAWwECQQD+AUiDOEO+8btLJ135dQfSGc5VFcZiequnKWVm6uXt +rX771hEYjYMjLqWGFg9G4gE3GuABM5chMINuQQUivy8tAkEA/cxfy19XkjtqcMgE +x/UDt6Nr+Ky/tk+4Y65WxPRDas0uxFOPk/vEjgVmz1k/TAy9G4giisluTvtmltr5 +DCLocQJBAJnRHx9PiD7uVhRJz6/L/iNuOzPtTsi+Loq5F83+O6T15qsM1CeBMsOw +cM5FN5UeMcwz+yjfHAsePMkcmMaU7jUCQHlg9+N8upXuIo7Dqj2zOU7nMmkgvSNE +5yuNImRZabC3ZolwaTdd7nf5r1y1Eyec5Ag5yENV6JKPe1Xkbb1XKJECQDngA0h4 +6ATvfP1Vrx4CbP11eKXbCsZ9OGPHSgyvVjn68oY5ZP3uPsIattoN7dE2BRfuJm7m +F0nIdUAhR0yTfKM= +-----END PRIVATE KEY----- diff --git a/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.py b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.py new file mode 100644 index 000000000..5e5dd8f36 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Contributors Listed Below - COPYRIGHT 2015 +# [+] International Business Machines Corp. +# +# +# 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. + +import time +import sys +import dbus +import dbus.service +import dbus.mainloop.glib + +if __name__ == '__main__': + print "obmc-phosphor-flashd starting..." + + while 1: + time.sleep(5) diff --git a/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service new file mode 100644 index 000000000..3a7f3d53a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Flash Controller + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-flashd +SyslogIdentifier=obmc-phosphor-flashd + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb new file mode 100644 index 000000000..f42bef443 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC org.openbmc.Flash example implementation" +DESCRIPTION = "A sample implementation for the org.openbmc.Flash DBUS API. \ +org.openbmc.Flash provides APIs for functions like BIOS flash access control \ +and updating." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +SKELETON_DIR = "flashbios" +DBUS_SERVICE_${PN} += "org.openbmc.control.Flash.service" +SYSTEMD_SERVICE_${PN} += "obmc-flash-init.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service new file mode 100644 index 000000000..de196d0ea --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service @@ -0,0 +1,12 @@ +[Unit] +Description=Initialize BIOS Flash +Wants=mapper-wait@-org-openbmc-control-flash-bios.service +After=mapper-wait@-org-openbmc-control-flash-bios.service + +[Service] +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/flash/bios` /org/openbmc/control/flash/bios org.openbmc.Flash init" +SyslogIdentifier=obmc-flash-init + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service new file mode 100644 index 000000000..842add34d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service @@ -0,0 +1,14 @@ +[Unit] +Description=Phosphor BIOS Code Update +Wants=mapper-wait@-org-openbmc-managers-Download.service +After=mapper-wait@-org-openbmc-managers-Download.service + +[Service] +Restart=always +ExecStart=/usr/bin/env flash_bios.exe +SyslogIdentifier=flash_bios.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb new file mode 100644 index 000000000..5cf385513 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb @@ -0,0 +1,19 @@ +SUMMARY = "OpenBMC BMC update utility" +DESCRIPTION = "OpenBMC BMC update utility." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RDEPENDS_${PN} += "\ + python-dbus \ + python-compression \ + python-shell \ + python-pygobject \ + python-subprocess \ + python-io \ + pyphosphor-dbus \ + " + +SKELETON_DIR = "pyflashbmc" +DBUS_SERVICE_${PN} += "org.openbmc.control.BmcFlash.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service new file mode 100644 index 000000000..bb97d8ab9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service @@ -0,0 +1,15 @@ +[Unit] +Description=Phosphor BMC Code Update +Wants=mapper-wait@-org-openbmc-managers-Download.service +After=mapper-wait@-org-openbmc-managers-Download.service + +[Service] +Restart=always +ExecStart=/usr/bin/env bmc_update.py +SyslogIdentifier=bmc_update.py +Environment="PYTHONUNBUFFERED=1" +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb new file mode 100644 index 000000000..a608b0ab2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb @@ -0,0 +1,16 @@ +SUMMARY = "OpenBMC org.openbmc.managers.Download example implementation" +DESCRIPTION = "An example implementation for the org.openbmc.managers.Download DBUS API." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RDEPENDS_${PN} += "\ + python-dbus \ + python-pygobject \ + python-subprocess \ + pyphosphor-dbus \ + " + +SKELETON_DIR = "pydownloadmgr" +DBUS_SERVICE_${PN} += "org.openbmc.managers.Download.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service new file mode 100644 index 000000000..f3ff75dfe --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Download Manager + +[Service] +Restart=always +ExecStart=/usr/bin/env download_manager.py +SyslogIdentifier=download_manager.py +Environment="PYTHONUNBUFFERED=1" +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb b/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb new file mode 100644 index 000000000..e70c35474 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb @@ -0,0 +1,11 @@ +SUMMARY = "OpenPOWER flashing utility." +DESCRIPTION = "A BMC/BIOS flashing utility for use on OpenPOWER system." +PR = "r1" + +inherit skeleton-gdbus +inherit pkgconfig + +DEPENDS += "pflash" +RDEPENDS_${PN} += "pflash" + +SKELETON_DIR = "op-flasher" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb b/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb new file mode 100644 index 000000000..64a47a6cd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb @@ -0,0 +1,11 @@ +SUMMARY = "Phosphor OpenBMC Flash Management" +DESCRIPTION = "Phosphor OpenBMC flash management reference implementation." +PR = "r1" + +inherit obmc-phosphor-pydbus-service + +PROVIDES += "virtual/obmc-flash-mgmt" +RPROVIDES_${PN} += "virtual-obmc-flash-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://${PN}.py" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb new file mode 100644 index 000000000..897bfdea4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb @@ -0,0 +1,29 @@ +SUMMARY = "OpenBMC image signing public key" +DESCRIPTION = "Public key information to be included in images for image verification." +PR = "r1" + +inherit allarch +inherit obmc-phosphor-license + +INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}" + +DEPENDS += "openssl-native" +DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}" + +FILES_${PN} += "${sysconfdir}/activationdata/" + +SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv" +SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}" + +do_install() { + openssl pkey -in "${SIGNING_KEY}" -pubout -out ${WORKDIR}/publickey + echo HashType=RSA-SHA256 > "${WORKDIR}/hashfunc" + + idir="${D}${sysconfdir}/activationdata/${SIGNING_KEY_TYPE}" + + install -d ${idir} + install -m 644 ${WORKDIR}/publickey ${idir} + install -m 644 ${WORKDIR}/hashfunc ${idir} +} + +SYSROOT_DIRS_append = " ${sysconfdir}" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb new file mode 100644 index 000000000..55ebe5779 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Insecure private key for testing and development" +DESCRIPTION = "Do not use this key to sign images." +PR = "r1" + +inherit allarch +inherit native +inherit obmc-phosphor-license + +SRC_URI += "file://OpenBMC.priv" + +do_install() { + bbplain "Using an insecure image signing key!" + install -d ${D}${datadir} + install -m 400 ${WORKDIR}/OpenBMC.priv ${D}${datadir} +} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend b/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend new file mode 100644 index 000000000..beb70b0e6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend @@ -0,0 +1 @@ +DEPENDS += "phosphor-software-manager-error-native" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb new file mode 100644 index 000000000..bf55058de --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Copy error yaml files to known path for elog parsing" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit native +inherit phosphor-dbus-yaml + +require phosphor-software-manager.inc + +S = "${WORKDIR}/git" + +do_install_append() { + SRC=${S}/xyz/openbmc_project/Software/ + DEST=${D}${yaml_dir}/xyz/openbmc_project/Software/ + install -d ${DEST} + install ${SRC}/*.errors.yaml ${DEST} + install ${SRC}/*.metadata.yaml ${DEST} +} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb new file mode 100644 index 000000000..0b6723c89 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb @@ -0,0 +1,104 @@ +SUMMARY = "Phosphor Software Management" +DESCRIPTION = "Phosphor Software Manager provides a set of system software \ +management daemons. It is suitable for use on a wide variety of OpenBMC \ +platforms." +PR = "r1" + +require ${PN}.inc + +SOFTWARE_MGR_PACKAGES = " \ + ${PN}-version \ + ${PN}-download-mgr \ + ${PN}-updater \ + ${PN}-updater-ubi \ + ${PN}-sync \ +" +PACKAGE_BEFORE_PN += "${SOFTWARE_MGR_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${SOFTWARE_MGR_PACKAGES}" + +# Set SYSTEMD_PACKAGES to empty because we do not want ${PN} and DBUS_PACKAGES +# handles the rest. +SYSTEMD_PACKAGES = "" + +PACKAGECONFIG[verify_signature] = "--enable-verify_signature,--disable-verify_signature" +PACKAGECONFIG[sync_bmc_files] = "--enable-sync_bmc_files,--disable-sync_bmc_files" +PACKAGECONFIG[ubifs_layout] = "--enable-ubifs_layout" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service +inherit pythonnative +inherit ${@bb.utils.contains('DISTRO_FEATURES', 'obmc-ubi-fs', 'phosphor-software-manager-ubi-fs', '', d)} + +DEPENDS += " \ + autoconf-archive-native \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + sdbus++-native \ +" + +RDEPENDS_${PN}-version += " \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ +" +RDEPENDS_${PN}-download-mgr += " \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ +" +RDEPENDS_${PN}-updater += " \ + bash \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ + virtual-obmc-image-manager \ +" +EXTRA_OECONF += " \ + ACTIVE_BMC_MAX_ALLOWED=1 \ + MEDIA_DIR=/run/media \ +" + +RPROVIDES_${PN}-version += " \ + virtual-obmc-image-manager \ +" + +FILES_${PN}-version += "${sbindir}/phosphor-version-software-manager ${exec_prefix}/lib/tmpfiles.d/software.conf" +FILES_${PN}-download-mgr += "${sbindir}/phosphor-download-manager" +FILES_${PN}-updater += " \ + ${sbindir}/phosphor-image-updater \ + ${sbindir}/obmc-flash-bmc \ + " +FILES_${PN}-sync += " \ + ${sbindir}/phosphor-sync-software-manager \ + ${sysconfdir}/synclist \ + " +DBUS_SERVICE_${PN}-version += "xyz.openbmc_project.Software.Version.service" +DBUS_SERVICE_${PN}-download-mgr += "xyz.openbmc_project.Software.Download.service" +DBUS_SERVICE_${PN}-updater += "xyz.openbmc_project.Software.BMC.Updater.service" +DBUS_SERVICE_${PN}-sync += "xyz.openbmc_project.Software.Sync.service" + +SYSTEMD_SERVICE_${PN}-updater += " \ + obmc-flash-bmc-setenv@.service \ +" + +SRC_URI += "file://software.conf" +SRC_URI += "file://obmc-flash-bmc" + +do_install_append() { + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/obmc-flash-bmc ${D}${sbindir}/obmc-flash-bmc + + # /tmp/images is the software image upload directory. + # It should not be deleted since it is watched by the Image Manager + # for new images. + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then + install -d ${D}${exec_prefix}/lib/tmpfiles.d + install -m 644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/ + fi +} + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc new file mode 100644 index 000000000..8e4a2b59a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/phosphor-bmc-code-mgmt" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-bmc-code-mgmt" +SRCREV = "76c79df3fca0842ec9dd38f9627913cf5c64001e" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc new file mode 100644 index 000000000..0b1b16ed3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc @@ -0,0 +1,516 @@ +#!/bin/bash +set -eo pipefail + +# Get the root mtd device number (mtdX) from "/dev/ubiblockX_Y on /" +findrootmtd() { + rootmatch=" on / " + m="$(mount | grep "${rootmatch}" | grep "ubiblock")" + m="${m##*ubiblock}" + m="${m%_*}" + if [ -z "${m}" ]; then + # default to bmc mtd (0) + m=0 + fi + echo "mtd${m}" +} + +findrootubi() { + rootmatch=" on / " + m="$(mount | grep "${rootmatch}")" + m="${m##*ubiblock}" + m="${m% on*}" + echo "ubi${m}" +} + +# Get the mtd device number (mtdX) +findmtd() { + m="$(grep -xl "$1" /sys/class/mtd/*/name)" + m="${m%/name}" + m="${m##*/}" + echo "${m}" +} + +# Get the mtd device number only (return X of mtdX) +findmtdnum() { + m="$(findmtd "$1")" + m="${m##mtd}" + echo "${m}" +} + +# Get the ubi device number (ubiX_Y) +findubi() { + u="$(grep -xl "$1" /sys/class/ubi/ubi?/subsystem/ubi*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get the ubi device number (ubiX_Y) on a specific mtd +findubi_onmtd() { + u="$(grep -xl "$1" /sys/class/ubi/ubi"$2"/subsystem/ubi"$2"*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get all ubi device names on a specific mtd that match requested string +findubiname_onmtd() { + u="$(grep -h "$1" /sys/class/ubi/ubi"$2"/subsystem/ubi"$2"*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get the name from the requested ubiX_Y volume +findname() { + n="$(cat /sys/class/ubi/$1/name)" + echo "${n}" +} + +# Set the u-boot envs that perform a side switch on failure to boot +set_wdt2bite() { + if ! fw_printenv wdt2bite 2>/dev/null; then + fw_setenv wdt2bite "mw.l 0x1e785024 0xa 1; mw.b 0x1e78502c 0xb3 1" + fw_setenv bootalt "run wdt2bite" + fw_setenv obmc_bootcmd "ubi part obmc-ubi; run do_rwreset; ubi read \ +\${loadaddr} \${kernelname}; bootm \${loadaddr} || run bootalt" + fi +} + +# Make space on flash before creating new volumes. This can be enhanced +# determine current flash usage. For now only keep a "keepmax" number of them +ubi_remove_volumes() +{ + rootubi="$(findrootubi)" + rootname="$(findname "${rootubi}")" + rootversion="${rootname##*-}" + rootkernel="kernel-${rootversion}" + + # Just keep max number of volumes before updating, don't delete the version + # the BMC is booted from, and when a version is identified to be deleted, + # delete both the rofs and kernel volumes for that version. + rmnames="$(findubiname_onmtd "${name%-*}-" "${ro}")" + rmnames=(${rmnames}) + ubicount="${#rmnames[@]}" + while [ ${ubicount} -ge ${keepmax} ]; do + # Loop through existing volumes and skip currently active ones + for (( index=0; index<${#rmnames[@]}; index++ )); do + rmname="${rmnames[${index}]}" + rmversion="${rmname##*-}" + [ "${rmversion}" == "${version}" ] && continue + rmubi="$(findubi_onmtd "rofs-${rmversion}" "${ro}")" + if [[ ( "${rmubi}" != "${rootubi}" ) && + ( "${rmname}" != "${rootkernel}" ) ]]; then + ubi_remove "rofs-${rmversion}" "${ro}" + ubi_remove "kernel-${rmversion}" "${ro}" + # Remove priority value + fw_setenv "${rmversion}" + break + fi + done + # Decrease count regardless to avoid an infinite loop + (( ubicount-- )) + done +} + +ubi_rw() { + rwmtd="$(findmtd "${reqmtd}")" + rw="${rwmtd#mtd}" + ubidev="/dev/ubi${rw}" + + # Update rwfs_size, check imgsize was specified, otherwise it'd clear the var + if [ ! -z "$imgsize" ]; then + rwsize="$(fw_printenv -n rwfs_size 2>/dev/null)" || true + if [[ "${imgsize}" != "${rwsize}" ]]; then + fw_setenv rwfs_size "${imgsize}" + fi + fi + + vol="$(findubi "${name}")" + if [ -z "${vol}" ]; then + ubimkvol "${ubidev}" -N "${name}" -s "${imgsize}" + fi +} + +ubi_ro() { + keepmax=2 # Default 2 volumes per mtd + romtd="$(findmtd "${reqmtd}")" + romtd2="$(findmtd "${reqmtd2}")" + + if [ ! "${romtd}" == "${romtd2}" ]; then + # Request to use alternate mtd device, choose the non-root one + keepmax=1 # 1 volume on each of the requested mtds + rootmtd="$(findrootmtd)" + if [ "${rootmtd}" == "${romtd}" ]; then + romtd="${romtd2}" + fi + fi + ro="${romtd#mtd}" + ubidev="/dev/ubi${ro}" + + ubi_remove_volumes + + if [ -z "${imgfile}" ]; then + echo "Unable to create read-only volume. Image file not specified." + return 1 + fi + + # Create a ubi volume, dynamically sized to fit BMC image if size unspecified + img="/tmp/images/${version}/${imgfile}" + imgsize="$(stat -c '%s' ${img})" + + vol="$(findubi "${name}")" + if [ ! -z "${vol}" ]; then + # Allow a duplicate kernel volume on the alt mtd + if [[ "${name}" =~ "kernel" ]]; then + vol="$(findubi_onmtd "${name}" "${ro}")" + fi + fi + if [ -z "${vol}" ]; then + ubimkvol "${ubidev}" -N "${name}" -s "${imgsize}" --type=static + vol="$(findubi "${name}")" + fi +} + +# Squashfs images need a ubi block +ubi_block() { + vol="$(findubi "${name}")" + ubidevid="${vol#ubi}" + block="/dev/ubiblock${ubidevid}" + if [ ! -e "$block" ]; then + ubiblock --create "/dev/ubi${ubidevid}" + fi +} + +ubi_updatevol() { + vol="$(findubi "${name}")" + ubidevid="${vol#ubi}" + img="/tmp/images/${version}/${imgfile}" + ubiupdatevol "/dev/ubi${ubidevid}" "${img}" +} + +ubi_remove() { + rmname="$1" + rmmtd="$2" + if [ ! -z "${rmmtd}" ]; then + vol="$(findubi_onmtd "${rmname}" "${rmmtd}")" + else + vol="$(findubi "${rmname}")" + fi + + if [ ! -z "$vol" ]; then + vol="${vol%_*}" + + if grep -q "$rmname" /proc/mounts; then + mountdir=$(grep "$rmname" /proc/mounts | cut -d " " -f 2) + umount "$mountdir" + rm -r "$mountdir" + fi + + ubirmvol "/dev/${vol}" -N "$rmname" + fi +} + +ubi_cleanup() { + # When ubi_cleanup is run, it expects one or no active version. + activeVersion=$(busctl --list --no-pager tree \ + xyz.openbmc_project.Software.BMC.Updater | \ + grep /xyz/openbmc_project/software/ | tail -c 9) + + if [[ -z "$activeVersion" ]]; then + vols=$(ubinfo -a | grep "rofs-" | cut -c 14-) + vols=(${vols}) + else + vols=$(ubinfo -a | grep "rofs-" | \ + grep -v "$activeVersion" | cut -c 14-) + vols=(${vols}) + fi + + for (( index=0; index<${#vols[@]}; index++ )); do + ubi_remove ${vols[index]} + done +} + +mount_alt_rwfs() { + altNum="$(findmtdnum "alt-bmc")" + if [ ! -z "${altNum}" ]; then + altRwfs=$(ubinfo -a -d ${altNum} | grep -w "rwfs") || true + if [ ! -z "${altRwfs}" ]; then + altVarMount="/media/alt/var" + mkdir -p "${altVarMount}" + if mount ubi"${altNum}":rwfs "${altVarMount}" -t ubifs -o defaults; then + mkdir -p "${altVarMount}"/persist/etc + fi + fi + fi +} + +remount_ubi() { + bmcmtd="$(findmtd "bmc")" + altbmcmtd="$(findmtd "alt-bmc")" + mtds="${bmcmtd: -1}","${altbmcmtd: -1}" + + IFS=',' read -r -a mtds <<< "$mtds" + mtds=($(echo "${mtds[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + for mtd in ${mtds[@]}; do + # Get information on all ubi volumes + ubinfo=$(ubinfo -d ${mtd}) + presentVolumes=${ubinfo##*:} + IFS=', ' read -r -a array <<< "$presentVolumes" + for element in ${array[@]}; do + elementProperties=$(ubinfo -d $mtd -n $element) + # Get ubi volume name by getting rid of additional properties + name=${elementProperties#*Name:} + name="${name%Character*}" + name="$(echo -e "${name}" | tr -d '[:space:]')" + + if [[ ${name} == rofs-* ]]; then + mountdir="/media/${name}" + + if [ ! -d ${mountdir} ]; then + mkdir -p "${mountdir}" + # U-Boot will create the ubiblock for the running version, but not + # for the version on the other chip + if [ ! -e "/dev/ubiblock${mtd}_${element}" ]; then + ubiblock --create /dev/ubi${mtd}_${element} + fi + mount -t squashfs -o ro "/dev/ubiblock${mtd}_${element}" "${mountdir}" + fi + fi + done + done + + set_wdt2bite +} + +# Read the current env variable and set it on the alternate boot env +copy_env_var_to_alt() { + varName=$1 + value="$(fw_printenv -n "${varName}")" + fw_setenv -c /etc/alt_fw_env.config "${varName}" "${value}" +} + +# When the alternate bmc chip boots, u-boot thinks its the primary mtdX. +# Therefore need to swap the chip numbers when copying the ubiblock and root to +# alternate bmc u-boot environment. +copy_ubiblock_to_alt() { + value="$(fw_printenv -n ubiblock)" + bmcNum="$(findmtdnum "bmc")" + altNum="$(findmtdnum "alt-bmc")" + replaceAlt="${value/${altNum},/${bmcNum},}" + + if [[ "${value}" == "${replaceAlt}" ]]; then + replaceBmc="${value/${bmcNum},/${altNum},}" + value=${replaceBmc} + else + value=${replaceAlt} + fi + + fw_setenv -c /etc/alt_fw_env.config ubiblock "${value}" +} + +copy_root_to_alt() { + value="$(fw_printenv -n root)" + bmcNum="$(findmtdnum "bmc")" + altNum="$(findmtdnum "alt-bmc")" + replaceAlt="${value/${altNum}_/${bmcNum}_}" + + if [[ "${value}" == "${replaceAlt}" ]]; then + replaceBmc="${value/${bmcNum}_/${altNum}_}" + value=${replaceBmc} + else + value=${replaceAlt} + fi + + fw_setenv -c /etc/alt_fw_env.config root "${value}" +} + +ubi_setenv() { + # The U-Boot environment maintains two banks of environment variables. + # The banks need to be consistent with each other to ensure that these + # variables can reliably be read from file. In order to guarantee that the + # banks are both correct, we need to run fw_setenv twice. + variable=$1 + if [[ "$variable" == *"="* ]]; then + varName="${variable%=*}" + value="${variable##*=}" + # Write only if var is not set already to the requested value + currentValue="$(fw_printenv -n "${varName}" 2>/dev/null)" || true + if [[ "${currenValue}" != "${value}" ]]; then + fw_setenv "$varName" "$value" + fw_setenv "$varName" "$value" + fi + else + fw_setenv "$variable" + fw_setenv "$variable" + fi +} + +mtd_write() { + flashmtd="$(findmtd "${reqmtd}")" + img="/tmp/images/${version}/${imgfile}" + flashcp -v ${img} /dev/${flashmtd} +} + +backup_env_vars() { + copy_env_var_to_alt kernelname + copy_ubiblock_to_alt + copy_root_to_alt +} + +update_env_vars() { + vol="$(findubi rofs-"${version}")" + if [ -z "${vol}" ]; then + return 1 + fi + ubidevid="${vol#ubi}" + block="/dev/ubiblock${ubidevid}" + if [ ! -e "${block}" ]; then + return 1 + fi + ubi_setenv "kernelname=kernel-${version}" + ubi_setenv "ubiblock=$(echo "${ubidevid}" | sed 's/_/,/')" + ubi_setenv "root=${block}" +} + +#TODO: Replace the implementation with systemd-inhibitors lock +# once systemd/systemd#949 is resolved +rebootguardenable() { + dir="/run/systemd/system/" + file="reboot-guard.conf" + units=("reboot" "poweroff" "halt") + + for unit in "${units[@]}"; do + mkdir -p ${dir}${unit}.target.d + echo -e "[Unit]\nRefuseManualStart=yes" >> ${dir}${unit}.target.d/${file} + done +} + +#TODO: Replace the implementation with systemd-inhibitors lock +# once systemd/systemd#949 is resolved +rebootguarddisable() { + dir="/run/systemd/system/" + file="reboot-guard.conf" + units=("reboot" "poweroff" "halt") + + for unit in "${units[@]}"; do + rm -rf ${dir}${unit}.target.d/${file} + done +} + +# Create a copy in the alt mtd +create_vol_in_alt() { + alt="alt-bmc" + altmtd="$(findmtd "${alt}")" + if [ ! -z "${altmtd}" ]; then + reqmtd="${alt}" + reqmtd2="${alt}" + ubi_ro + ubi_updatevol + fi +} + +# Copy contents of one MTD device to another +mtd_copy() { + in=$1 + out=$2 + + # Must erase MTD first to prevent corruption + flash_eraseall "${out}" + dd if="${in}" of="${out}" +} + +mirroruboot() { + bmc="$(findmtd "u-boot")" + bmcdev="/dev/${bmc}" + alt="$(findmtd "alt-u-boot")" + altdev="/dev/${alt}" + + checksum_bmc="$(md5sum "${bmcdev}")" + checksum_bmc="${checksum_bmc% *}" + checksum_alt="$(md5sum "${altdev}")" + checksum_alt="${checksum_alt% *}" + + if [[ "${checksum_bmc}" != "${checksum_alt}" ]]; then + bmcenv="$(findmtd "u-boot-env")" + bmcenvdev="/dev/${bmcenv}" + altenv="$(findmtd "alt-u-boot-env")" + altenvdev="/dev/${altenv}" + + echo "Mirroring U-boot to alt chip" + mtd_copy "${bmcdev}" "${altdev}" + mtd_copy "${bmcenvdev}" "${altenvdev}" + + copy_ubiblock_to_alt + copy_root_to_alt + fi +} + +case "$1" in + mtduboot) + reqmtd="$2" + version="$3" + imgfile="image-u-boot" + mtd_write + ;; + ubirw) + reqmtd="$2" + name="$3" + imgsize="$4" + ubi_rw + ;; + ubiro) + reqmtd="$(echo "$2" | cut -d "+" -f 1)" + reqmtd2="$(echo "$2" | cut -d "+" -f 2)" + name="$3" + version="$4" + imgfile="image-rofs" + ubi_ro + ubi_updatevol + ubi_block + ;; + ubikernel) + reqmtd="$(echo "$2" | cut -d "+" -f 1)" + reqmtd2="$(echo "$2" | cut -d "+" -f 2)" + name="$3" + version="$4" + imgfile="image-kernel" + ubi_ro + ubi_updatevol + create_vol_in_alt + ;; + ubiremove) + name="$2" + ubi_remove "${name}" + ;; + ubicleanup) + ubi_cleanup + ;; + ubisetenv) + ubi_setenv "$2" + ;; + ubiremount) + remount_ubi + mount_alt_rwfs + ;; + createenvbackup) + backup_env_vars + ;; + updateubootvars) + version="$2" + update_env_vars + ;; + rebootguardenable) + rebootguardenable + ;; + rebootguarddisable) + rebootguarddisable + ;; + mirroruboot) + mirroruboot + ;; + *) + echo "Invalid argument" + exit 1 + ;; +esac diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service new file mode 100644 index 000000000..f8c9135a1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service @@ -0,0 +1,9 @@ +[Unit] +Description=Clean up UBI volumes unattached to a BMC version after DeleteAll + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStartPre=/usr/bin/env obmc-flash-bmc createenvbackup +ExecStart=/usr/bin/env obmc-flash-bmc ubicleanup +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service new file mode 100644 index 000000000..361dd61cd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service @@ -0,0 +1,8 @@ +[Unit] +Description=Copy uboot from the currently booted bmc chip to the alternate chip + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc mirroruboot +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service new file mode 100644 index 000000000..73b55d4f3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Set U-Boot environment variable + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubisetenv %I +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service new file mode 100644 index 000000000..388bb1a0d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service @@ -0,0 +1,15 @@ +[Unit] +Description=Remount the ubi volume after a reboot +Wants=xyz.openbmc_project.Software.BMC.Updater.service +Before=xyz.openbmc_project.Software.BMC.Updater.service +Wants=obmc-flash-bmc-setenv@rwreset.service +After=obmc-flash-bmc-setenv@rwreset.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremount +SyslogIdentifier=obmc-flash-bmc + +[Install] +WantedBy=multi-user.target diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service new file mode 100644 index 000000000..42aa026b9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service @@ -0,0 +1,9 @@ +[Unit] +Description=Deletes read-only and kernel ubi volume %I + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rofs-%i +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove kernel-%i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service new file mode 100644 index 000000000..5cd8565f5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Store read-only images %I to BMC storage +OnFailure=obmc-flash-bmc-ubiro-remove@%i.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStartPre=/usr/bin/env obmc-flash-bmc createenvbackup +ExecStart=/usr/bin/env obmc-flash-bmc ubiro {RO_MTD} rofs-%i %i +ExecStart=/usr/bin/env obmc-flash-bmc ubikernel {KERNEL_MTD} kernel-%i %i +ExecStart=/usr/bin/env obmc-flash-bmc mtduboot u-boot %i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service new file mode 100644 index 000000000..68c4ab256 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service @@ -0,0 +1,8 @@ +[Unit] +Description=Deletes BMC read-write ubi volume + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rwfs +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service new file mode 100644 index 000000000..79d0ea387 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service @@ -0,0 +1,8 @@ +[Unit] +Description=Create BMC read-write ubi volume + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubirw {RW_MTD} rwfs {RW_SIZE} +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service new file mode 100644 index 000000000..bab0b0297 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service @@ -0,0 +1,8 @@ +[Unit] +Description= Updates the u-boot variable to point BMC version to %I + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc updateubootvars %i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service new file mode 100644 index 000000000..b09df99d3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service @@ -0,0 +1,8 @@ +[Unit] +Description=Removes the guard that blocks BMC reboot + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc rebootguarddisable +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service new file mode 100644 index 000000000..4405e3dbb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service @@ -0,0 +1,8 @@ +[Unit] +Description=Enable a guard that blocks BMC reboot + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc rebootguardenable +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf new file mode 100644 index 000000000..09ecd92e4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf @@ -0,0 +1,3 @@ +# /tmp/images is the software image upload directory +# It should not be deleted if the UBI code update is used. +x /tmp/images diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist new file mode 100644 index 000000000..8213ce6a0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist @@ -0,0 +1,11 @@ +/etc/dropbear/ +/etc/group +/etc/gshadow +/etc/hostname +/etc/machine-id +/etc/passwd +/etc/shadow +/etc/ssl/ +/etc/ssl/certs/nginx/ +/etc/ssl/private/ +/etc/systemd/network/ diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount new file mode 100644 index 000000000..7aa2cf656 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount @@ -0,0 +1,7 @@ +[Unit] +Description=/usr/local + +[Mount] +What=tmpfs +Where=/usr/local +Type=tmpfs diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service new file mode 100644 index 000000000..ef1a1c434 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service @@ -0,0 +1,16 @@ +[Unit] +Description=OpenBMC Software Update Manager +Wants=xyz.openbmc_project.Software.Version.service +Before=xyz.openbmc_project.Software.Version.service +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-image-updater +SyslogIdentifier=phosphor-image-updater +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service new file mode 100644 index 000000000..a4934f865 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Download Manager + +[Service] +ExecStart=/usr/bin/env phosphor-download-manager +SyslogIdentifier=phosphor-download-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service new file mode 100644 index 000000000..1ff33a2fe --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Sync Manager that syncs files to the alternate BMC chip + +[Service] +ExecStart=/usr/bin/env phosphor-sync-software-manager +SyslogIdentifier=phosphor-sync-software-manager +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service new file mode 100644 index 000000000..0141245b2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Version Software Manager + +[Service] +ExecStartPre=/bin/sh -c 'mkdir -p /tmp/images' +ExecStart=/usr/bin/env phosphor-version-software-manager +SyslogIdentifier=phosphor-version-software-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} |