From 652fce77de4a2955ef3dcd7c6f47f55bb851596f Mon Sep 17 00:00:00 2001 From: Robert Drab <robert.drab@huawei.com> Date: Mon, 29 Aug 2022 17:20:37 +0200 Subject: [PATCH] openharmony-3.0: Add OpenHarmony Weston systemd service Closes https://gitlab.eclipse.org/eclipse/oniro-core/meta-openharmony/-/issues/75 Signed-off-by: Robert Drab <robert.drab@huawei.com> Signed-off-by: Thierry Escande <thierry.escande@huawei.com> --- .../openharmony/files/openharmony-preinit | 21 +++++++++++++++++++ .../openharmony/files/weston.service | 10 +++++++++ .../openharmony/openharmony-standard_3.0.bb | 8 +++++++ 3 files changed, 39 insertions(+) create mode 100644 recipes-openharmony/openharmony/files/weston.service diff --git a/recipes-openharmony/openharmony/files/openharmony-preinit b/recipes-openharmony/openharmony/files/openharmony-preinit index 85478abb..c5cb947a 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit +++ b/recipes-openharmony/openharmony/files/openharmony-preinit @@ -116,6 +116,27 @@ fi # - "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 + /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"], diff --git a/recipes-openharmony/openharmony/files/weston.service b/recipes-openharmony/openharmony/files/weston.service new file mode 100644 index 00000000..5c82db22 --- /dev/null +++ b/recipes-openharmony/openharmony/files/weston.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenHarmony Weston window manager service + +[Service] +Type=oneshot +ExecStart=/bin/echo "OpenHarmony Weston Service" +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index 6c53f53f..231d9b25 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -1299,7 +1299,15 @@ 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" +SRC_URI += "file://weston.service" +do_install:append() { + install -d ${D}/${systemd_unitdir}/system + install -m 644 ${WORKDIR}/weston.service ${D}${systemd_unitdir}/system/ +} RDEPENDS:${PN}-graphic += "musl libcxx" RDEPENDS:${PN}-graphic += "${PN}-multimodalinput ${PN}-hilog ${PN}-libutils ${PN}-thirdparty-weston ${PN}-thirdparty-wayland ${PN}-thirdparty-libffi ${PN}-thirdparty-libinput" RDEPENDS:${PN}-graphic += "${PN}-graphic ${PN}-multimedia-media ${PN}-ipc ${PN}-display-gralloc ${PN}-samgr ${PN}-thirdparty-libdrm ${PN}-thirdparty-libevdev" -- GitLab