From 764924655f0f12cf2d4232aff6fc50257cb60ab8 Mon Sep 17 00:00:00 2001
From: Thierry Escande <thierry.escande@huawei.com>
Date: Wed, 10 Aug 2022 14:15:59 +0200
Subject: [PATCH] openharmony-standard-3.0: Add installs service

Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
---
 .../openharmony/files/installs.service              | 13 +++++++++++++
 .../openharmony/files/installs.service.license      |  3 +++
 .../openharmony/openharmony-standard_3.0.bb         |  8 ++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 recipes-openharmony/openharmony/files/installs.service
 create mode 100644 recipes-openharmony/openharmony/files/installs.service.license

diff --git a/recipes-openharmony/openharmony/files/installs.service b/recipes-openharmony/openharmony/files/installs.service
new file mode 100644
index 00000000..8de5e169
--- /dev/null
+++ b/recipes-openharmony/openharmony/files/installs.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OpenHarmony Installs service
+Requires=samgr.service
+After=samgr.service
+
+[Service]
+Type=exec
+# Delay execution by 2 secs after samgr.service
+ExecStartPre=/bin/sleep 2
+ExecStart=/usr/bin/installs
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-openharmony/openharmony/files/installs.service.license b/recipes-openharmony/openharmony/files/installs.service.license
new file mode 100644
index 00000000..98a0b3f4
--- /dev/null
+++ b/recipes-openharmony/openharmony/files/installs.service.license
@@ -0,0 +1,3 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
index a114185f..ac628db5 100644
--- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
+++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
@@ -458,6 +458,14 @@ RDEPENDS:${PN}-ptest += "${PN}-appspawn-ptest"
 
 # //foundation/appexecfwk/standard component
 PACKAGES =+ "${PN}-appexecfwk"
+SYSTEMD_PACKAGES += "${PN}-appexecfwk"
+SYSTEMD_SERVICE:${PN}-appexecfwk = "installs.service"
+SRC_URI += "file://installs.service"
+do_install:append() {
+    install -d ${D}/${systemd_unitdir}/system
+    install -m 644 ${WORKDIR}/installs.service ${D}${systemd_unitdir}/system/
+    rm -f ${D}${sysconfdir}/openharmony/init/installs.cfg
+}
 FILES:${PN}-appexecfwk = "\
     ${bindir}/appexec \
     ${bindir}/bm \
-- 
GitLab