| SUMMARY = "gBMC True Hitless Update Support" |
| DESCRIPTION = "Provides systemd targets and services for true hitless updates, including eMMC availability detection, postprocessing scripts, and initialization." |
| LICENSE = "CLOSED" |
| LIC_FILES_CHKSUM = "" |
| |
| SRC_URI = " \ |
| file://emmc-available-postprocessing.service \ |
| file://emmc-unavailable-postprocessing.service \ |
| file://emmc-true-hitless-enable.sh \ |
| file://emmc-true-hitless-disable.sh \ |
| file://true-hitless-initialize.service \ |
| file://true-hitless-initialize.sh \ |
| file://true-hitless-status-update.service \ |
| file://true-hitless-status-update.sh \ |
| file://true-hitless-status-default.json \ |
| file://true-hitless-version-check.sh \ |
| file://block-override.conf \ |
| file://emmc-services-restart.service \ |
| file://emmc-services-restart.sh \ |
| file://true-hitless-exec-wrapper.sh \ |
| " |
| |
| S = "${WORKDIR}" |
| |
| # To find the files in ${BPN}/ subdirectory |
| FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" |
| |
| inherit systemd |
| |
| DEPENDS += " systemd" |
| RDEPENDS:${PN}:append = " bash" |
| |
| SYSTEMD_PACKAGES = "${PN}" |
| SYSTEMD_SERVICE:${PN} = " \ |
| emmc-available-postprocessing.service \ |
| emmc-unavailable-postprocessing.service \ |
| true-hitless-initialize.service \ |
| true-hitless-status-update.service \ |
| emmc-services-restart.service \ |
| " |
| SYSTEMD_AUTO_ENABLE = "enable" |
| |
| FILES:${PN} += "${libdir}/true-hitless" |
| |
| do_install() { |
| # Replace placeholders with actual values in scripts |
| if [ -z "${MACHINE}" ]; then |
| bbfatal "MACHINE variable is not set" |
| fi |
| sed -i -e 's|@MACHINE@|${MACHINE}|g' ${S}/emmc-true-hitless-enable.sh |
| sed -i -e 's|@MACHINE@|${MACHINE}|g' ${S}/emmc-true-hitless-disable.sh |
| sed -i -e 's|@MACHINE@|${MACHINE}|g' ${S}/true-hitless-status-update.sh |
| |
| # Install systemd targets and services to /usr/lib/systemd/system (systemd_system_unitdir) |
| install -d ${D}${systemd_system_unitdir} |
| install -m 0644 ${S}/emmc-available-postprocessing.service ${D}${systemd_system_unitdir} |
| install -m 0644 ${S}/emmc-unavailable-postprocessing.service ${D}${systemd_system_unitdir} |
| install -m 0644 ${S}/true-hitless-initialize.service ${D}${systemd_system_unitdir} |
| install -m 0644 ${S}/true-hitless-status-update.service ${D}${systemd_system_unitdir} |
| install -m 0644 ${S}/emmc-services-restart.service ${D}${systemd_system_unitdir} |
| |
| # Install scripts to /usr/bin (bindir) |
| # when adding new script here, please check if it needs to be added in msv as well |
| install -d ${D}${bindir} |
| install -m 0755 ${S}/emmc-true-hitless-enable.sh ${D}${bindir} |
| install -m 0755 ${S}/emmc-true-hitless-disable.sh ${D}${bindir} |
| install -m 0755 ${S}/true-hitless-initialize.sh ${D}${bindir} |
| install -m 0755 ${S}/true-hitless-status-update.sh ${D}${bindir} |
| install -m 0755 ${S}/true-hitless-version-check.sh ${D}${bindir} |
| install -m 0755 ${S}/emmc-services-restart.sh ${D}${bindir} |
| |
| # Install wrapper script |
| install -m 0755 ${S}/true-hitless-exec-wrapper.sh ${D}${bindir} |
| |
| # Install block-override.conf template to /usr/lib/true-hitless |
| install -d ${D}${libdir}/true-hitless |
| install -m 0644 ${S}/block-override.conf ${D}${libdir}/true-hitless |
| install -m 0644 ${S}/true-hitless-status-default.json ${D}${libdir}/true-hitless |
| } |