Enable HAILO_BUILD_SERVICE (hailort.service) for yocto images got error

I edit meta-hailo-libhailort/classes/hailort-base.bbclass, added in -DHAILO_BUILD_SERVICE=ON

HAILO_BUILD_SERVICE = "ON"
EXTRA_OECMAKE =  "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${LIB_SRC_DIR} \
                  -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${BIN_SRC_DIR} \
                  -DCMAKE_BUILD_TYPE=${HAILORT_BUILD_TYPE}        \
                  -DHAILO_BUILD_SERVICE=${HAILO_BUILD_SERVICE}  \
                  -DCMAKE_SKIP_RPATH=ON"

I edited recipes-hailo/libhailort/libhailort_4.14.0.bb

inherit hailort-base systemd

SYSTEMD_AUTO_ENABLE = "enable"
OECMAKE_TARGET_COMPILE = "libhailort"
HAILORT_INCLUDE_STAGING_DIR = "${D}${includedir}/hailort"

do_install:append() {
  install -d ${D}${libdir}
  install -m 0755 ${LIB_SRC_DIR}/libhailort.so.${PV} ${D}${libdir}
  ln -s -r ${D}${libdir}/libhailort.so.${PV} ${D}${libdir}/libhailort.so
  install -d ${D}${systemd_system_unitdir}
  install -m 0644 ${S}/hailort/hailort_service/hailort.service ${D}${systemd_system_unitdir}
  install -d ${HAILORT_INCLUDE_STAGING_DIR}
  cp -r ${S}/hailort/libhailort/include/* ${HAILORT_INCLUDE_STAGING_DIR}/
}

SYSTEMD_SERVICE:${PN} = "hailort.service"

Got this error when systemctl hailort.service start

Hi Hieu,

Currently we don’t support hailort service over yocto, but I will look into it and check if I can assist.

Fixed it by adding into libhailort_4.14.0.bb

  install -d ${D}${bindir}
  install -m 0755 ${BIN_SRC_DIR}/hailort_service ${D}${bindir}

Posted it here for other reference!

1 Like

Hi Hieu,

Thank you for the update.