diff options
| author | Christian Kohn <christian.kohn@xilinx.com> | 2022-02-25 03:34:24 +0100 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@xilinx.com> | 2022-03-28 13:50:35 -0700 |
| commit | c9a0427aac0ff9792adf28e410ab79db8936ff60 (patch) | |
| tree | b4c4bfce871c8a2119b43928bc5a53a55085c0f4 /meta-xilinx-core | |
| parent | 5351f20505b1f4eb10f5da783ae3884d738aa16d (diff) | |
| download | meta-xilinx-c9a0427aac0ff9792adf28e410ab79db8936ff60.tar.gz | |
weston-init: Copy init and service file from openembedded-core
Current as of honister commits
e09625b31c6dbe7121665a554e26e267b809beb1 and
a849f29bcbd85c6d30d2ef4e061ef332ea555450
Signed-off-by: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-core')
| -rw-r--r-- | meta-xilinx-core/recipes-graphics/wayland/files/init | 54 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-graphics/wayland/files/weston.service | 71 |
2 files changed, 125 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/init b/meta-xilinx-core/recipes-graphics/wayland/files/init new file mode 100644 index 00000000..a849f29b --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/wayland/files/init | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: weston | ||
| 5 | # Required-Start: $local_fs $remote_fs | ||
| 6 | # Required-Stop: $local_fs $remote_fs | ||
| 7 | # Default-Start: 2 3 4 5 | ||
| 8 | # Default-Stop: 0 1 6 | ||
| 9 | ### END INIT INFO | ||
| 10 | |||
| 11 | if test -e /etc/default/weston ; then | ||
| 12 | . /etc/default/weston | ||
| 13 | fi | ||
| 14 | |||
| 15 | killproc() { | ||
| 16 | pid=`/bin/pidof $1` | ||
| 17 | [ "$pid" != "" ] && kill $pid | ||
| 18 | } | ||
| 19 | |||
| 20 | read CMDLINE < /proc/cmdline | ||
| 21 | for x in $CMDLINE; do | ||
| 22 | case $x in | ||
| 23 | weston=false) | ||
| 24 | echo "Weston disabled" | ||
| 25 | exit 0; | ||
| 26 | ;; | ||
| 27 | esac | ||
| 28 | done | ||
| 29 | |||
| 30 | case "$1" in | ||
| 31 | start) | ||
| 32 | . /etc/profile | ||
| 33 | export HOME=ROOTHOME | ||
| 34 | |||
| 35 | weston-start -- $OPTARGS | ||
| 36 | ;; | ||
| 37 | |||
| 38 | stop) | ||
| 39 | echo "Stopping Weston" | ||
| 40 | killproc weston | ||
| 41 | ;; | ||
| 42 | |||
| 43 | restart) | ||
| 44 | $0 stop | ||
| 45 | sleep 1 | ||
| 46 | $0 start | ||
| 47 | ;; | ||
| 48 | |||
| 49 | *) | ||
| 50 | echo "usage: $0 { start | stop | restart }" | ||
| 51 | ;; | ||
| 52 | esac | ||
| 53 | |||
| 54 | exit 0 | ||
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/weston.service b/meta-xilinx-core/recipes-graphics/wayland/files/weston.service new file mode 100644 index 00000000..e09625b3 --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/wayland/files/weston.service | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | # This is a system unit for launching Weston with auto-login as the | ||
| 2 | # user configured here. | ||
| 3 | # | ||
| 4 | # Weston must be built with systemd support, and your weston.ini must load | ||
| 5 | # the plugin systemd-notify.so. | ||
| 6 | [Unit] | ||
| 7 | Description=Weston, a Wayland compositor, as a system service | ||
| 8 | Documentation=man:weston(1) man:weston.ini(5) | ||
| 9 | Documentation=http://wayland.freedesktop.org/ | ||
| 10 | |||
| 11 | # Make sure we are started after logins are permitted. | ||
| 12 | Requires=systemd-user-sessions.service | ||
| 13 | After=systemd-user-sessions.service | ||
| 14 | |||
| 15 | # If Plymouth is used, we want to start when it is on its way out. | ||
| 16 | After=plymouth-quit-wait.service | ||
| 17 | |||
| 18 | # D-Bus is necessary for contacting logind. Logind is required. | ||
| 19 | Wants=dbus.socket | ||
| 20 | After=dbus.socket | ||
| 21 | |||
| 22 | # Ensure the socket is present | ||
| 23 | Requires=weston.socket | ||
| 24 | |||
| 25 | # Since we are part of the graphical session, make sure we are started before | ||
| 26 | # it is complete. | ||
| 27 | Before=graphical.target | ||
| 28 | |||
| 29 | # Prevent starting on systems without virtual consoles, Weston requires one | ||
| 30 | # for now. | ||
| 31 | ConditionPathExists=/dev/tty0 | ||
| 32 | |||
| 33 | [Service] | ||
| 34 | # Requires systemd-notify.so Weston plugin. | ||
| 35 | Type=notify | ||
| 36 | EnvironmentFile=/etc/default/weston | ||
| 37 | ExecStart=/usr/bin/weston --modules=systemd-notify.so | ||
| 38 | |||
| 39 | # Optional watchdog setup | ||
| 40 | TimeoutStartSec=60 | ||
| 41 | WatchdogSec=20 | ||
| 42 | |||
| 43 | # The user to run Weston as. | ||
| 44 | User=weston | ||
| 45 | Group=weston | ||
| 46 | |||
| 47 | # Make sure the working directory is the users home directory | ||
| 48 | WorkingDirectory=/home/weston | ||
| 49 | |||
| 50 | # Set up a full user session for the user, required by Weston. | ||
| 51 | PAMName=weston-autologin | ||
| 52 | |||
| 53 | # A virtual terminal is needed. | ||
| 54 | TTYPath=/dev/tty7 | ||
| 55 | TTYReset=yes | ||
| 56 | TTYVHangup=yes | ||
| 57 | TTYVTDisallocate=yes | ||
| 58 | |||
| 59 | # Fail to start if not controlling the tty. | ||
| 60 | StandardInput=tty-fail | ||
| 61 | StandardOutput=journal | ||
| 62 | StandardError=journal | ||
| 63 | |||
| 64 | # Log this user with utmp, letting it show up with commands 'w' and 'who'. | ||
| 65 | UtmpIdentifier=tty7 | ||
| 66 | UtmpMode=user | ||
| 67 | |||
| 68 | [Install] | ||
| 69 | # Note: If you only want weston to start on-demand, remove this line with a | ||
| 70 | # service drop file | ||
| 71 | WantedBy=graphical.target | ||
