diff --git a/recipes-connectivity/avahi/avahi/hdc.service b/recipes-connectivity/avahi/avahi/hdc.service new file mode 100644 index 0000000000000000000000000000000000000000..789bc192fdd7171463498bb702e6a8ce53cb26fd --- /dev/null +++ b/recipes-connectivity/avahi/avahi/hdc.service @@ -0,0 +1,9 @@ +<?xml version="1.0" standalone='no'?><!--*-nxml-*--> +<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> +<service-group> +<name replace-wildcards="yes">OpenHarmony Device Connector on %h</name> +<service> +<type>_workstation._tcp</type> +<port>35000</port> +</service> +</service-group> diff --git a/recipes-connectivity/avahi/avahi_%s.bbappend b/recipes-connectivity/avahi/avahi_%s.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b189d3f5499460c34047ad83dd348715a9f7f9d9 --- /dev/null +++ b/recipes-connectivity/avahi/avahi_%s.bbappend @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = "file://hdc.service" + +do_install:append () { + install -d ${D}${sysconfdir}/avahi/services/ + install -m 0644 -g avahi ${WORKDIR}/hdc.service ${D}${sysconfdir}/avahi/services/hdc.service +} diff --git a/recipes-openharmony/images/openharmony-standard-image.bb b/recipes-openharmony/images/openharmony-standard-image.bb index 2cb597a6b3936be9ad8a6d6813eaa5b47d01585d..7f67818da61790272ccec5ed63df0fb4ff4a75ed 100644 --- a/recipes-openharmony/images/openharmony-standard-image.bb +++ b/recipes-openharmony/images/openharmony-standard-image.bb @@ -13,3 +13,6 @@ IMAGE_INSTALL += "openharmony-standard" # Let's be friendly enough to provide a fully working interactive shell IMAGE_INSTALL += "bash" + +# Provide avahi and a DNS-SD service file to discover the HDC service +IMAGE_INSTALL += "avahi-daemon"