diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/samgr-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/samgr-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..caec79db5bc6fab822b131c1842bc1a729e51753 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/samgr-sd-notify.patch @@ -0,0 +1,36 @@ +diff --git a/services/samgr/native/BUILD.gn b/services/samgr/native/BUILD.gn +index 9b7e4a4e6301..48c512f430e6 100755 +--- a/services/samgr/native/BUILD.gn ++++ b/services/samgr/native/BUILD.gn +@@ -67,6 +67,7 @@ ohos_executable("samgr") { + "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", + "//utils/native/base:utils", + ] ++ libs = [ "systemd" ] + + configs = [ + ":sam_config", +diff --git a/services/samgr/native/source/sa_main.cpp b/services/samgr/native/source/sa_main.cpp +index 820b6b8d67f9..387abad8d8b8 100755 +--- a/services/samgr/native/source/sa_main.cpp ++++ b/services/samgr/native/source/sa_main.cpp +@@ -20,6 +20,8 @@ + #include "sam_log.h" + #include "system_ability_manager.h" + ++#include <systemd/sd-daemon.h> ++ + using namespace OHOS; + + int main(int argc, char *argv[]) +@@ -32,6 +34,8 @@ int main(int argc, char *argv[]) + IPCSkeleton::SetContextObject(serv); + + HILOGI("start System Ability Manager Loop"); ++ sd_notify(0, "READY=1"); + OHOS::IPCSkeleton::JoinWorkThread(); ++ sd_notify(0, "STOPPING=1"); + return -1; +-} +\ No newline at end of file ++} diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index db185e4cef11e2338f74a6e6fec03da11e8b5fb8..818ff5fcea00eee8f92596134b0fe60258623468 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -72,6 +72,8 @@ SRC_URI += "file://param_service-sd-notify.patch;patchdir=${S}/base/startup/init SRC_URI += "file://param-paths.patch;patchdir=${S}/base/startup/init_lite" SRC_URI += "file://param_service-Add-to-startup-l2-part.patch;patchdir=${S}/base/startup/appspawn_standard" +SRC_URI += "file://samgr-sd-notify.patch;patchdir=${S}/foundation/distributedschedule/samgr" + SRC_URI += "file://base_hiviewdfx_hiview-libfaultlogger-static.patch;patchdir=${S}/base/hiviewdfx/hiview" # Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony @@ -779,7 +781,7 @@ do_install:append() { install -m 644 ${WORKDIR}/samgr.service ${D}${systemd_unitdir}/system/ rm -f ${D}${sysconfdir}/openharmony/init/samgr_standard.cfg } -RDEPENDS:${PN}-samgr += "musl libcxx" +RDEPENDS:${PN}-samgr += "musl libcxx libsystemd" RDEPENDS:${PN}-samgr += "${PN}-hilog ${PN}-ipc ${PN}-libutils ${PN}-thirdparty-libxml2" RDEPENDS:${PN} += "${PN}-samgr"