diff --git a/recipes-openharmony/openharmony/files/media.service b/recipes-openharmony/openharmony/files/media.service index c592e01fbd5ecfa968085880f4927f9373080a98..837f0cfb01d3746f696bd5aaa887d69e432e3b57 100644 --- a/recipes-openharmony/openharmony/files/media.service +++ b/recipes-openharmony/openharmony/files/media.service @@ -1,10 +1,18 @@ [Unit] -Description=OpenHarmony media service +Description=OpenHarmony media service (SA: 3002) +Requires=samgr.service +After=samgr.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Media Service" -RemainAfterExit=yes +Type=notify +ExecStart=/usr/bin/sa_main /system/profile/media_service.xml +User=system +Group=media_rw +SupplementaryGroups=system +LimitNICE=40 [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/media.service.license b/recipes-openharmony/openharmony/files/media.service.license new file mode 100644 index 0000000000000000000000000000000000000000..98a0b3f4a5b8db268215a128c7d06e0a10897e73 --- /dev/null +++ b/recipes-openharmony/openharmony/files/media.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 191772c8c21f92465979c487d8440a437550e85b..bd0b8bd72f99965dd3190d19a7de29fca3193c4e 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit +++ b/recipes-openharmony/openharmony/files/openharmony-preinit @@ -136,17 +136,6 @@ fi #sa_main /system/profile/dps_service.xml & # SA: 1401 180 3502 #sleep "$STARTUP_CMD_SLEEP" -# trigger: boot -# "name" : "media_service", -# "path" : ["/system/bin/sa_main", "/system/profile/media_service.xml"], -# "uid" : "system", -# "gid" : ["media_rw", "system"] -if systemctl -q is-enabled media.service; then - echo >/dev/console "Starting OpenHarmony media service" - su system -c '/system/bin/sa_main /system/profile/media_service.xml &' - sleep "$STARTUP_CMD_SLEEP" -fi - # trigger: boot # "name" : "inputmethod_service", # "path" : ["/system/bin/sa_main", "/system/profile/inputmethod_service.xml"], diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index f61d5dd228ae3af43dd646551db9a1dabe945cb2..2ec718c1bf52894f4b2d2587ce70a4349f3e56e5 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -2035,6 +2035,7 @@ inherit useradd USERADD_PACKAGES = "${PN}" USERADD_PARAM:${PN} = "-u 1000 -U -s /bin/sh system" USERADD_PARAM:${PN}:append = ";-u 1007 -U -s /bin/false log" +USERADD_PARAM:${PN}:append = ";-u 1023 -U -s /bin/false media_rw" USERADD_PARAM:${PN}:append = ";-u 1036 -U -s /bin/false logd" USERADD_PARAM:${PN}:append = ";-u 2000 -U -s /bin/false shell" USERADD_PARAM:${PN}:append = ";-u 3009 -U -s /bin/false readproc"