Skip to content
Snippets Groups Projects
Commit 027a078c authored by Zbigniew Bodek's avatar Zbigniew Bodek
Browse files

Introduce initial recipe for Softbus


Softbus implements "Distributed Communication Subsystem".
This commit provides initial recipe to build softbus
using bitbake and link it to the foundation application.

The functionality hasn't been tested (only build) so when
Softbus is actually used some missing bits may appear.

Signed-off-by: default avatarZbigniew Bodek <zbigniew.bodek@huawei.com>
parent fa1c1e3c
No related branches found
No related tags found
No related merge requests found
SUMMARY = "OHOS interface kits for Softbus"
DESCRIPTION = "Interface kits for OHOS communication utility - Softbus"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec"
SRC_URI = "git://gitee.com/openharmony/communication_interfaces_kits_softbuskit_lite.git;protocol=https"
PV = "1.0+git${SRCPV}"
SRCREV = "40aec6fdcdeed401adc97451434b26919e80c69a"
S = "${WORKDIR}/git"
do_install () {
install -d ${D}${includedir}
install -m 0755 ${S}/discovery/*.h ${D}${includedir}/
install -m 0755 ${S}/transport/*.h ${D}${includedir}/
}
...@@ -3,7 +3,7 @@ DESCRIPTION = "OHOS foundation main application" ...@@ -3,7 +3,7 @@ DESCRIPTION = "OHOS foundation main application"
LICENSE = "Apache-2.0" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec" LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec"
DEPENDS += "utils-native-lite libsec hiviewdfx-innerkits-hilog hiviewdfx-hilog samgr samgr-kits" DEPENDS += "utils-native-lite libsec hiviewdfx-innerkits-hilog hiviewdfx-hilog samgr samgr-kits softbus"
SRC_URI = "git://gitee.com/openharmony/distributedschedule_services_safwk_lite.git;protocol=https" SRC_URI = "git://gitee.com/openharmony/distributedschedule_services_safwk_lite.git;protocol=https"
...@@ -17,7 +17,7 @@ CFLAGS += "-DDEBUG_SERVICES_SAFWK_LITE" ...@@ -17,7 +17,7 @@ CFLAGS += "-DDEBUG_SERVICES_SAFWK_LITE"
LDFLAGS += "-lrt" LDFLAGS += "-lrt"
do_compile () { do_compile () {
${CC} ${CFLAGS} ${LDFLAGS} src/*.c -o ${B}/foundation -lsamgr -lsec -lhiviewdfx-hilog ${CC} ${CFLAGS} ${LDFLAGS} src/*.c -o ${B}/foundation -lsamgr -lsec -lhiviewdfx-hilog -lsoftbus
} }
do_install () { do_install () {
......
From d1b564ce1c294be4752204bad8261316b8e56ba1 Mon Sep 17 00:00:00 2001
From: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Date: Thu, 31 Dec 2020 16:24:24 +0000
Subject: [PATCH] Fix incorrect number of arguments to mq_open()
Related issue:
https://gitee.com/openharmony/communication_services_softbus_lite/issues/I2BBKX
According to man:
If O_CREAT is specified in oflag, then two additional arguments
must be supplied.
os_adapter.c is missing "mode" parameter in mq_open(). It will compile
for MUSL, which does not check the number of arguments passed through
variadic argument but it doesn't mean it works as designed.
Fix this issue as well as build for other libraries with built-in
checks by introducing missing "mode" argument.
File mode has been selected to 0600 (RW for owner) but is a subject
to change if needed.
Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
---
os_adapter/source/L1/os_adapter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/os_adapter/source/L1/os_adapter.c b/os_adapter/source/L1/os_adapter.c
index 98f91c9..9eb693a 100755
--- a/os_adapter/source/L1/os_adapter.c
+++ b/os_adapter/source/L1/os_adapter.c
@@ -79,7 +79,9 @@ int CreateMsgQue(const char *queueName,
newAttr.mq_flags = flags;
newAttr.mq_maxmsg = len;
newAttr.mq_msgsize = maxMsgSize;
- int mqd = mq_open(queueName, O_RDWR | O_CREAT, &newAttr);
+ /* Owner read and write permission - 0600 */
+ mode_t mode = (S_IRUSR | S_IWUSR);
+ int mqd = mq_open(queueName, O_RDWR | O_CREAT, mode, &newAttr);
if (mqd < 0) {
return -1;
}
SUMMARY = "OHOS Softbus"
DESCRIPTION = "OHOS communication utility for distributed services"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec"
DEPENDS += "cjson libsec samgr softbus-kits iam-kits hichainsdk hichainsdk-innerkits mbedtls"
SRC_URI = "git://gitee.com/openharmony/communication_services_softbus_lite.git;protocol=https \
file://0001-Fix-incorrect-number-of-arguments-to-mq_open.patch \
"
PV = "1.0+git${SRCPV}"
PVSHORT = '${@d.getVar("PV", False).split("+")[0]}'
PVMAJOR = '${@d.getVar("PV", False).split(".")[0]}'
SRCREV = "b3f7261e31d0be165979446fef4a6c415cc03f65"
S = "${WORKDIR}/git"
SB_SRCS = "${S}/discovery/coap/source/coap_discover.c \
${S}/discovery/coap/source/json_payload.c \
${S}/discovery/coap/source/nstackx_common.c \
${S}/discovery/coap/source/nstackx_device.c \
${S}/discovery/coap/source/coap_socket.c \
${S}/discovery/coap/source/coap_adapter.c \
${S}/os_adapter/source/L1/os_adapter.c \
${S}/discovery/discovery_service/source/discovery_service.c \
${S}/discovery/discovery_service/source/coap_service.c \
${S}/discovery/discovery_service/source/common_info_manager.c \
${S}/trans_service/source/libdistbus/tcp_session.c \
${S}/trans_service/source/libdistbus/tcp_session_manager.c \
${S}/trans_service/source/libdistbus/auth_conn_manager.c \
${S}/trans_service/source/libdistbus/trans_lock.c \
${S}/trans_service/source/utils/tcp_socket.c \
${S}/trans_service/source/utils/message.c \
${S}/trans_service/source/utils/aes_gcm.c \
${S}/authmanager/source/auth_conn.c \
${S}/authmanager/source/auth_interface.c \
${S}/authmanager/source/msg_get_deviceid.c \
${S}/authmanager/source/wifi_auth_manager.c \
${S}/authmanager/source/bus_manager.c"
SB_INC = "-I${S}/discovery/coap/include \
-I${S}/os_adapter/include \
-I${S}/discovery/discovery_service/include \
-I${S}/authmanager/include \
-I${S}/trans_service/include/libdistbus \
-I${S}/trans_service/include/utils \
-I${S}/trans_service/source/libdistbus \
-I${S}/trans_service/source/utils"
SB_INC += "-I${STAGING_INCDIR}/cjson"
CFLAGS_SB = "${CFLAGS} ${SB_INC} -fPIC -shared"
# Flags copied from the original OHOS build configuration. To be replaced.
CFLAGS_SB += "-D_GNU_SOURCE -D_SCANTY_MEMORY_ -D__LINUX__"
LDFLAGS_SB = "${LDFLAGS} -lsec -lcjson -lrt -L${B} -Wl,-soname,lib${PN}.so.${PVMAJOR}"
do_compile () {
${CC} ${CFLAGS_SB} ${LDFLAGS_SB} \
${SB_SRCS} \
-o ${B}/lib${PN}.so.${PVSHORT}
}
do_install () {
install -d ${D}${libdir}
oe_soinstall ${B}/lib${PN}.so.${PVSHORT} ${D}${libdir}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment