blob: 34638f03c34249decc9c11a9e4aac4edcfb91cb4 [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 = "8c5ffcf12b4f687a21d40de6a5a7d0e435f1e180"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "-r -d / -M -s /sbin/nologin hothd"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} += "hothd.service"
SYSTEMD_SERVICE:${PN}:append = "${@bb.utils.contains('PACKAGECONFIG', 'usb', ' hothd-usb@.service google_secured_nvme_usb_reset.service', '', d)}"
RDEPENDS:${PN}:append = "${@bb.utils.contains('PACKAGECONFIG', 'usb', ' bash', '', d)}"
FILES:${PN} += "${datadir}/dbus-1/system.d/hothd.conf"
LIB_UDEV_RULESD_DIR = "${libdir}/udev/rules.d"
# 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
}