blob: 3a136140d187b357ee9b192dec75cfb12394b782 [file]
SUMMARY = "Google Hoth Daemon"
DESCRIPTION = "Google Hoth Daemon"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
PACKAGECONFIG ??= ""
PACKAGECONFIG[usb] = "-Dusb=enabled,-Dusb=disabled,libusb1 libhoth,libusb1 libhoth"
PACKAGECONFIG[spi] = "-Dspi=enabled,-Dspi=disabled, libhoth, libhoth"
inherit meson pkgconfig systemd useradd
inherit python3native
DEPENDS += "${PYTHON_PN}-sdbus++-native"
DEPENDS += "sdbusplus"
DEPENDS += "stdplus"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "phosphor-logging"
DEPENDS += "boost"
DEPENDS += "fmt"
DEPENDS += "cli11"
DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'usb', ' i2c-tools', '', d)}"
EXTRA_OEMESON += "-Dtests=disabled"
S = "${WORKDIR}/git"
SRC_URI ="git://gbmc.googlesource.com/hothd;protocol=https;branch=master"
SRCREV = "65115af1b5f04568f670279a5cba5ad6e59c2df8"
PACKAGES += "${PN}-hothd ${PN}-hothd-usb ${PN}-tools"
USERADD_PACKAGES = "${PN}-hothd"
USERADD_PARAM:${PN}-hothd = "-r -d / -M -s /sbin/nologin hothd"
SYSTEMD_PACKAGES = "${PN}-hothd ${PN}-hothd-usb"
SYSTEMD_SERVICE:${PN}-hothd += "hothd.service"
SYSTEMD_SERVICE:${PN}-hothd-usb += "${@bb.utils.contains('PACKAGECONFIG', 'usb', ' hothd-usb@.service google_secured_nvme_usb_reset.service', '', d)}"
RDEPENDS:${PN} = "${PN}-hothd ${PN}-hothd-usb ${PN}-tools"
RDEPENDS:${PN}-hothd-usb:append = "${@bb.utils.contains('PACKAGECONFIG', 'usb', ' bash', '', d)}"
LIB_UDEV_RULESD_DIR = "${libdir}/udev/rules.d"
FILES:${PN} = ""
ALLOW_EMPTY:${PN} = "1"
FILES:${PN}-hothd += " \
${systemd_system_unitdir}/hothd.service.d \
${libexecdir}/hothd \
${datadir}/dbus-1/system.d/hothd.conf \
${LIB_UDEV_RULESD_DIR}/70-hothd.rules \
${libdir}/libhothd* \
"
FILES:${PN}-hothd-usb += " \
${systemd_system_unitdir}/hothd-usb@*.service.d \
${libexecdir}/hothd_usb.sh \
${libexecdir}/google_secured_nvme_usb_reset \
${LIB_UDEV_RULESD_DIR}/70-hothd-usb.rules \
"
FILES:${PN}-tools += " \
${bindir}/hoth_updater \
${bindir}/payload_update \
"
# Block legacy verify commands for non-legacy SPI flash sizes
do_install:append() {
if [ '${FLASH_SIZE}' -gt 32768 ]; then
sed -i 's,/hothd,/hothd -b,' ${D}${systemd_system_unitdir}/hothd.service
fi
if ${@bb.utils.contains('PACKAGECONFIG', 'spi', 'true', 'false', d)}; then
rm -f ${D}${LIB_UDEV_RULESD_DIR}/70-hothd.rules
cp ${S}/70-hothd-spi.rules ${D}${LIB_UDEV_RULESD_DIR}/70-hothd.rules
fi
}