diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27184d8508cc6e802b14eb9e555a77b5a19cb846..b040402f00b2791e1123fc3edb19852b4ae43cf8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -195,7 +195,7 @@ eca: - echo "RM_WORK_EXCLUDE += \"${RECIPE}\"" >> conf/auto.conf - echo "OPENHARMONY_VERSION = \"${OPENHARMONY_VERSION}\"" >> conf/auto.conf script: - - time bitbake "${RECIPE}" + - time bitbake ${RECIPE} after_script: # Update sstate-cache mirror - if [ -n "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE" -a -d build/sstate-cache ] ; then @@ -309,12 +309,9 @@ mirror_ch: fi ; done -# Build OpenHarmony images using normal CI runners -build: +# Build using normal CI runners +.build: stage: build - needs: - - job: fetch - artifacts: false rules: - if: $CHINA_CI != null # Don't use CI resources on normal builds when doing China builds @@ -323,15 +320,42 @@ build: extends: .bitbake after_script: - !reference [.bitbake, after_script] - - time repo/oe-core/scripts/pybootchartgui/pybootchartgui.py build/tmp-*/buildstats/* -o build/tmp-*/buildstats + - repo/oe-core/scripts/pybootchartgui/pybootchartgui.py build/tmp-*/buildstats/* -o build/tmp-*/buildstats tags: - cpu.heavy + +# Build OpenHarmony toolchain recipes +toolchain: + extends: .build + needs: + - job: fetch + artifacts: false + variables: + DISTRO: oniro-openharmony-linux + OPENHARMONY_VERSION: "3.0" + RECIPE: oniro-openharmony-toolchain oniro-openharmony-bundle parallel: matrix: - - DISTRO: [oniro-openharmony-linux] - OPENHARMONY_VERSION: ["3.0"] - MACHINE: [qemuarma7, raspberrypi4-64] - RECIPE: [oniro-openharmony-toolchain, oniro-openharmony-bundle, openharmony-standard-image, openharmony-tools] + - MACHINE: [qemuarma7, raspberrypi4-64] + artifacts: + paths: + - build/tmp-*/deploy/sdk + - build/tmp-*/buildstats* + expire_in: 1 month + +# Build OpenHarmony images +build: + extends: .build + needs: + - job: toolchain + artifacts: false + variables: + DISTRO: oniro-openharmony-linux + OPENHARMONY_VERSION: "3.0" + RECIPE: openharmony-standard-image openharmony-tools + parallel: + matrix: + - MACHINE: [qemuarma7, raspberrypi4-64] artifacts: paths: - build/tmp-*/deploy/images/${MACHINE} @@ -355,12 +379,13 @@ ptest: extends: .bitbake tags: - cpu.heavy + variables: + DISTRO: oniro-openharmony-linux + OPENHARMONY_VERSION: "3.0" + RECIPE: openharmony-standard-image-tests parallel: matrix: - - DISTRO: [oniro-openharmony-linux] - OPENHARMONY_VERSION: ["3.0"] - MACHINE: [qemuarma7] - RECIPE: [openharmony-standard-image-tests] + - MACHINE: [qemuarma7] artifacts: paths: - build/tmp-*/work/*/*/*/testimage @@ -510,7 +535,7 @@ ohos: optional: true - job: ohos_fetch artifacts: true - - job: build + - job: toolchain artifacts: true parallel: matrix: diff --git a/recipes-openharmony/openharmony/files/40-ashmem.rules b/recipes-openharmony/openharmony/files/40-ashmem.rules new file mode 100644 index 0000000000000000000000000000000000000000..6bea00b8b13e36f4649e1d10193e81230802c1de --- /dev/null +++ b/recipes-openharmony/openharmony/files/40-ashmem.rules @@ -0,0 +1 @@ +KERNEL=="ashmem", MODE="0666" diff --git a/recipes-openharmony/openharmony/files/40-binder.rules b/recipes-openharmony/openharmony/files/40-binder.rules new file mode 100644 index 0000000000000000000000000000000000000000..b7ad4d957e651f867d8b28bfd7390376584bc507 --- /dev/null +++ b/recipes-openharmony/openharmony/files/40-binder.rules @@ -0,0 +1 @@ +KERNEL=="binder*", MODE="0666" diff --git a/recipes-openharmony/openharmony/files/40-drm.rules b/recipes-openharmony/openharmony/files/40-drm.rules new file mode 100644 index 0000000000000000000000000000000000000000..42bf256716f48e4bd09c83e08071eea99eba4e8e --- /dev/null +++ b/recipes-openharmony/openharmony/files/40-drm.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", MODE="0666" diff --git a/recipes-openharmony/openharmony/files/accountmgr.service b/recipes-openharmony/openharmony/files/accountmgr.service index 8de6abe03b7fa77422c4d57778d1f42f2ff6c2da..4b52a979906e9a4f45bd3a2e790f6bc371eeb05e 100644 --- a/recipes-openharmony/openharmony/files/accountmgr.service +++ b/recipes-openharmony/openharmony/files/accountmgr.service @@ -1,10 +1,20 @@ [Unit] -Description=OpenHarmony Account Manager service +Description=OpenHarmony Account Manager service (SA: 200) +Requires=samgr.service +After=samgr.service +#Wants=param.service +#After=param.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony SystemAbilityFramework Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/accountmgr.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/appspawn.service b/recipes-openharmony/openharmony/files/appspawn.service index e299f49cc1b3852f88d878d33fcbaa1c349aca07..52264e470b18e3cf7f57024224a02b5853d245ba 100644 --- a/recipes-openharmony/openharmony/files/appspawn.service +++ b/recipes-openharmony/openharmony/files/appspawn.service @@ -1,10 +1,23 @@ [Unit] -Description=OpenHarmony Appspawn service +Description=OpenHarmony Appspawn service (SA: 1401 180 3703 3008) +Requires=samgr.service +After=samgr.service +Wants=param.service +After=param.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +Requires=dev-dri-card0.device +After=dev-dri-card0.device [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Appspawn 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" +ExecStartPre=install -m 0755 -d /run/openharmony/appspawn +LimitNICE=40 +ExecStart=/usr/bin/appspawn [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/deviceauth.service b/recipes-openharmony/openharmony/files/deviceauth.service index aab97854fa0d40cee3f4fe52a90daf4b4fa643f3..106e75eb649723d9e9ed2423a8f150f06f9b8ce0 100644 --- a/recipes-openharmony/openharmony/files/deviceauth.service +++ b/recipes-openharmony/openharmony/files/deviceauth.service @@ -1,10 +1,20 @@ [Unit] -Description=OpenHarmony Device Authentication daemon +Description=OpenHarmony Device Authentication daemon (SA: 4701) +Requires=samgr.service +After=samgr.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +# Requires SA: 3510 +Wants=huks.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Device Authentication Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +LimitNICE=40 +ExecStart=/usr/bin/deviceauth_service [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/distributed_data.service b/recipes-openharmony/openharmony/files/distributed_data.service index 4ce37814c7200ffae678db543e50fb5c3c62378d..dc2e7c51d38be98e37979f2265c2e9845789e6bc 100644 --- a/recipes-openharmony/openharmony/files/distributed_data.service +++ b/recipes-openharmony/openharmony/files/distributed_data.service @@ -1,10 +1,21 @@ [Unit] -Description=OpenHarmony Distributed Data service +Description=OpenHarmony Distributed Data service (SA: 1301) +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 [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Distributed Data Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell readproc +CapabilityBoundingSet=CAP_DAC_READ_SEARCH +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/distributeddata.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/distributedsched.service b/recipes-openharmony/openharmony/files/distributedsched.service index 578c42b831dd56e5c3f91aa8835a3d62aed6b48f..e12863c3b7e6d046d96d0ad8fa482c0844efcbeb 100644 --- a/recipes-openharmony/openharmony/files/distributedsched.service +++ b/recipes-openharmony/openharmony/files/distributedsched.service @@ -1,10 +1,22 @@ [Unit] -Description=OpenHarmony Distributed Schedule service +Description=OpenHarmony Distributed Schedule service (SA: 1401) +Requires=samgr.service +After=samgr.service +#Wants=param.service +#After=param.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +# Requires SA: 4700 +Wants=dsoftbus.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Distributed Schedule Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/distributedsched.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/dsoftbus.service b/recipes-openharmony/openharmony/files/dsoftbus.service index d9728659e9482d96a54139a2f798e5130d0a8333..dc8301aa8ed84473707fb279efba8de4f683e341 100644 --- a/recipes-openharmony/openharmony/files/dsoftbus.service +++ b/recipes-openharmony/openharmony/files/dsoftbus.service @@ -1,10 +1,24 @@ [Unit] -Description=OpenHarmony DSoftBus services +Description=OpenHarmony DSoftBus services (SA: 1401 4700) +Requires=samgr.service +After=samgr.service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +# Requires SA: 3299 +Wants=foundation.service +# Requires SA: 3510 +Wants=huks.service +# Requires SA: 4701 +Wants=deviceauth.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony DSoftBus Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/softbus_server.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/faultloggerd.service b/recipes-openharmony/openharmony/files/faultloggerd.service index 72d744930ee2d3fb939d61682195741c8cd39853..b9fb18113d9b931c72f94a93650ddd0499eef795 100644 --- a/recipes-openharmony/openharmony/files/faultloggerd.service +++ b/recipes-openharmony/openharmony/files/faultloggerd.service @@ -2,9 +2,15 @@ Description=OpenHarmony FaultLogger daemon [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony FaultLogger Service" -RemainAfterExit=yes +Type=notify +ExecStartPre=!install -o root -g system -m 0755 -d /run/openharmony/faultlogger +ExecStartPre=!install -o system -g log -m 0770 -d /data/log +ExecStartPre=!install -o system -g system -m 0770 -d /data/log/faultlog +ExecStartPre=!install -o system -g system -m 0770 -d /data/log/faultlog/temp +User=root +Group=system +SupplementaryGroups=log +ExecStart=/usr/bin/faultloggerd [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/foundation.service b/recipes-openharmony/openharmony/files/foundation.service index 65f27a109d105ddcbde1375c495e55be94dc65b8..f2d255e1c2df6e935f65e63a5fcfc6cb4918bbfc 100644 --- a/recipes-openharmony/openharmony/files/foundation.service +++ b/recipes-openharmony/openharmony/files/foundation.service @@ -1,10 +1,34 @@ [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? +Requires=dev-dri-card0.device +After=dev-dri-card0.device [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/hdcd.service b/recipes-openharmony/openharmony/files/hdcd.service index dc5435074b90aaa0d16de4d5e7fa083e99ac3040..2c4f297f91400cc0b81d9a007b4699e88e63fd51 100644 --- a/recipes-openharmony/openharmony/files/hdcd.service +++ b/recipes-openharmony/openharmony/files/hdcd.service @@ -1,10 +1,13 @@ [Unit] Description=OpenHarmony Device Connector Daemon service +Wants=hdcd.socket +After=hdcd.socket +Wants=param.service +After=param.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Device Connector Daemon Service" -RemainAfterExit=yes +Type=exec +ExecStart=/usr/bin/hdcd -t -l 3 [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/hdcd.socket b/recipes-openharmony/openharmony/files/hdcd.socket new file mode 100644 index 0000000000000000000000000000000000000000..fa23cf5184aa324431b8ac601afb702e65715c41 --- /dev/null +++ b/recipes-openharmony/openharmony/files/hdcd.socket @@ -0,0 +1,9 @@ +[Unit] +Description=OpenHarmony Device Connector Daemon socket + +[Socket] +ExecStartPre=install -o system -g system -m 775 -d /run/openharmony/hdc +ListenSequentialPacket=/run/openharmony/hdc/FOOBAR +SocketUser=system +SocketGroup=system +SocketMode=0660 diff --git a/recipes-openharmony/openharmony/files/hilogd-control.socket b/recipes-openharmony/openharmony/files/hilogd-control.socket new file mode 100644 index 0000000000000000000000000000000000000000..385c3b36a11ceba5781c316261fd88f148531dcd --- /dev/null +++ b/recipes-openharmony/openharmony/files/hilogd-control.socket @@ -0,0 +1,11 @@ +[Unit] +Description=OpenHarmony hilog control socket + +[Socket] +ExecStartPre=install -o logd -g logd -m 775 -d /run/openharmony/hilog +ListenSequentialPacket=/run/openharmony/hilog/control +SocketUser=logd +SocketGroup=logd +# This mimics OHOS init config, although hilogd changes it to 0666 on startup +SocketMode=0600 +Service=hilogd.service diff --git a/recipes-openharmony/openharmony/files/hilogd-control.socket.license b/recipes-openharmony/openharmony/files/hilogd-control.socket.license new file mode 100644 index 0000000000000000000000000000000000000000..98a0b3f4a5b8db268215a128c7d06e0a10897e73 --- /dev/null +++ b/recipes-openharmony/openharmony/files/hilogd-control.socket.license @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 diff --git a/recipes-openharmony/openharmony/files/hilogd-input.socket b/recipes-openharmony/openharmony/files/hilogd-input.socket new file mode 100644 index 0000000000000000000000000000000000000000..ba1ec595b28283d2425a00d0a0e7dee26eab450e --- /dev/null +++ b/recipes-openharmony/openharmony/files/hilogd-input.socket @@ -0,0 +1,10 @@ +[Unit] +Description=OpenHarmony hilog input socket + +[Socket] +ExecStartPre=install -o logd -g logd -m 775 -d /run/openharmony/hilog +ListenDatagram=/run/openharmony/hilog/input +SocketUser=logd +SocketGroup=logd +SocketMode=0666 +Service=hilogd.service diff --git a/recipes-openharmony/openharmony/files/hilogd-input.socket.license b/recipes-openharmony/openharmony/files/hilogd-input.socket.license new file mode 100644 index 0000000000000000000000000000000000000000..98a0b3f4a5b8db268215a128c7d06e0a10897e73 --- /dev/null +++ b/recipes-openharmony/openharmony/files/hilogd-input.socket.license @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 diff --git a/recipes-openharmony/openharmony/files/hilogd.service b/recipes-openharmony/openharmony/files/hilogd.service index 06b61ed56cff0dd5215b46320e1547f358e9de94..90dc7650629160168bc319f67c9c056894f17e16 100644 --- a/recipes-openharmony/openharmony/files/hilogd.service +++ b/recipes-openharmony/openharmony/files/hilogd.service @@ -1,10 +1,16 @@ [Unit] Description=OpenHarmony hilog daemon +Requires=hilogd-input.socket hilogd-control.socket +After=hilogd-input.socket hilogd-control.socket [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony hilog Service" -RemainAfterExit=yes +Type=notify +ExecStartPre=!install -o system -g log -m 0770 -d /data/log +ExecStartPre=!install -o logd -g log -m 0750 -d /data/log/hilog +User=logd +Group=log +ExecStart=/usr/bin/hilogd +ExecStartPost=hilog -G 16M [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/hiview.service b/recipes-openharmony/openharmony/files/hiview.service new file mode 100644 index 0000000000000000000000000000000000000000..16205d9575ce2aac595b6e40e40d11fad1718bd2 --- /dev/null +++ b/recipes-openharmony/openharmony/files/hiview.service @@ -0,0 +1,20 @@ +[Unit] +Description=OpenHarmony hiview service (SA: 1201 1202) +Wants=param.service +After=param.service +Requires=samgr.service +After=samgr.service +Wants=hilogd.service +After=hilogd.service + +[Service] +Type=notify +ExecStartPre=!install -o system -g system -m 0755 -d /run/openharmony/hiview +User=system +Group=system +SupplementaryGroups=log +LimitNICE=40 +ExecStart=/usr/bin/hiview + +#[Install] +#WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/huks.service b/recipes-openharmony/openharmony/files/huks.service index 9c4c39b68c38611e43cc4d49f1740d3b912e8729..1fa0b8b6d8f048fd878cffb799b4ed90c368eab2 100644 --- a/recipes-openharmony/openharmony/files/huks.service +++ b/recipes-openharmony/openharmony/files/huks.service @@ -1,10 +1,18 @@ [Unit] -Description=OpenHarmony huks service +Description=OpenHarmony huks service (SA: 3510) +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 Huks Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/huks_service.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/inputmethod.service b/recipes-openharmony/openharmony/files/inputmethod.service index 3e15e3e2b9b32d04762ee5f959b56bcde18311f0..fda027973a33380fc6adc7836690fa9dc8d44b1f 100644 --- a/recipes-openharmony/openharmony/files/inputmethod.service +++ b/recipes-openharmony/openharmony/files/inputmethod.service @@ -1,10 +1,19 @@ [Unit] -Description=OpenHarmony input method services +Description=OpenHarmony input method services (SA: 180 1401 3703) +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 Input Method Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +CapabilityBoundingSet=CAP_SYS_TIME +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/inputmethod_service.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/installs.service b/recipes-openharmony/openharmony/files/installs.service index b47eb4f2ccb1737469db3b82e97dddf5cc3a07c3..a4d7316bf870cccd654bf9c415bf544b2b955e1b 100644 --- a/recipes-openharmony/openharmony/files/installs.service +++ b/recipes-openharmony/openharmony/files/installs.service @@ -1,10 +1,14 @@ [Unit] -Description=OpenHarmony Installs service +Description=OpenHarmony installd service (SA: 511) +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 Installs Service" -RemainAfterExit=yes +Type=notify +ExecStart=/usr/bin/installs [Install] WantedBy=multi-user.target 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/mmi-uinput.service b/recipes-openharmony/openharmony/files/mmi-uinput.service new file mode 100644 index 0000000000000000000000000000000000000000..2bc61dfb1d17009272964ecf9a0afb25115dbf05 --- /dev/null +++ b/recipes-openharmony/openharmony/files/mmi-uinput.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenHarmony multimodalinput service (SA: ?) +Requires=samgr.service +After=samgr.service +Wants=hilogd.service +After=hilogd.service + +[Service] +Type=exec +User=root +Group=system +SupplementaryGroups=shell uhid +LimitNICE=40 +ExecStart=/usr/bin/uinput_inject + +[Install] +WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/multimodalinput.service b/recipes-openharmony/openharmony/files/multimodalinput.service new file mode 100644 index 0000000000000000000000000000000000000000..2fa19139bcb36575219642249fc7eeac8cded8f2 --- /dev/null +++ b/recipes-openharmony/openharmony/files/multimodalinput.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenHarmony multimodalinput service (SA: ?) +Requires=samgr.service +After=samgr.service +Wants=hilogd.service +After=hilogd.service + +[Service] +Type=notify +User=system +Group=system +SupplementaryGroups=shell uhid +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/multimodalinputservice.xml + +[Install] +WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/ohos.para b/recipes-openharmony/openharmony/files/ohos.para new file mode 100644 index 0000000000000000000000000000000000000000..249342ef7c461fc6e15a5c56a3afe56cf64de37b --- /dev/null +++ b/recipes-openharmony/openharmony/files/ohos.para @@ -0,0 +1,54 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +build_version = 2.0 + +hw_sc.build.os.enable=true +hw_sc.build.os.apiversion=6 +hw_sc.build.os.version=3.0.1 +hw_sc.build.os.devicetype=headless +hw_sc.build.os.releasetype=Canary1 + +ro.actionable_compatible_property.enabled=false +ro.postinstall.fstab.prefix=/system +ro.secure=1 +security.perf_harden=1 +ro.allow.mock.location=0 +ro.debuggable=1 +ro.build.characteristics=default + +# There is some kind of special handling if this is "OHOS" +ro.product.model=OHOS +ro.product.name=OpenHarmony 3.0.1 +ro.product.locale=en-US + +# 1: COMMERCIAL +# 2: FANS +# 3: BETA +# 4: TEST +# 5: OVERSEAS_BETA +# 6: OVERSEAS_COMMERCIAL +ro.logsystem.usertype=4 + +# user: General public +# userdebug: like user, but with root +# eng: build for testing ROMS not for public +ro.build.type=user + +persist.sys.usb.config=hdc + +ro.hdc.secure=0 +persist.hdc.port=35000 +persist.hdc.root=1 + +persist.ace.trace.enabled=0 diff --git a/recipes-openharmony/openharmony/files/openharmony-preinit b/recipes-openharmony/openharmony/files/openharmony-preinit index ad31ecde7532b7d0ef5c00c31e93516ef68ac4be..8307d528976ae74a2de207cb4c5a3e3906d4ba09 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit +++ b/recipes-openharmony/openharmony/files/openharmony-preinit @@ -4,9 +4,6 @@ # # SPDX-License-Identifier: Apache-2.0 -# Don't print out kernel messages below warning levels to console -dmesg -n 4 - mkdir -p /data/backup mkdir -p /data/bootchart mkdir -p /data/cache @@ -76,273 +73,8 @@ mkdir -p /data/vendor_ce mkdir -p /data/vendor_de mkdir -p /data/vendor/hardware mkdir -p /data/weston -mkdir -p /data/log/hilog mkdir -p /data/log/faultlog/faultlogger mkdir -p /data/log/faultlog/temp mkdir -p /usr/lib/dri chmod -R 777 /data - -# /dev/binder and /dev/ashmem need to be rw for all users -chmod 666 /dev/binder -chmod 666 /dev/ashmem - -# /dev/dri/card0 needs to be rw for all users -if [ -c /dev/dri/card0 ]; then - chmod 666 /dev/dri/card0 -fi - -install -m 755 -d /dev/unix/socket - -export XDG_RUNTIME_DIR=/data/weston -export XKB_CONFIG_ROOT=/etc/openharmony/xkb -export XKB_CONFIG_EXTRA_PATH=/etc/openharmony/xkb - -STARTUP_CMD_SLEEP=4 - -# trigger: part of the init process itself -if systemctl -q is-enabled param.service; then - /system/bin/param_service & - sleep "$STARTUP_CMD_SLEEP" - while [ "$(setparam foobar 42)" != "setparam foobar 42 success" ] ; do - echo "param_service not ready" - sleep 1 - done -fi - -# Explicitly set default value to silence error message about parameter not being set -setparam persist.ace.trace.enabled 0 - -# - pre-init stage -# - init stage - -if systemctl -q is-enabled samgr.service; then - echo >/dev/console "Starting OpenHarmony samgr service" - /system/bin/samgr & - sleep "$STARTUP_CMD_SLEEP" -fi - -# - post-init stage -# - "trigger early-fs", -# - "trigger fs", -# - "trigger post-fs", -# - "trigger late-fs", -# - "trigger post-fs-data", -# - "trigger load_persist_props_action", -# - "trigger firmware_mounts_complete", -# - "trigger early-boot", -# - "trigger boot" - -# trigger: post-fs -# "start udevd_service", -# "sleep 1", -# "start multimodalinputservice", -# "start mmi_uinput_service", -# "sleep 2", -# "export XDG_RUNTIME_DIR /data/weston", -# "export XKB_CONFIG_ROOT /etc/xkb", -# "export XKB_CONFIG_EXTRA_PATH /etc/xkb", -# "mkdir /data/weston", -# "chmod 777 /data/weston", -# "start weston", -# "trigger weston_start", -# "sleep 2", -# "exec /system/bin/udevadm trigger", -# "exec /system/bin/udevadm settle --timeout=30" -if systemctl -q is-enabled weston.service; then - echo >/dev/console "Starting weston" - /system/bin/weston -c /system/etc/weston.ini -B drm-backend.so --tty=1 --use-pixman & - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: late-fs -# "name" : "installs", -# "path" : ["/system/bin/installs"], -# "importance" : -20, -# "uid" : "root", -# "gid" : ["root"] -if systemctl -q is-enabled installs.service; then - echo >/dev/console "Starting OpenHarmony installs service" - /system/bin/installs & # saId 511 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: late-fs -# "name" : "appspawn", -# "path" : ["/system/bin/appspawn"], -# "importance" : -20, -# "uid" : "root", -# "gid" : ["root"] -if systemctl -q is-enabled appspawn.service; then - echo >/dev/console "Starting OpenHarmony appspawn service" - /system/bin/appspawn & # SA: 1401 180 3703 3008 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: post-fs-data -# "mkdir /data/log/ 0770 system log", -# "mkdir /data/log/hilog/ 0750 logd log", -# "uid" : "logd", -# "gid" : "log", -# "socket" : [ -# "hilogInput dgram 0666 logd logd passcred", -# "hilogControl seqpacket 0600 logd logd false" -# ] -if systemctl -q is-enabled hilogd.service; then - echo >/dev/console "Starting OpenHarmony hilogd service" - /system/bin/hilogd & - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: post-fs-data -# "name" : "huks_service", -# "path" : ["/system/bin/sa_main", "/system/profile/huks_service.xml"], -# "uid" : "system", -# "gid" : ["system", "shell"] -if systemctl -q is-enabled huks.service; then - echo >/dev/console "Starting OpenHarmony huks service" - su system -c '/system/bin/sa_main /system/profile/huks_service.xml &' # SA: 3510 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: post-fs-data -# "name" : "deviceauth_service", -# "path" : ["/system/bin/deviceauth_service"], -# "uid" : "system", -# "gid" : ["system", "shell"] -if systemctl -q is-enabled deviceauth.service; then - echo >/dev/console "Starting OpenHarmony deviceauth service" - su system -c '/system/bin/deviceauth_service &' # SA: 4701 | Required SA: 3510 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: post-fs-data -# "name" : "accountmgr", -# "path" : ["/system/bin/sa_main", "/system/profile/accountmgr.xml"], -# "uid" : "system", -# "gid" : ["system", "shell"], -# "writepid" : [ -# "/dev/cpuset/foreground/tasks", -# "/dev/stune/foreground/tasks", -# "/dev/blkio/foreground/tasks" -# ] -if systemctl -q is-enabled accountmgr.service; then - echo >/dev/console "Starting OpenHarmony accountmgr service" - su system -c '/system/bin/sa_main /system/profile/accountmgr.xml &' # SA: 200 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: post-fs-data -# "name" : "softbus_server", -# "path" : ["/system/bin/sa_main", "/system/profile/softbus_server.xml"], -# "uid" : "system", -# "gid" : ["system", "shell"] -if systemctl -q is-enabled dsoftbus.service; then - echo >/dev/console "Starting OpenHarmony dsoftbus service" - su system -c '/system/bin/sa_main /system/profile/softbus_server.xml &' # SA: 1401 4700 | Required SA: 3299 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: not used? -#sa_main /system/profile/dps_service.xml & # SA: 1401 180 3502 -#sleep "$STARTUP_CMD_SLEEP" - -# trigger: post-fs-data -# "name" : "distributedsched", -# "path" : ["/system/bin/sa_main", "/system/profile/distributedsched.xml"], -# "uid" : "system", -# "gid" : ["system", "shell"] -if systemctl -q is-enabled distributedsched.service; then - echo >/dev/console "Starting OpenHarmony distributedsched service" - su system -c '/system/bin/sa_main /system/profile/distributedsched.xml &' # SA: 1401 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: boot -# "name" : "distributeddata", -# "path" : ["/system/bin/sa_main","/system/profile/distributeddata.xml"], -# "caps" : ["DAC_READ_SEARCH"], -# "uid" : "system", -# "gid" : ["system","shell","readproc"], -# "writepid":[ -# "/dev/cpuset/foreground/tasks", -# "/dev/stune/foreground/tasks", -# "/dev/blkio/foreground/tasks" -# ] -if systemctl -q is-enabled distributed_data.service; then - echo >/dev/console "Starting OpenHarmony distributeddata service" - su system -c '/system/bin/sa_main /system/profile/distributeddata.xml &' # SA: 1301 - sleep "$STARTUP_CMD_SLEEP" -fi - -# trigger: boot -# "name" : "time_service", -# "path" : ["/system/bin/sa_main", "/system/profile/time_service.xml"], -# "uid" : "system", -# "gid" : ["system", "shell"], -# "caps" : ["SYS_TIME", "WAKE_ALARM"] -if systemctl -q is-enabled time.service; then - echo >/dev/console "Starting OpenHarmony time service" - su system -c '/system/bin/sa_main /system/profile/time_service.xml &' # SA: 1401 180 3702 - sleep "$STARTUP_CMD_SLEEP" -fi - -# 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"], -# "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"], -# "uid" : "system", -# "gid" : ["system", "shell"], -# "caps" : ["SYS_TIME"] -if systemctl -q is-enabled inputmethod.service; then - echo >/dev/console "Starting OpenHarmony inputmethod service" - su system -c '/system/bin/sa_main /system/profile/inputmethod_service.xml &' # SA: 180 1401 3703 - sleep "$STARTUP_CMD_SLEEP" -fi - -if systemctl -q is-enabled faultloggerd.service; then - echo >/dev/console "Starting OpenHarmony faultlogger service" - setparam ro.logsystem.usertype 6 # UserType::OVERSEAS_COMMERCIAL - /system/bin/faultloggerd & -fi - -# trigger: boot? -# "name" : "hdcd", -# "path" : ["/system/bin/hdcd"], -# "socket" : [ -# "hdcd seqpacket 660 system system false" -# ], -# "disabled" : 1 -if systemctl -q is-enabled hdcd.service; then - echo >/dev/console "Starting OpenHarmony hdcd service" - setparam persist.hdc.port 35000 - setparam persist.hdc.root 1 # We are running hdcd as root - setparam ro.hdc.secure 0 # Do not enable secure mode - sleep "$STARTUP_CMD_SLEEP" - /system/bin/hdcd -t & -fi - -echo "All OpenHarmony services started" >/dev/console diff --git a/recipes-openharmony/openharmony/files/openharmony-preinit.service b/recipes-openharmony/openharmony/files/openharmony-preinit.service index 3b3fc0173a53ae716fff6cd5f3f4349e867f0ed9..1ebbcb8fe697ca269e82f40d1e319dd7c7f15952 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit.service +++ b/recipes-openharmony/openharmony/files/openharmony-preinit.service @@ -1,5 +1,7 @@ [Unit] Description=OpenHarmony pre-init setup +Wants=param.service +After=param.service [Service] Type=oneshot diff --git a/recipes-openharmony/openharmony/files/param b/recipes-openharmony/openharmony/files/param new file mode 100644 index 0000000000000000000000000000000000000000..c02b067b93124f45e7330f4c764018297ff668e9 --- /dev/null +++ b/recipes-openharmony/openharmony/files/param @@ -0,0 +1,6 @@ +#!/bin/sh +case "$1" in + set) setparam "$2" "$3" ;; + get) getparam "$2" ;; + *) exit 1 ;; +esac diff --git a/recipes-openharmony/openharmony/files/param.service b/recipes-openharmony/openharmony/files/param.service index aa8b6ce66843d5695e0410a7c57dc0f12d0fd260..3a9189b91d78f696434ce9c328d9a93a603ad62c 100644 --- a/recipes-openharmony/openharmony/files/param.service +++ b/recipes-openharmony/openharmony/files/param.service @@ -2,9 +2,11 @@ Description=OpenHarmony Param Service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Param Service" -RemainAfterExit=yes +Type=notify +ExecStartPre=install -m 755 -d /run/openharmony/param +ExecStartPre=install -m 755 -d /data/param +StandardError=journal +ExecStart=/usr/bin/param_service [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/samgr.service b/recipes-openharmony/openharmony/files/samgr.service index bb66c394846c8e39f705162f49950b30546ec069..f0f26e97d5e54d110def57b7d902ae565a1c43aa 100644 --- a/recipes-openharmony/openharmony/files/samgr.service +++ b/recipes-openharmony/openharmony/files/samgr.service @@ -1,10 +1,20 @@ [Unit] Description=OpenHarmony SystemAbilityFramework service +# Logging to hilogd, but seems to work without it +Wants=hilogd.service +After=hilogd.service +# HACK: this dependency is just to have it openharmony-preinit run before most +# other OH services until we have gotten rid of it completely. +Wants=openharmony-preinit.service +After=openharmony-preinit.service [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony SystemAbilityFramework Service" -RemainAfterExit=yes +Type=notify +ExecStartPre=!install -m 755 -o system -g system -d /data/sadata_de /data/sadata_de/samgr +User=system +Group=system +ExecStart=/usr/bin/samgr +LimitNICE=40 [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/start_service b/recipes-openharmony/openharmony/files/start_service new file mode 100644 index 0000000000000000000000000000000000000000..e3d041ddbac3f1464320fb7849ed1ee9c31fdf24 --- /dev/null +++ b/recipes-openharmony/openharmony/files/start_service @@ -0,0 +1,2 @@ +#!/bin/sh +systemctl start "$@" diff --git a/recipes-openharmony/openharmony/files/stop_service b/recipes-openharmony/openharmony/files/stop_service new file mode 100644 index 0000000000000000000000000000000000000000..4118ad89a2e1249e65dd52379d96cadb1dc75314 --- /dev/null +++ b/recipes-openharmony/openharmony/files/stop_service @@ -0,0 +1,2 @@ +#!/bin/sh +systemctl stop "$@" diff --git a/recipes-openharmony/openharmony/files/time.service b/recipes-openharmony/openharmony/files/time.service index f87cdf888502e18e3e1c8b40adb0685c42b843c9..8e6e64e5c850874556107a1f3c5e0af48fddbad4 100644 --- a/recipes-openharmony/openharmony/files/time.service +++ b/recipes-openharmony/openharmony/files/time.service @@ -1,10 +1,19 @@ [Unit] -Description=OpenHarmony Time service +Description=OpenHarmony Time service (SA: 1401 180 3702) +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 Time Service" -RemainAfterExit=yes +Type=notify +User=system +Group=system +SupplementaryGroups=shell +CapabilityBoundingSet=CAP_SYS_TIME CAP_WAKE_ALARM +LimitNICE=40 +ExecStart=/usr/bin/sa_main /system/profile/time_service.xml [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/weston.service b/recipes-openharmony/openharmony/files/weston.service index 5c82db22de35e34b92b846025d9ba91c4a3beaf9..43b46adfe1cddda3e48ac477fd8f315550865593 100644 --- a/recipes-openharmony/openharmony/files/weston.service +++ b/recipes-openharmony/openharmony/files/weston.service @@ -1,10 +1,20 @@ [Unit] Description=OpenHarmony Weston window manager service +Requires=samgr.service +After=samgr.service +Wants=hilogd.service +After=hilogd.service +Wants=openharmony-preinit.service +After=openharmony-preinit.service +Requires=dev-dri-card0.device +After=dev-dri-card0.device [Service] -Type=oneshot -ExecStart=/bin/echo "OpenHarmony Weston Service" -RemainAfterExit=yes +Type=exec +Environment="XDG_RUNTIME_DIR=/data/weston" +Environment="XKB_CONFIG_ROOT=/etc/openharmony/xkb" +Environment="XKB_CONFIG_EXTRA_PATH=/etc/openharmony/xkb" +ExecStart=/usr/bin/weston -c /system/etc/weston.ini -B drm-backend.so --tty=1 --use-pixman [Install] WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/ace_engine-disable-create-component.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/ace_engine-disable-create-component.patch deleted file mode 100644 index 1197b21483a3540b5ab8d68102555af7f682b45f..0000000000000000000000000000000000000000 --- a/recipes-openharmony/openharmony/openharmony-standard-3.0/ace_engine-disable-create-component.patch +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# -# SPDX-License-Identifier: Apache-2.0 - -foundation/ace/ace_engine: disable graphics - -The graphics rendering is slowing the system making some ACTS test suites to timeout. -Since we are aiming for certification for headless system, graphics stack -should not be required. -Disabling graphics by skipping JSView::CreateComponent() execution. -In the future we will remove this patch when we the graphical part will be needed. - -Apply to foundation/ace/ace_engine - -Upstream-Status: Inappropriate - -Signed-off-by: Francesco Pham <francesco.pham@huawei.com> -diff --git a/frameworks/bridge/declarative_frontend/jsview/js_view.cpp b/frameworks/bridge/declarative_frontend/jsview/js_view.cpp -index e455cb00..d58d5c79 100644 ---- a/frameworks/bridge/declarative_frontend/jsview/js_view.cpp -+++ b/frameworks/bridge/declarative_frontend/jsview/js_view.cpp -@@ -254,6 +254,7 @@ RefPtr<OHOS::Ace::Component> JSView::CreateComponent() - - std::string key = ViewStackProcessor::GetInstance()->ProcessViewId(viewId_); - auto composedComponent = AceType::MakeRefPtr<ComposedComponent>(key, "view"); -+ return composedComponent; - - // add callback for element creation to component, and get pointer reference - // to the element on creation. When state of this view changes, mark the diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch deleted file mode 100644 index c8db5402476a4b03097881f7b047ddb4d136b78d..0000000000000000000000000000000000000000 --- a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# -# SPDX-License-Identifier: Apache-2.0 - -test/xts/acts/ActsFeatureAbilityTest: wait 8 seconds between each testcase - -sometimes feature abilities fail to start because the previous testcase -still has't completely started or terminated its feature ability. -Increasing sleep time from 1 seconds to 8 seconds between each testcase. - -Upstream-Status: Pending - -Signed-off-by: Francesco Pham <francesco.pham@huawei.com> -diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -index 10e517f2c..1abaccd94 100644 ---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -@@ -82,7 +82,7 @@ describe('ActsFeatureAbilityTest', function () { - } - } - beforeEach(() => { -- sleep(1000); -+ sleep(8000); - }) - - /** diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch deleted file mode 100644 index ee8898ab95ca3bf70194ad1d779b2a2320bf4f3d..0000000000000000000000000000000000000000 --- a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# -# SPDX-License-Identifier: Apache-2.0 - -test/xts/acts/ActsGetWantTest: wait 10 seconds between each testcase - -sometimes feature abilities fail to start because the previous testcase -still has't completely started or terminated its feature ability. -Adding a 10 seconds wait time between each testcase. - -Upstream-Status: Pending - -Signed-off-by: Francesco Pham <francesco.pham@huawei.com> -diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js -index 81a92cc7e..e75f90039 100644 ---- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js -+++ b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js -@@ -34,6 +34,14 @@ describe('ActsGetWantTest', function () { - done(); - }) - -+ beforeEach(async (done) => { -+ console.debug("waiting 10 seconds between testcases"); -+ setTimeout(function(){ -+ console.debug("beforeEach end"); -+ done(); -+ },10000); -+ }) -+ - // @tc.number: ACTS_GetWant_0100 - // @tc.name: getWant : get want in current ability - // @tc.desc:Start the ability through startabilityforresult, diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..893e73141b7daea59fe2680a3af56119b8ce7db1 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-sd-notify.patch @@ -0,0 +1,73 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/startup/appspawn_standard of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to appspawn service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/BUILD.gn b/BUILD.gn +index cc3a1e8ce045..d20845e644b4 100755 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -64,6 +64,7 @@ ohos_shared_library("appspawn_server") { + "hiviewdfx_hilog_native:libhilog", + "ipc:ipc_core", + ] ++ libs = [ "systemd" ] + + subsystem_name = "${subsystem_name}" + part_name = "${part_name}" +diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp +index 2c8e7d11f11c..5e2addf99909 100644 +--- a/src/appspawn_server.cpp ++++ b/src/appspawn_server.cpp +@@ -23,6 +23,8 @@ + #include <sys/capability.h> + #include <thread> + ++#include <systemd/sd-daemon.h> ++ + #include "errors.h" + #include "hilog/log.h" + #include "main_thread.h" +@@ -181,6 +183,7 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) + + LoadAceLib(); + ++ sd_notify(0, "READY=1"); + while (isRunning_) { + std::unique_lock<std::mutex> lock(mut_); + dataCond_.wait(lock, [this] { return !this->appQueue_.empty(); }); +@@ -224,6 +227,7 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) + socket_->CloseConnection(connectFd); // close socket connection + HiLog::Debug(LABEL, "AppSpawnServer::parent process create app finish, pid = %{public}d", pid); + } ++ sd_notify(0, "STOPPING=1"); + return false; + } + +diff --git a/test/unittest/app_spawn_server_test/BUILD.gn b/test/unittest/app_spawn_server_test/BUILD.gn +index 4ac518e25e6d..f649724656ab 100755 +--- a/test/unittest/app_spawn_server_test/BUILD.gn ++++ b/test/unittest/app_spawn_server_test/BUILD.gn +@@ -32,6 +32,7 @@ ohos_unittest("AppSpawnServerOverrideTest") { + ] + + deps = [ "${appspawn_path}/test:appspawn_test_source" ] ++ libs = [ "systemd" ] + + external_deps = [ + "hiviewdfx_hilog_native:libhilog", +@@ -57,6 +58,7 @@ ohos_unittest("AppSpawnServerMockTest") { + ] + + deps = [ "${appspawn_path}/test:appspawn_test_source" ] ++ libs = [ "systemd" ] + + external_deps = [ + "hiviewdfx_hilog_native:libhilog", diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-socket-path.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-socket-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..b141b2c43fc20d277b9612d1eeeb521fc2d1ffa9 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/appspawn-socket-path.patch @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/startup/appspawn_standard of OpenHarmony 3.0 codebase + +Configure appspawn service to place Unix socket in /run instead of /dev (where +they obviously does not belong). + +Having a dedicated directory for this makes it easier to handle permissions in a +safe way. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Inappropriate [configuration] + +diff --git a/include/appspawn_socket.h b/include/appspawn_socket.h +index 6edf8b728085..9896cd8a52bf 100644 +--- a/include/appspawn_socket.h ++++ b/include/appspawn_socket.h +@@ -102,11 +102,7 @@ protected: + std::string socketName_ {}; + struct sockaddr_un socketAddr_ {}; + socklen_t socketAddrLen_ = 0; +-#ifdef __MUSL__ +- const std::string socketDir_ = "/dev/unix/socket/"; +-#else +- const std::string socketDir_ = "/dev/socket/"; +-#endif ++ const std::string socketDir_ = "/run/openharmony/appspawn/"; + const unsigned int listenBacklog_ = 50; // 50: max num of clients + static constexpr struct timeval SOCKET_TIMEOUT = {5, 0}; // 5, 0: { 5 sec, 0 msec } for timeout + }; diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/deviceauth-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/deviceauth-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..9728d5deb39f48dde289bdcb37d4d339ae284157 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/deviceauth-sd-notify.patch @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/security/deviceauth of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to deviceauth service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/frameworks/src/ipc_service.c b/frameworks/src/ipc_service.c +index 46bd82dd8969..48972f55c9d4 100644 +--- a/frameworks/src/ipc_service.c ++++ b/frameworks/src/ipc_service.c +@@ -25,6 +25,8 @@ + #include "ipc_sdk.h" + #include "securec.h" + ++#include <systemd/sd-daemon.h> ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -1323,9 +1325,11 @@ int32_t main(int32_t argc, char const *argv[]) + } + (void)AddMethodMap(serviceCtx); + LOGI("device authentication service register to IPC manager done, service running..."); ++ sd_notify(0, "READY=1"); + (void)memset_s(&cond, sizeof(cond), 0, sizeof(cond)); + InitHcCond(&cond, NULL); + cond.wait(&cond); ++ sd_notify(0, "STOPPING=1"); + DestroyHcCond(&cond); + return 0; + } +diff --git a/services/BUILD.gn b/services/BUILD.gn +index d6bd3557f656..83db1b07278b 100644 +--- a/services/BUILD.gn ++++ b/services/BUILD.gn +@@ -219,6 +219,8 @@ if (defined(ohos_lite)) { + "safwk:system_ability_fwk", + "samgr_L2:samgr_proxy", + ] ++ ++ libs = [ "systemd" ] + } + + ohos_shared_library("deviceauth_sdk") { diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..b64288b3d2a369a8f43bcb53665f2b1a4b766af9 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-sd-notify.patch @@ -0,0 +1,58 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/hiviewdfx/faultloggerd of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to faultlogger service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/services/fault_logger_daemon.cpp b/services/fault_logger_daemon.cpp +index ed7794cfbfc7..e0b35c44a48c 100644 +--- a/services/fault_logger_daemon.cpp ++++ b/services/fault_logger_daemon.cpp +@@ -32,6 +32,8 @@ + #include <hilog/log.h> + #include <securec.h> + ++#include <systemd/sd-daemon.h> ++ + #include "fault_logger_daemon.h" + #include "faultloggerd_client.h" + +@@ -44,11 +46,7 @@ constexpr int32_t MAX_CONNECTION = 4; + constexpr int32_t REQUEST_BUF_SIZE = 1024; + constexpr int32_t MSG_BUF_SIZE = 256; + constexpr int32_t SYSTEM_UID = 1000; +-#if defined(USE_MUSL) +-static const char FAULTLOGGERD_SOCK_PATH[] = "/dev/unix/socket/faultloggerd.server"; +-#else +-static const char FAULTLOGGERD_SOCK_PATH[] = "/dev/socket/faultloggerd.server"; +-#endif ++static const char FAULTLOGGERD_SOCK_PATH[] = "/run/openharmony/faultlogger/server"; + static const char FAULTLOGGERD_BASE_PATH[] = "/data/log/faultlog/temp/"; + + static std::string GetRequestTypeName(int32_t type) +@@ -254,6 +252,7 @@ int32_t StartServer(int argc, char *argv[]) + return -1; + } + ++ sd_notify(0, "READY=1"); + struct sockaddr_un clientAddr; + socklen_t clientAddrSize = sizeof(clientAddr); + int connectionFd = -1; +diff --git a/services/BUILD.gn b/services/BUILD.gn +index f48777a7cdbf..847e3cf79510 100644 +--- a/services/BUILD.gn ++++ b/services/BUILD.gn +@@ -63,6 +63,7 @@ ohos_executable("faultloggerd") { + "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd", + "//utils/native/base:utils", + ] ++ libs = [ "systemd" ] + + if (is_standard_system) { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-socket-path.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-socket-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..84726e40c23f1ed51883fa09d135fa334e3f2296 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/faultloggerd-socket-path.patch @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/hiviewdfx/faultloggerd of OpenHarmony 3.0 codebase + +Configure faultloggerd service to place Unix socket in /run instead of /dev (where +they obviously does not belong). + +Having a dedicated directory for this makes it easier to handle permissions in a +safe way. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Inappropriate [configuration] + +diff --git a/interfaces/innerkits/faultloggerd_client/faultloggerd_client.cpp b/interfaces/innerkits/faultloggerd_client/faultloggerd_client.cpp +index 704ae9c0cbd7..4456eb29b87c 100644 +--- a/interfaces/innerkits/faultloggerd_client/faultloggerd_client.cpp ++++ b/interfaces/innerkits/faultloggerd_client/faultloggerd_client.cpp +@@ -31,11 +31,7 @@ + + namespace { + static const int32_t SOCKET_BUFFER_SIZE = 256; +-#if defined(USE_MUSL) +-static const char FAULTLOGGERD_SOCK_PATH[] = "/dev/unix/socket/faultloggerd.server"; +-#else +-static const char FAULTLOGGERD_SOCK_PATH[] = "/dev/socket/faultloggerd.server"; +-#endif ++static const char FAULTLOGGERD_SOCK_PATH[] = "/run/openharmony/faultlogger/server"; + } + + static int ReadFileDescriptorFromSocket(int socket) diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/foundation_ace_engine-race-condition-workaround.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/foundation_ace_engine-race-condition-workaround.patch new file mode 100644 index 0000000000000000000000000000000000000000..d6a398ab2e63449131e32a1d583601c1374e46d7 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/foundation_ace_engine-race-condition-workaround.patch @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Apply to foundation/ace/ace_engine repository of OpenHarmony 3.0.1 codebase. + +When starting up abilities, there is a race condition between OnSurfaceChanged +and RunPage, which both are executed as PostTask on the same task executor. This +executor works in FIFO mode, and if (when) the OnSurfaceChanged comes first, it +will fail with a nullptr check on runningPage_. This is because the runningPage_ +variable is set by the RunPage PostTask. + +This patch is obviously just a workaround, and not a proper fix. Hopefully, 500 +ms will be enough in all relevant situations, but at least in theory, the +problem can still appear. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Invalid [workaround] + +diff --git a/adapter/ohos/cpp/ace_container.cpp b/adapter/ohos/cpp/ace_container.cpp +index 9dea6db1e527..ac3e280eacb5 100644 +--- a/adapter/ohos/cpp/ace_container.cpp ++++ b/adapter/ohos/cpp/ace_container.cpp +@@ -348,8 +366,12 @@ void AceContainer::InitializeCallback() + + auto&& viewChangeCallback = [context = pipelineContext_](int32_t width, int32_t height) { + ACE_SCOPED_TRACE("ViewChangeCallback(%d, %d)", width, height); +- context->GetTaskExecutor()->PostTask( +- [context, width, height]() { context->OnSurfaceChanged(width, height); }, TaskExecutor::TaskType::UI); ++ LOGI("context->OnSurfaceChanged [PostTask]"); ++ // This has been observed racing with QjsEngineInstance::FireJsEvent(), ++ // so we delay this slightly as a kind of workaround... ++ LOGI("Scheduling OnSurfaceChanged to be run in 500 ms to workaround race condition with RunPage"); ++ context->GetTaskExecutor()->PostDelayedTask( ++ [context, width, height]() { context->OnSurfaceChanged(width, height); }, TaskExecutor::TaskType::UI, 500); + }; + aceView_->RegisterViewChangeCallback(viewChangeCallback); + diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hdc-log-message-cleanup.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hdc-log-message-cleanup.patch new file mode 100644 index 0000000000000000000000000000000000000000..cd21ae2f08904da68cd106182e4281b6eb521e7a --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hdc-log-message-cleanup.patch @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Downgrade log level for 3 very noice, and not very informative log messages from +warning to debug. They were never warning messages anyway. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/src/common/session.cpp b/src/common/session.cpp +index b691ed4fa0af..15e337cc3d6d 100644 +--- a/src/common/session.cpp ++++ b/src/common/session.cpp +@@ -731,20 +731,20 @@ int HdcSessionBase::SendByProtocol(HSession hSession, uint8_t *bufPtr, const int + int ret = 0; + switch (hSession->connType) { + case CONN_TCP: { +- WRITE_LOG(LOG_WARN, "CONN_TCP serverOrDaemon:%d", hSession->serverOrDaemon); ++ WRITE_LOG(LOG_DEBUG, "CONN_TCP serverOrDaemon:%d", hSession->serverOrDaemon); + if (echo && !hSession->serverOrDaemon) { + ret = Base::SendToStreamEx((uv_stream_t *)&hSession->hChildWorkTCP, bufPtr, bufLen, + nullptr, (void *)FinishWriteSessionTCP, bufPtr); + } else { + if (hSession->hWorkThread == uv_thread_self()) { + +- WRITE_LOG(LOG_WARN, "CONN_TCP:%s serverOrDaemon:%d", bufPtr, ++ WRITE_LOG(LOG_DEBUG, "CONN_TCP:%s serverOrDaemon:%d", bufPtr, + hSession->serverOrDaemon); + WRITE_LOG(LOG_WARN, "SendByProtocol %p size:%lu", hSession->hWorkTCP, bufLen); + ret = Base::SendToStreamEx((uv_stream_t *)&hSession->hWorkTCP, bufPtr, bufLen, + nullptr, (void *)FinishWriteSessionTCP, bufPtr); + } else if (hSession->hWorkChildThread == uv_thread_self()) { +- WRITE_LOG(LOG_WARN, "CONN_TCP 2:%s serverOrDaemon:%d", bufPtr, ++ WRITE_LOG(LOG_DEBUG, "CONN_TCP 2:%s serverOrDaemon:%d", bufPtr, + hSession->serverOrDaemon); + ret = Base::SendToStreamEx((uv_stream_t *)&hSession->hChildWorkTCP, bufPtr, + bufLen, nullptr, (void *)FinishWriteSessionTCP, diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..3877e4e21c256871c203c257b82bcceb81bfa968 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-sd-notify.patch @@ -0,0 +1,67 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/hiviewdfx/hilog of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to hilogd service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn +index 28a55a72e3f6..04ef88045c3a 100644 +--- a/frameworks/native/BUILD.gn ++++ b/frameworks/native/BUILD.gn +@@ -67,7 +67,6 @@ ohos_shared_library("libhilogutil") { + "dgram_socket_server.cpp", + "format.cpp", + "seq_packet_socket_client.cpp", +- "seq_packet_socket_server.cpp", + "socket.cpp", + "socket_client.cpp", + "socket_server.cpp", +diff --git a/frameworks/native/seq_packet_socket_server.cpp b/frameworks/native/seq_packet_socket_server.cpp +index c8665b22dbde..a7f4a2e2e1b9 100644 +--- a/frameworks/native/seq_packet_socket_server.cpp ++++ b/frameworks/native/seq_packet_socket_server.cpp +@@ -18,6 +18,8 @@ + #include <thread> + #include <iostream> + ++#include <systemd/sd-daemon.h> ++ + namespace OHOS { + namespace HiviewDFX { + int SeqPacketSocketServer::AcceptConnection(AcceptingHandler func) +@@ -30,7 +32,9 @@ int SeqPacketSocketServer::AcceptConnection(AcceptingHandler func) + return ret; + } + ++ sd_notify(0, "READY=1"); + AcceptingThread(func); ++ sd_notify(0, "STOPPING=1"); + + return ret; + } +diff --git a/services/hilogd/BUILD.gn b/services/hilogd/BUILD.gn +index e241cd5b412b..7e4e9cca157f 100644 +--- a/services/hilogd/BUILD.gn ++++ b/services/hilogd/BUILD.gn +@@ -31,6 +31,7 @@ ohos_executable("hilogd") { + "log_querier.cpp", + "log_reader.cpp", + "main.cpp", ++ "//base/hiviewdfx/hilog/frameworks/native/seq_packet_socket_server.cpp", + ] + configs = [ ":hilogd_config" ] + defines = [ "__RECV_MSG_WITH_UCRED_" ] +@@ -41,6 +42,7 @@ ohos_executable("hilogd") { + "//third_party/zlib:libz", + "//utils/native/base:utilsecurec_shared", + ] ++ libs = [ "systemd" ] + + deps += [ "etc:hilogd_etc" ] + diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-socket-paths.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-socket-paths.patch new file mode 100644 index 0000000000000000000000000000000000000000..4690b7a74311ebc3597bdbdb85e89c2b6f4c8951 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hilog-socket-paths.patch @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Configure hilogd daemon and hilog command to place Unix sockets in +/run/openharmony/hilog instead of /dev/unix/socket, thus making it easier to +handle permissions, and allow doing it in a way that is more safe. + +The /run/hilog can be created with permissions so that only hilogd can create +new files in there, which obviously is not possible with a /dev/unix/socket dir +shared with other daemons (running with different uid/gid). + +Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com> +Upstream-Status: Inappropriate [configuration] + +diff --git a/frameworks/native/include/hilog_common.h b/frameworks/native/include/hilog_common.h +index e6e365f0c888..7bf1ec70d325 100644 +--- a/frameworks/native/include/hilog_common.h ++++ b/frameworks/native/include/hilog_common.h +@@ -18,14 +18,10 @@ + + #include <cstdint> + +-#ifdef HILOG_USE_MUSL +-#define SOCKET_FILE_DIR "/dev/unix/socket/" +-#else +-#define SOCKET_FILE_DIR "/dev/socket/" +-#endif +-#define INPUT_SOCKET_NAME "hilogInput" ++#define SOCKET_FILE_DIR "/run/openharmony/hilog/" ++#define INPUT_SOCKET_NAME "input" + #define INPUT_SOCKET SOCKET_FILE_DIR INPUT_SOCKET_NAME +-#define CONTROL_SOCKET_NAME "hilogControl" ++#define CONTROL_SOCKET_NAME "control" + #define CONTROL_SOCKET SOCKET_FILE_DIR CONTROL_SOCKET_NAME + #define HILOG_FILE_DIR "/data/log/hilog/" + diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hisysevent-socket-path.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hisysevent-socket-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..5060c28ba0cd2a610747c3dbfe3a15b63cdaf500 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hisysevent-socket-path.patch @@ -0,0 +1,17 @@ +diff --git a/interfaces/native/innerkits/hisysevent.cpp b/interfaces/native/innerkits/hisysevent.cpp +index 473e84241605..2309158193fe 100644 +--- a/interfaces/native/innerkits/hisysevent.cpp ++++ b/interfaces/native/innerkits/hisysevent.cpp +@@ -49,11 +49,7 @@ static constexpr unsigned int MAX_PARAM_NUMBER = 128; + static constexpr unsigned int MAX_STRING_LENGTH = 256 * 1024; + static constexpr unsigned int MAX_JSON_SIZE = 384 * 1024; + +-#ifdef USE_MUSL +-static constexpr char SOCKET_FILE_DIR[] = "/dev/unix/socket/hisysevent"; +-#else +-static constexpr char SOCKET_FILE_DIR[] = "/dev/socket/hisysevent"; +-#endif ++static constexpr char SOCKET_FILE_DIR[] = "/run/openharmony/hiview/hisysevent"; + + static constexpr HiLogLabel LABEL = { LOG_CORE, 0xD002D08, "HISYSEVENT" }; + diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bfd3155e4f4e785c44b76ccade8b9bf247b96b7 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-sd-notify.patch @@ -0,0 +1,33 @@ +diff --git a/adapter/service/idl/BUILD.gn b/adapter/service/idl/BUILD.gn +index 1120463e2264..320a8809472c 100644 +--- a/adapter/service/idl/BUILD.gn ++++ b/adapter/service/idl/BUILD.gn +@@ -43,6 +43,7 @@ ohos_source_set("hiview_service_impl") { + "$hiview_base:hiviewbase", + "//utils/native/base:utils", + ] ++ libs = [ "systemd"] + + external_deps = [ + "hilog_native:libhilog", +diff --git a/adapter/service/idl/src/hiview_service_ability.cpp b/adapter/service/idl/src/hiview_service_ability.cpp +index 757c0dbfd575..a2f1cc58845e 100644 +--- a/adapter/service/idl/src/hiview_service_ability.cpp ++++ b/adapter/service/idl/src/hiview_service_ability.cpp +@@ -18,6 +18,8 @@ + #include <cstdio> + #include <unistd.h> + ++#include <systemd/sd-daemon.h> ++ + #include "system_ability_definition.h" + #include "iservice_registry.h" + #include "ipc_skeleton.h" +@@ -89,6 +91,7 @@ void HiviewServiceAbility::StartServiceAbility(int sleepS) + if (ret == false) { + HIVIEW_LOGE("AddDeathRecipient == false"); + } ++ sd_notify(0, "READY=1"); + } + + void HiviewServiceAbility::StartService(HiviewService *service) diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-socket-path.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-socket-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce68d9702ba94e771ecf863e189d6ade4a296ed1 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/hiview-socket-path.patch @@ -0,0 +1,17 @@ +diff --git a/core/event_server.cpp b/core/event_server.cpp +index 438b01ed59ea..081ecdcd9936 100644 +--- a/core/event_server.cpp ++++ b/core/event_server.cpp +@@ -34,11 +34,7 @@ extern "C" { + #include "logger.h" + #include "socket_util.h" + +-#ifdef USE_MUSL +-#define SOCKET_FILE_DIR "/dev/unix/socket/hisysevent" +-#else +-#define SOCKET_FILE_DIR "/dev/socket/hisysevent" +-#endif ++#define SOCKET_FILE_DIR "/run/openharmony/hiview/hisysevent" + + namespace OHOS { + namespace HiviewDFX { diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/init_lite-log-to-stderr.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/init_lite-log-to-stderr.patch new file mode 100644 index 0000000000000000000000000000000000000000..9d3d7e4372ab115426f3820a6f8b29df41f63739 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/init_lite-log-to-stderr.patch @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +This patch is for //base/startup/init_lite repository of OpenHarmony 3.0 + +Write log output to stderr instead of /dev/kmsg, which can be directed to +systemd journal when run as a systemd service. This is for the param service, +which is a dependency of hilog, which we can therefore not log to. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/services/log/init_log.c b/services/log/init_log.c +index 852be3d43b89..7314c6fb8c40 100644 +--- a/services/log/init_log.c ++++ b/services/log/init_log.c +@@ -17,6 +17,7 @@ + #include <errno.h> + #include <fcntl.h> + #include <stdarg.h> ++#include <unistd.h> + #include <sys/stat.h> + #include <time.h> + #include "securec.h" +@@ -65,16 +66,6 @@ void InitToHiLog(LogLevel logLevel, const char *fmt, ...) + } + #endif + +-static int g_fd = -1; +-void OpenLogDevice(void) +-{ +- int fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IRGRP); +- if (fd >= 0) { +- g_fd = fd; +- } +- return; +-} +- + void EnableDevKmsg(void) + { + /* printk_devkmsg default value is ratelimit, We need to set "on" and remove the restrictions */ +@@ -96,33 +87,20 @@ void InitLog(InitLogLevel logLevel, const char *fileName, int line, const char * + return; + } + +- if (UNLIKELY(g_fd < 0)) { +- OpenLogDevice(); +- if (g_fd < 0) { +- return; +- } +- } + va_list vargs; + va_start(vargs, fmt); + char tmpFmt[MAX_LOG_SIZE]; + if (vsnprintf_s(tmpFmt, MAX_LOG_SIZE, MAX_LOG_SIZE - 1, fmt, vargs) == -1) { +- close(g_fd); +- g_fd = -1; + return; + } + + char logInfo[MAX_LOG_SIZE]; + if (snprintf_s(logInfo, MAX_LOG_SIZE, MAX_LOG_SIZE - 1, "%s[pid=%d][%s:%d][%s][%s] %s", + kLevel, getpid(), fileName, line, INIT_LOG_TAG, LOG_LEVEL_STR[logLevel], tmpFmt) == -1) { +- close(g_fd); +- g_fd = -1; + return; + } + va_end(vargs); + +- if (write(g_fd, logInfo, strlen(logInfo)) < 0) { +- close(g_fd); +- g_fd = -1; +- } ++ write(STDERR_FILENO, logInfo, strlen(logInfo)); + return; + } diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/installs-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/installs-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..44942d220b0f5bd753bf0c9011c9aa350edc3a50 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/installs-sd-notify.patch @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //foundation/appexecfwk/standard of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to installd service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/services/bundlemgr/BUILD.gn b/services/bundlemgr/BUILD.gn +index 4d227c32c520..305ddd13e279 100755 +--- a/services/bundlemgr/BUILD.gn ++++ b/services/bundlemgr/BUILD.gn +@@ -200,6 +200,7 @@ ohos_executable("installs") { + "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", + "//third_party/jsoncpp:jsoncpp", + ] ++ libs = [ "systemd" ] + + external_deps = [ + "hiviewdfx_hilog_native:libhilog", +diff --git a/services/bundlemgr/src/installd/installd_main.cpp b/services/bundlemgr/src/installd/installd_main.cpp +index 7f03862f1e9d..600664463c26 100644 +--- a/services/bundlemgr/src/installd/installd_main.cpp ++++ b/services/bundlemgr/src/installd/installd_main.cpp +@@ -18,6 +18,8 @@ + #include "app_log_wrapper.h" + #include "installd/installd_service.h" + ++#include <systemd/sd-daemon.h> ++ + int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv) + { + using namespace OHOS::AppExecFwk; +@@ -35,8 +37,10 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv) + std::exit(EXIT_FAILURE); + } + } ++ sd_notify(0, "READY=1"); + OHOS::IPCSkeleton::JoinWorkThread(); ++ sd_notify(0, "STOPPING=1"); + service->Stop(); + APP_LOGE("installd service stopped"); + return EXIT_SUCCESS; +-} +\ No newline at end of file ++} diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/param-paths.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/param-paths.patch new file mode 100644 index 0000000000000000000000000000000000000000..5cac0a71b9016896e863039a8e1ffd7f4e7323dd --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/param-paths.patch @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/startup/init_lite of OpenHarmony 3.0 codebase + +Configure param service and getparam/setparam commands to place files and pipes +in /run instead of /dev (where they obviously does not belong). + +Having a dedicated directory for this makes it easier to handle permissions in a +safe way. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Inappropriate [configuration] + +diff --git a/services/param/include/param_manager.h b/services/param/include/param_manager.h +index ad605b0c2741..7edad26d777a 100644 +--- a/services/param/include/param_manager.h ++++ b/services/param/include/param_manager.h +@@ -43,17 +43,10 @@ typedef enum { + + #define LABEL_STRING_LEN 128 + +-#ifdef STARTUP_LOCAL +-#define PIPE_NAME "/tmp/paramservice" +-#define PARAM_STORAGE_PATH "/media/sf_ubuntu/test/__parameters__/param_storage" +-#define PARAM_PERSIST_PATH "/media/sf_ubuntu/test/param/persist_parameters" +-#define PARAM_INFO_PATH "/media/sf_ubuntu/test/__parameters__/param_info" +-#else +-#define PIPE_NAME "/dev/unix/socket/paramservice" +-#define PARAM_STORAGE_PATH "/dev/__parameters__/param_storage" ++#define PIPE_NAME "/run/openharmony/param/pipe" ++#define PARAM_STORAGE_PATH "/run/openharmony/param/storage" + #define PARAM_PERSIST_PATH "/data/param/persist_parameters" +-#define PARAM_INFO_PATH "/dev/__parameters__/param_info" +-#endif ++#define PARAM_INFO_PATH "/run/openharmony/param/info" + + #define SUBSTR_INFO_NAME 0 + #define SUBSTR_INFO_LABEL 1 diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/param_service-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/param_service-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..051bd1a009be6fe43f3300473f6ec2205402212b --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/param_service-sd-notify.patch @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //base/startup/init_lite of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to param_service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/services/param/BUILD.gn b/services/param/BUILD.gn +index 07e1d2784915..d8a8110f0ec6 100644 +--- a/services/param/BUILD.gn ++++ b/services/param/BUILD.gn +@@ -38,6 +38,7 @@ ohos_static_library("paramservice") { + "//third_party/bounds_checking_function:libsec_static", + "//third_party/libuv:uv_static", + ] ++ libs = [ "systemd" ] + part_name = "init" + subsystem_name = "startup" + } +diff --git a/services/param/service/param_service.c b/services/param/service/param_service.c +index cd5d93be3ff6..1b5bb213d257 100644 +--- a/services/param/service/param_service.c ++++ b/services/param/service/param_service.c +@@ -20,6 +20,8 @@ + #include <string.h> + #include <unistd.h> + ++#include <systemd/sd-daemon.h> ++ + #include "init_param.h" + #include "init_utils.h" + #include "param_manager.h" +@@ -252,7 +254,9 @@ int StartParamService() + PARAM_CHECK(ret == 0, return ret, "Failed to chmod %s, err %d. ", PIPE_NAME, errno); + ret = uv_listen((uv_stream_t*)&pipeServer, SOMAXCONN, OnConnection); + PARAM_CHECK(ret == 0, return ret, "Failed to uv_listen %d %s", ret, uv_err_name(ret)); ++ sd_notify(0, "READY=1"); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); ++ sd_notify(0, "STOPPING=1"); + PARAM_LOGI("Start service exit."); + return 0; + } diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/safwk-sd-notify.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/safwk-sd-notify.patch new file mode 100644 index 0000000000000000000000000000000000000000..fc3a34d9cf27119c190aabc8096b3c68d7be2e8c --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/safwk-sd-notify.patch @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //foundation/distributedschedule/safwk of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to sa_main command for better +integration of OpenHarmony system abilities with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +diff --git a/interfaces/innerkits/safwk/BUILD.gn b/interfaces/innerkits/safwk/BUILD.gn +index 6f14e14ab191..934cb01d78fb 100755 +--- a/interfaces/innerkits/safwk/BUILD.gn ++++ b/interfaces/innerkits/safwk/BUILD.gn +@@ -53,6 +53,7 @@ ohos_shared_library("system_ability_fwk") { + ] + public_deps = [ "//third_party/libxml2:libxml2" ] + } ++ libs = [ "systemd" ] + + part_name = "safwk" + subsystem_name = "distributedschedule" +diff --git a/services/safwk/src/local_ability_manager.cpp b/services/safwk/src/local_ability_manager.cpp +index 5e29f327da60..3fcd1acf9a5a 100755 +--- a/services/safwk/src/local_ability_manager.cpp ++++ b/services/safwk/src/local_ability_manager.cpp +@@ -22,6 +22,8 @@ + #include <sys/types.h> + #include <unistd.h> + ++#include <systemd/sd-daemon.h> ++ + #include "datetime_ex.h" + #include "errors.h" + #include "ipc_skeleton.h" +@@ -775,7 +777,8 @@ bool LocalAbilityManager::Run() + + FindAndStartPhaseTasks(); + RegisterOnDemandSystemAbility(); ++ sd_notify(0, "READY=1"); + pool_.Stop(); + return true; + } + 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..7c4010f7d5ce0829c77944e8f9786d683a99bed2 --- /dev/null +++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/samgr-sd-notify.patch @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Patch for //foundation/distributedschedule/samgr of OpenHarmony 3.0 codebase + +This adds sd_notify(3) ready notification to samgr service for better +integration with systemd. + +Signed-off-by: Esben Haabendal <esben@geanix.com> +Upstream-Status: Pending + +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/test-xts-acts-start-ability-timeout-increment.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch deleted file mode 100644 index a8161e11d5f44ea3566b8e3331dd86bdfe1c6972..0000000000000000000000000000000000000000 --- a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# -# SPDX-License-Identifier: Apache-2.0 - -current START_ABILITY_TIMEOUT is too short, causing some -testcases in ActsBmsModuleUsageRecordTest and FeatureAbilityJsunit to -exceed timeout. -Increasing the timeout to 15 seconds. - -Apply to test/xts/acts - -Upstream-Status: Pending - -Signed-off-by: Francesco Pham <francesco.pham@huawei.com> - -diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -index b2a603467..50d9ac07d 100644 ---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js -@@ -17,7 +17,7 @@ import wantconstant from '@ohos.ability.wantConstant' - import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - import commonEvent from '@ohos.commonevent' - --const START_ABILITY_TIMEOUT = 4000; -+const START_ABILITY_TIMEOUT = 15000; - const TERMINATE_ABILITY_TIMEOUT = 1000; - const TIMEOUT = 1000; - var subscriberInfo_ACTS_StartAbility_0100 = { -diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js -index d4068900a..1510b6608 100644 ---- a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js -+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js -@@ -24,7 +24,7 @@ const BUNDLE_NAME = 'com.example.third1'; - const NUM_TWO = 2; - const NUM_TEN = 10; - const INVALID_NUM = -1; --const START_ABILITY_TIMEOUT = 3000; -+const START_ABILITY_TIMEOUT = 15000; - const START_RECORD = 900; - const TIMEOUT = 3000; - diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch deleted file mode 100644 index 1b3ae4c48fa04b7610148f81c9df4d5f0452a0d3..0000000000000000000000000000000000000000 --- a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch +++ /dev/null @@ -1,86 +0,0 @@ -# SPDX-FileCopyrightText: Huawei Inc. -# -# SPDX-License-Identifier: Apache-2.0 - -The default test timeout is 5000ms which is too short, causing some testcases -to exceed timeout. Increasing the timeout to 20 seconds. - -Apply to test/xts/acts - -Upstream-Status: Pending - -Signed-off-by: Francesco Pham <francesco.pham@huawei.com> - -diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js -index 095743b34..ecffc80a9 100644 ---- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js -+++ b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js -@@ -36,6 +36,7 @@ export default { - core.init() - - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test') -diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js -index 362bbb390..2cec00ce8 100644 ---- a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js -+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js -@@ -31,6 +31,7 @@ export default { - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test') -diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js -index 6bb4ad1c3..216571d89 100644 ---- a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js -+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js -@@ -31,6 +31,7 @@ export default { - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test.js') -diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js -index 9b47685ef..f06cde28f 100644 ---- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js -+++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js -@@ -32,6 +32,7 @@ export default { - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test') -diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js -index 398d8b4d7..31f6f45f6 100644 ---- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js -+++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js -@@ -31,6 +31,7 @@ export default { - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test') - -diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js -index 604c4fe49..c6acf358d 100644 ---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js -+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js -@@ -33,6 +33,7 @@ export default { - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') -+ this.timeout = 20000 - configService.setConfig(this) - - require('../../../test/List.test') diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index 10704a459a71e967aebae98faf9e917aaa86fdaf..3a09c0240fc9e7e5201864cdb8e8503f1722398a 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -19,6 +19,9 @@ DEPENDS += "bison-native" DEPENDS += "ruby-native" DEPENDS += "packing-tool-native" +# We are adding sd_notify(3) calls to OpenHarmony services +DEPENDS += "systemd" + # Note: Using include instead of require to avoid parser error skipping recipe include ${PN}-sources-${OPENHARMONY_VERSION}.inc @@ -32,6 +35,8 @@ SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d # TODO: we probably want these SRC_URI += "file://hilog-Add-tests.patch;patchdir=${S}/base/hiviewdfx/hilog" +SRC_URI += "file://hilog-socket-paths.patch;patchdir=${S}/base/hiviewdfx/hilog" +SRC_URI += "file://hilog-sd-notify.patch;patchdir=${S}/base/hiviewdfx/hilog" SRC_URI += "file://bison_parser.patch;patchdir=${S}/third_party/libxkbcommon" SRC_URI += "file://flexlexer.patch;patchdir=${S}/base/update/updater" @@ -41,6 +46,7 @@ SRC_URI += "file://jsframwork-use-yocto-node.patch;patchdir=${S}/third_party/jsf SRC_URI += "file://ts2abc-don-t-set-node_path-for-Linux-host-toolchain.patch;patchdir=${S}/ark/ts2abc" SRC_URI += "file://hdc-build-system-files.patch;patchdir=${S}/developtools/hdc_standard" +SRC_URI += "file://hdc-log-message-cleanup.patch;patchdir=${S}/developtools/hdc_standard" SRC_URI += "file://build_packing-tool-path.patch;patchdir=${S}/build" SRC_URI += "file://build_node-path.patch;patchdir=${S}/build" SRC_URI += "file://build_js_assets.patch;patchdir=${S}/build" @@ -61,26 +67,38 @@ SRC_URI += "file://graphic-standard-vsync-log-spam.patch;patchdir=${S}/foundatio SRC_URI += "file://appspawn-procps.patch;patchdir=${S}/base/startup/appspawn_standard" SRC_URI += "file://base_startup_appspawn_standard-disable-longProcName-resetting.patch;patchdir=${S}/base/startup/appspawn_standard" +SRC_URI += "file://appspawn-sd-notify.patch;patchdir=${S}/base/startup/appspawn_standard" +SRC_URI += "file://appspawn-socket-path.patch;patchdir=${S}/base/startup/appspawn_standard" SRC_URI += "file://test_xts_acts-Align-tests-list-with-mandatory-set.patch;patchdir=${S}/test/xts/acts" SRC_URI += "file://init_lite-silence-GetControlFromEnv-spam.patch;patchdir=${S}/base/startup/init_lite" SRC_URI += "file://param_service_standalone.patch;patchdir=${S}/base/startup/init_lite" +SRC_URI += "file://param_service-sd-notify.patch;patchdir=${S}/base/startup/init_lite" +SRC_URI += "file://param-paths.patch;patchdir=${S}/base/startup/init_lite" +SRC_URI += "file://init_lite-log-to-stderr.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://safwk-sd-notify.patch;patchdir=${S}/foundation/distributedschedule/safwk" +SRC_URI += "file://installs-sd-notify.patch;patchdir=${S}/foundation/appexecfwk/standard" +SRC_URI += "file://deviceauth-sd-notify.patch;patchdir=${S}/base/security/deviceauth" + SRC_URI += "file://base_hiviewdfx_hiview-libfaultlogger-static.patch;patchdir=${S}/base/hiviewdfx/hiview" +SRC_URI += "file://faultloggerd-socket-path.patch;patchdir=${S}/base/hiviewdfx/faultloggerd" +SRC_URI += "file://faultloggerd-sd-notify.patch;patchdir=${S}/base/hiviewdfx/faultloggerd" + +SRC_URI += "file://hiview-sd-notify.patch;patchdir=${S}/base/hiviewdfx/hiview" +SRC_URI += "file://hiview-socket-path.patch;patchdir=${S}/base/hiviewdfx/hiview" +SRC_URI += "file://hisysevent-socket-path.patch;patchdir=${S}/base/hiviewdfx/hisysevent" # Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony SRC_URI += "file://foundation_distributedschedule_safwk-slash-system-symlink.patch;patchdir=${S}/foundation/distributedschedule/safwk" -SRC_URI += "file://test-xts-acts-testcase-timeout-increment.patch;patchdir=${S}/test/xts/acts" -SRC_URI += "file://test-xts-acts-start-ability-timeout-increment.patch;patchdir=${S}/test/xts/acts" SRC_URI += "file://test-xts-acts-fix-Defpermission-typo.patch;patchdir=${S}/test/xts/acts" SRC_URI += "file://test-xts-acts-fix-faultloggertest.patch;patchdir=${S}/test/xts/acts" SRC_URI += "file://test-xts-acts-fix-hicolliecpptest.patch;patchdir=${S}/test/xts/acts" -SRC_URI += "file://ace_engine-disable-create-component.patch;patchdir=${S}/foundation/ace/ace_engine" SRC_URI += "file://test-xts-acts-increase-testsuite-timeouts.patch;patchdir=${S}/test/xts/acts" -SRC_URI += "file://actsgetwantalltest-wait-between-testcases.patch;patchdir=${S}/test/xts/acts" -SRC_URI += "file://actsfeatureabilitytest-wait-between-testcases.patch;patchdir=${S}/test/xts/acts" +SRC_URI += "file://foundation_ace_engine-race-condition-workaround.patch;patchdir=${S}/foundation/ace/ace_engine" inherit python3native gn_base ptest @@ -195,6 +213,10 @@ symlink_python3() { ln -sf $(which python3) ${STAGING_BINDIR_NATIVE}/python } +SRC_URI += "file://start_service file://stop_service" +SRC_URI += "file://param" +SRC_URI += "file://ohos.para" + do_install () { OHOS_PACKAGE_OUT_DIR="${B}/packages/${OHOS_PRODUCT_PLATFORM_TYPE}" @@ -223,6 +245,8 @@ do_install () { mkdir -p ${D}${sysconfdir}/openharmony cp -r ${OHOS_PACKAGE_OUT_DIR}/system/etc/* ${D}${sysconfdir}/openharmony ln -sfT ..${sysconfdir}/openharmony ${D}/system/etc + # Overwrite the OpenHarmony provideded parameter file + install -m 0644 -t ${D}${sysconfdir}/openharmony ${WORKDIR}/ohos.para # OpenHarmony font files mkdir -p ${D}${datadir}/fonts/openharmony @@ -232,6 +256,16 @@ do_install () { # Avoid file-conflict on /usr/bin/udevadm with //third_party/eudev and udev # recipe rm ${D}${bindir}/udevadm + + # Wrapper scripts for systemctl, which is at least used by ACTS + mkdir -p ${D}${sbindir} + install -t ${D}${sbindir} -m 0755 \ + ${WORKDIR}/start_service \ + ${WORKDIR}/stop_service + + # Wrapper script for setparam/getparam, used by hdc (3.1 version) + install -t ${D}${sbindir} -m 0755 \ + ${WORKDIR}/param } PACKAGES =+ "${PN}-configs ${PN}-fonts" @@ -406,6 +440,18 @@ copy_subsystem_config_json_file() { inherit systemd SYSTEMD_AUTO_ENABLE = "enable" +SRC_URI += "file://40-binder.rules" +SRC_URI += "file://40-ashmem.rules" +SRC_URI += "file://40-drm.rules" +do_install_udev_rules() { + mkdir -p ${D}${nonarch_base_libdir}/udev/rules.d + install -m 644 -t ${D}${nonarch_base_libdir}/udev/rules.d \ + ${WORKDIR}/40-binder.rules \ + ${WORKDIR}/40-ashmem.rules \ + ${WORKDIR}/40-drm.rules +} +do_install[postfuncs] += "do_install_udev_rules" + # OpenHarmony pre-init package and its systemd service # Used to create folders needed by OH services and components PACKAGES =+ "${PN}-openharmony-preinit" @@ -448,11 +494,14 @@ RDEPENDS:${PN}-ptest += "${PN}-libutils-ptest" # //base/hiviewdfx/hilog component PACKAGES =+ "${PN}-hilog" SYSTEMD_PACKAGES += "${PN}-hilog" -SYSTEMD_SERVICE:${PN}-hilog = "hilogd.service" -SRC_URI += "file://hilogd.service" +SYSTEMD_SERVICE:${PN}-hilog = "hilogd.service hilogd-input.socket hilogd-control.socket" +SRC_URI += "file://hilogd.service file://hilogd-input.socket file://hilogd-control.socket" do_install:append() { install -d ${D}/${systemd_unitdir}/system - install -m 644 ${WORKDIR}/hilogd.service ${D}${systemd_unitdir}/system/ + install -m 644 -t ${D}${systemd_unitdir}/system/ \ + ${WORKDIR}/hilogd.service \ + ${WORKDIR}/hilogd-input.socket \ + ${WORKDIR}/hilogd-control.socket rm -f ${D}${sysconfdir}/openharmony/init/hilogd.cfg install -d ${D}${sysconfdir}/sysctl.d echo "net.unix.max_dgram_qlen=600" > ${D}${sysconfdir}/sysctl.d/hilogd.conf @@ -461,9 +510,8 @@ FILES:${PN}-hilog = " \ ${bindir}/hilog* \ ${libdir}/libhilog*${SOLIBS} \ ${sysconfdir}/openharmony/hilog*.conf \ - ${systemd_unitdir}/hilogd.service \ " -RDEPENDS:${PN}-hilog += "musl libcxx" +RDEPENDS:${PN}-hilog += "musl libcxx libsystemd" RDEPENDS:${PN}-hilog += "${PN}-libutilsecurec" RDEPENDS:${PN} += "${PN}-hilog" @@ -492,9 +540,8 @@ do_install:append() { FILES:${PN}-appspawn = " \ ${bindir}/appspawn \ ${libdir}/libappspawn*${SOLIBS} \ - ${systemd_unitdir}/appspawnd.service \ " -RDEPENDS:${PN}-appspawn += "musl libcxx" +RDEPENDS:${PN}-appspawn += "musl libcxx libsystemd" RDEPENDS:${PN}-appspawn += "${PN}-libutils ${PN}-hilog ${PN}-appexecfwk" RDEPENDS:${PN} += "${PN}-appspawn" @@ -510,7 +557,7 @@ do_install_ptest:append() { } FILES:${PN}-appspawn-ptest = "${libdir}/${BPN}-appspawn/ptest" RDEPENDS:${PN}-appspawn-ptest += "${PN}-appspawn" -RDEPENDS:${PN}-appspawn-ptest += "musl libcxx" +RDEPENDS:${PN}-appspawn-ptest += "musl libcxx libsystemd" RDEPENDS:${PN}-appspawn-ptest += "${PN}-libutils ${PN}-hilog ${PN}-appexecfwk" RDEPENDS:${PN}-ptest += "${PN}-appspawn-ptest" @@ -542,7 +589,7 @@ FILES:${PN}-appexecfwk = "\ ${libdir}/module/libnapi_app_mgr*${SOLIBS} \ ${libdir}/openharmony/profile/foundation.xml \ " -RDEPENDS:${PN}-appexecfwk += "musl libcxx" +RDEPENDS:${PN}-appexecfwk += "musl libcxx libsystemd" RDEPENDS:${PN}-appexecfwk += "${PN}-libutils ${PN}-hilog ${PN}-samgr ${PN}-ipc ${PN}-appverify ${PN}-distributeddatamgr ${PN}-notification-ces" RDEPENDS:${PN}-appexecfwk += "${PN}-security-permission ${PN}-appspawn ${PN}-safwk ${PN}-timeservice ${PN}-powermgr ${PN}-dmsfwk ${PN}-resmgr" RDEPENDS:${PN}-appexecfwk += "${PN}-aafwk ${PN}-ace-napi" @@ -764,7 +811,6 @@ FILES:${PN}-samgr = " \ ${bindir}/samgr \ ${libdir}/libsamgr*${SOLIBS} \ ${libdir}/liblsamgr*${SOLIBS} \ - ${systemd_unitdir}/samgr.service \ " SYSTEMD_PACKAGES += "${PN}-samgr" SYSTEMD_SERVICE:${PN}-samgr = "samgr.service" @@ -774,7 +820,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" @@ -800,7 +846,7 @@ FILES:${PN}-safwk = "\ ${bindir}/sa_main \ ${libdir}/libsystem_ability_fwk*${SOLIBS} \ " -RDEPENDS:${PN}-safwk += "musl libcxx" +RDEPENDS:${PN}-safwk += "musl libcxx libsystemd" RDEPENDS:${PN}-safwk += "${PN}-libutils ${PN}-hilog ${PN}-samgr ${PN}-ipc" RDEPENDS:${PN}-safwk += "${PN}-thirdparty-libxml2" RDEPENDS:${PN} += "${PN}-safwk" @@ -1043,7 +1089,7 @@ FILES:${PN}-security-deviceauth = " \ ${bindir}/deviceauth_service \ ${libdir}/libdeviceauth*${SOLIBS} \ " -RDEPENDS:${PN}-security-deviceauth += "musl libcxx libcrypto" +RDEPENDS:${PN}-security-deviceauth += "musl libcxx libcrypto libsystemd" RDEPENDS:${PN}-security-deviceauth += "${PN}-hilog ${PN}-libutils ${PN}-ipc ${PN}-samgr" RDEPENDS:${PN}-security-deviceauth += "${PN}-security-huks ${PN}-syspara ${PN}-dsoftbus" RDEPENDS:${PN} += "${PN}-security-deviceauth" @@ -1062,6 +1108,15 @@ RDEPENDS:${PN}-ptest += "${PN}-security-deviceauth-ptest" # //foundation/multimodalinput/input PACKAGES =+ "${PN}-multimodalinput" +SYSTEMD_PACKAGES += "${PN}-multimodalinput" +SYSTEMD_SERVICE:${PN}-multimodalinput = "multimodalinput.service mmi-uinput.service" +SRC_URI += "file://multimodalinput.service file://mmi-uinput.service" +do_install:append() { + install -d ${D}/${systemd_unitdir}/system + install -m 644 -t ${D}${systemd_unitdir}/system/ \ + ${WORKDIR}/multimodalinput.service \ + ${WORKDIR}/mmi-uinput.service +} FILES:${PN}-multimodalinput = " \ ${bindir}/uinput_inject \ ${libdir}/libmmi_*${SOLIBS} \ @@ -1334,7 +1389,6 @@ FILES:${PN}-graphic = " \ ${libdir}/module/libdisplay*${SOLIBS} \ ${libdir}/module/libwindow*${SOLIBS} \ ${bindir}/bootanimation \ - ${systemd_unitdir}/weston.service \ " SYSTEMD_PACKAGES += "${PN}-graphic" SYSTEMD_SERVICE:${PN}-graphic = "weston.service" @@ -1599,7 +1653,7 @@ FILES:${PN}-faultlogger = " \ ${libdir}/libfaultloggerd*${SOLIBS} \ ${libdir}/libdfx_signalhandler*${SOLIBS} \ " -RDEPENDS:${PN}-faultlogger += "musl libcxx" +RDEPENDS:${PN}-faultlogger += "musl libcxx libsystemd" RDEPENDS:${PN}-faultlogger += "${PN}-libutils ${PN}-hilog" RDEPENDS:${PN} += "${PN}-faultlogger" @@ -1630,11 +1684,20 @@ RDEPENDS:${PN} += "${PN}-thirdparty-ejdb" # //base/hiviewdfx/hiview PACKAGES =+ "${PN}-hiview" +SYSTEMD_PACKAGES += "${PN}-hiview" +SYSTEMD_SERVICE:${PN}-hiview = "hiview.service" +SRC_URI += "file://hiview.service" +do_install:append() { + install -d ${D}/${systemd_unitdir}/system + install -m 644 -t ${D}${systemd_unitdir}/system/ \ + ${WORKDIR}/hiview.service + rm -f ${D}${sysconfdir}/openharmony/init/hiview.cfg +} FILES:${PN}-hiview = " \ ${bindir}/hiview \ ${libdir}/libhiviewbase*${SOLIBS} \ " -RDEPENDS:${PN}-hiview += "musl libcxx" +RDEPENDS:${PN}-hiview += "musl libcxx libsystemd" RDEPENDS:${PN}-hiview += " \ ${PN}-libutils \ ${PN}-hilog \ @@ -1770,7 +1833,6 @@ RDEPENDS:${PN}-ptest += "${PN}-distributedhardware-devicemanager-ptest" PACKAGES =+ "${PN}-hdc" FILES:${PN}-hdc = " \ ${bindir}/hdcd \ - ${systemd_unitdir}/hdcd.service \ " SYSTEMD_PACKAGES += "${PN}-hdc" SYSTEMD_SERVICE:${PN}-hdc = "hdcd.service" @@ -1796,7 +1858,7 @@ FILES:${PN}-param-service = " \ ${bindir}/setparam \ ${bindir}/param_service \ " -RDEPENDS:${PN}-param-service += "musl libcxx" +RDEPENDS:${PN}-param-service += "musl libcxx libsystemd" RDEPENDS:${PN} += "${PN}-param-service" # Third Party Components (//third_party/*) @@ -2010,6 +2072,12 @@ 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" +USERADD_PARAM:${PN}:append = ";-u 3011 -U -s /bin/false uhid" # system haps PACKAGES =+ "${PN}-systemhaps"