diff --git a/recipes-openharmony/openharmony/files/foundation.service b/recipes-openharmony/openharmony/files/foundation.service index 65f27a109d105ddcbde1375c495e55be94dc65b8..6231a3012137288b522fc2fc099c915c004e859e 100644 --- a/recipes-openharmony/openharmony/files/foundation.service +++ b/recipes-openharmony/openharmony/files/foundation.service @@ -1,10 +1,32 @@ [Unit] -Description=OpenHarmony foundation service +Description=OpenHarmony foundation service (SA: 180 182 401 403 501 3203 3299 3301 3302 3308 3501 3702 4010 4802) +Requires=samgr.service +After=samgr.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +# Requires SA: 4700 +Wants=dsoftbus.service +# Requires SA: 4701 +Wants=deviceauth.service +# Requires SA: 511 +Wants=installs.service +# Requires SA: 3510 +Wants=huks.service +# Requires SA: 1301 +Wants=distributed_data.service +# Requires SA: 3202 5001 -- but from where? [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony foundation Service" -RemainAfterExit=yes +Type=notify +Environment="XDG_RUNTIME_DIR=/data/weston" +Environment="XKB_CONFIG_ROOT=/etc/openharmony/xkb" +Environment="XKB_CONFIG_EXTRA_PATH=/etc/openharmony/xkb" +User=system +Group=system +CapabilityBoundingSet=CAP_SYS_PTRACE CAP_KILL +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/foundation.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/foundation.service.license b/recipes-openharmony/openharmony/files/foundation.service.license new file mode 100644 index 0000000000000000000000000000000000000000..98a0b3f4a5b8db268215a128c7d06e0a10897e73 --- /dev/null +++ b/recipes-openharmony/openharmony/files/foundation.service.license @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 diff --git a/recipes-openharmony/openharmony/files/openharmony-preinit b/recipes-openharmony/openharmony/files/openharmony-preinit index 365b8a3fedb71ade6c27d0e6623af4e819596105..191772c8c21f92465979c487d8440a437550e85b 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit +++ b/recipes-openharmony/openharmony/files/openharmony-preinit @@ -136,19 +136,6 @@ fi #sa_main /system/profile/dps_service.xml & # SA: 1401 180 3502 #sleep "$STARTUP_CMD_SLEEP" -# trigger: boot -# "name" : "foundation", -# "path" : ["/system/bin/sa_main", "/system/profile/foundation.xml"], -# "importance" : -20, -# "uid" : "system", -# "gid" : ["system"], -# "caps" : ["SYS_PTRACE", "KILL"] -if systemctl -q is-enabled foundation.service; then - echo >/dev/console "Starting OpenHarmony foundation service" - su system -c '/system/bin/sa_main /system/profile/foundation.xml &' # SA: 180 182 3203 3299 3301 3308 3501 4010 | Required SA: 4700 - sleep "$STARTUP_CMD_SLEEP" -fi - # trigger: boot # "name" : "media_service", # "path" : ["/system/bin/sa_main", "/system/profile/media_service.xml"],