summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-09-16 15:35:02 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-19 15:27:02 +0100
commitb418ececee2c22f334cc31f70aff71ba9571b431 (patch)
tree75c9e22de9d5ecd6f9211c2a7ff675707f14eed3 /meta
parent9c22a5a8a8dd0d5645adeb937ca3ffc8d1c6f6ec (diff)
downloadpoky-b418ececee2c22f334cc31f70aff71ba9571b431.tar.gz
weston-init: Add possibility to run weston as non-root user
These changes are from meta-96boards primarily Launch the session via a udev rule based on what kind of display device is available delete weston-conf and move the fuctionality into weston-init other layers are doing same weston-init installs machine specific weston.ini therefore mark is machine specific now (From OE-Core rev: aa3bced2e1de2f4ba507aa014835b06edccc138a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/maintainers.inc1
-rw-r--r--meta/conf/layer.conf1
-rw-r--r--meta/recipes-graphics/wayland/weston-conf.bb35
-rw-r--r--meta/recipes-graphics/wayland/weston-init.bb28
-rw-r--r--meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules2
-rw-r--r--meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini2
-rw-r--r--meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini2
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.ini74
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.service13
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston@.service37
-rw-r--r--meta/recipes-graphics/wayland/weston_7.0.0.bb2
11 files changed, 142 insertions, 55 deletions
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 5f21f98b2b..ab0c6c5541 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -718,7 +718,6 @@ RECIPE_MAINTAINER_pn-wayland = "Denys Dmytriyenko <denys@ti.com>"
718RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denys@ti.com>" 718RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denys@ti.com>"
719RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alex.kanavin@gmail.com>" 719RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alex.kanavin@gmail.com>"
720RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denys@ti.com>" 720RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denys@ti.com>"
721RECIPE_MAINTAINER_pn-weston-conf = "Denys Dmytriyenko <denys@ti.com>"
722RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denys@ti.com>" 721RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denys@ti.com>"
723RECIPE_MAINTAINER_pn-wget = "Yi Zhao <yi.zhao@windriver.com>" 722RECIPE_MAINTAINER_pn-wget = "Yi Zhao <yi.zhao@windriver.com>"
724RECIPE_MAINTAINER_pn-which = "Anuj Mittal <anuj.mittal@intel.com>" 723RECIPE_MAINTAINER_pn-which = "Anuj Mittal <anuj.mittal@intel.com>"
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 5ecb93651e..3e85843484 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -74,6 +74,7 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
74 systemd-boot->systemd-bootconf \ 74 systemd-boot->systemd-bootconf \
75 systemd->systemd-conf \ 75 systemd->systemd-conf \
76 weston->weston-conf \ 76 weston->weston-conf \
77 weston->weston-init \
77 weston-init->weston \ 78 weston-init->weston \
78 weston-init->kbd \ 79 weston-init->kbd \
79 connman->xl2tpd \ 80 connman->xl2tpd \
diff --git a/meta/recipes-graphics/wayland/weston-conf.bb b/meta/recipes-graphics/wayland/weston-conf.bb
deleted file mode 100644
index f52200c46a..0000000000
--- a/meta/recipes-graphics/wayland/weston-conf.bb
+++ /dev/null
@@ -1,35 +0,0 @@
1SUMMARY = "Weston, a Wayland compositor, configuration files"
2HOMEPAGE = "http://wayland.freedesktop.org"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6PACKAGE_ARCH = "${MACHINE_ARCH}"
7
8CONFFILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini"
9
10FILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini"
11
12PACKAGES = "${PN}"
13
14do_configure[noexec] = '1'
15do_compile[noexec] = '1'
16
17do_install() {
18 :
19}
20
21do_install_qemux86() {
22 mkdir -p ${D}/${sysconfdir}/xdg/weston
23 cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini
24[core]
25backend=fbdev-backend.so
26EOF
27}
28
29do_install_qemux86-64() {
30 mkdir -p ${D}/${sysconfdir}/xdg/weston
31 cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini
32[core]
33backend=fbdev-backend.so
34EOF
35}
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 22ba5f3fb3..8b6689717c 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -2,23 +2,35 @@ SUMMARY = "Startup script and systemd unit file for the Weston Wayland composito
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4 4
5PACKAGE_ARCH = "${MACHINE_ARCH}"
6
5SRC_URI = "file://init \ 7SRC_URI = "file://init \
6 file://weston.service \ 8 file://weston.ini \
9 file://weston@.service \
10 file://71-weston-drm.rules \
7 file://weston-start" 11 file://weston-start"
8 12
9S = "${WORKDIR}" 13S = "${WORKDIR}"
10 14
11do_install() { 15do_install() {
12 install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston 16 install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
13 install -Dm0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service 17 install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
14 18
19 # Install Weston systemd service and accompanying udev rule
20 install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service
21 sed -i -e s:/etc:${sysconfdir}:g \
22 -e s:/usr/bin:${bindir}:g \
23 -e s:/var:${localstatedir}:g \
24 ${D}${systemd_unitdir}/system/weston@.service
25 install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \
26 ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
15 # Install weston-start script 27 # Install weston-start script
16 install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start 28 install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
17 sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start 29 sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
18 sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start 30 sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
19} 31}
20 32
21inherit allarch update-rc.d distro_features_check systemd 33inherit update-rc.d distro_features_check systemd
22 34
23# rdepends on weston which depends on virtual/egl 35# rdepends on weston which depends on virtual/egl
24REQUIRED_DISTRO_FEATURES = "opengl" 36REQUIRED_DISTRO_FEATURES = "opengl"
@@ -28,4 +40,10 @@ RDEPENDS_${PN} = "weston kbd"
28INITSCRIPT_NAME = "weston" 40INITSCRIPT_NAME = "weston"
29INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." 41INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
30 42
31SYSTEMD_SERVICE_${PN} = "weston.service" 43FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service"
44
45CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini"
46
47SYSTEMD_SERVICE_${PN} = "weston@%i.service"
48SYSTEMD_AUTO_ENABLE = "disable"
49
diff --git a/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules b/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules
new file mode 100644
index 0000000000..1a1b8bbda4
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules
@@ -0,0 +1,2 @@
1ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fb0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
2ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
diff --git a/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini b/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini
new file mode 100644
index 0000000000..17ebd7fdab
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini
@@ -0,0 +1,2 @@
1[core]
2backend=fbdev-backend.so
diff --git a/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini b/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini
new file mode 100644
index 0000000000..17ebd7fdab
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini
@@ -0,0 +1,2 @@
1[core]
2backend=fbdev-backend.so
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.ini b/meta/recipes-graphics/wayland/weston-init/weston.ini
new file mode 100644
index 0000000000..1eecf48bc1
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston.ini
@@ -0,0 +1,74 @@
1# configuration file for Weston
2
3#[core]
4#modules=xwayland.so,cms-colord.so
5#shell=desktop-shell.so
6#gbm-format=xrgb2101010
7
8#[shell]
9#background-image=/usr/share/backgrounds/gnome/Aqua.jpg
10#background-color=0xff002244
11#background-type=tile
12#clock-format=minutes
13#panel-color=0x90ff0000
14#locking=true
15#animation=zoom
16#startup-animation=fade
17#binding-modifier=ctrl
18#num-workspaces=6
19#cursor-theme=whiteglass
20#cursor-size=24
21
22#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
23#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
24#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
25#animation=fade
26
27#[launcher]
28#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
29#path=/usr/bin/gnome-terminal
30
31#[launcher]
32#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
33#path=/usr/bin/weston-terminal
34
35#[launcher]
36#icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
37#path=/usr/bin/google-chrome
38
39#[launcher]
40#icon=/usr/share/icons/gnome/24x24/apps/arts.png
41#path=/build/weston-0lEgCh/weston-1.11.0/weston-flower
42
43#[input-method]
44#path=/usr/lib/weston/weston-keyboard
45
46#[output]
47#name=LVDS1
48#mode=1680x1050
49#transform=90
50#icc_profile=/usr/share/color/icc/colord/Bluish.icc
51
52#[output]
53#name=VGA1
54#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
55#transform=flipped
56
57#[output]
58#name=X1
59#mode=1024x768
60#transform=flipped-90
61
62#[libinput]
63#enable_tap=true
64
65#[touchpad]
66#constant_accel_factor = 50
67#min_accel_factor = 0.16
68#max_accel_factor = 1.0
69
70#[screen-share]
71#command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
72
73#[xwayland]
74#path=/usr/bin/Xwayland
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.service b/meta/recipes-graphics/wayland/weston-init/weston.service
deleted file mode 100644
index 18f72626e0..0000000000
--- a/meta/recipes-graphics/wayland/weston-init/weston.service
+++ /dev/null
@@ -1,13 +0,0 @@
1[Unit]
2Description=Weston Wayland Compositor
3RequiresMountsFor=/run
4
5[Service]
6User=root
7PAMName=login
8EnvironmentFile=-/etc/default/weston
9ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS
10
11[Install]
12WantedBy=multi-user.target
13
diff --git a/meta/recipes-graphics/wayland/weston-init/weston@.service b/meta/recipes-graphics/wayland/weston-init/weston@.service
new file mode 100644
index 0000000000..9ecf2ab069
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston@.service
@@ -0,0 +1,37 @@
1[Unit]
2Description=Weston Wayland Compositor (on tty7)
3RequiresMountsFor=/run
4Conflicts=getty@tty7.service plymouth-quit.service
5After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service
6
7[Service]
8User=%i
9PermissionsStartOnly=true
10
11# Log us in via PAM so we get our XDG & co. environment and
12# are treated as logged in so we can use the tty:
13PAMName=login
14
15# Grab tty7
16UtmpIdentifier=tty7
17TTYPath=/dev/tty7
18TTYReset=yes
19TTYVHangup=yes
20TTYVTDisallocate=yes
21
22# stderr to journal so our logging doesn't get thrown into /dev/null
23StandardOutput=tty
24StandardInput=tty
25StandardError=journal
26
27EnvironmentFile=-/etc/default/weston
28
29# Weston does not successfully change VT, nor does systemd place us on
30# the VT it just activated for us. Switch manually:
31ExecStartPre=/usr/bin/chvt 7
32ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log $OPTARGS
33
34IgnoreSIGPIPE=no
35
36#[Install]
37#Alias=multi-user.target.wants/weston.service
diff --git a/meta/recipes-graphics/wayland/weston_7.0.0.bb b/meta/recipes-graphics/wayland/weston_7.0.0.bb
index f9efdbd20a..d21275414e 100644
--- a/meta/recipes-graphics/wayland/weston_7.0.0.bb
+++ b/meta/recipes-graphics/wayland/weston_7.0.0.bb
@@ -104,7 +104,7 @@ FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
104RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" 104RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
105 105
106RDEPENDS_${PN} += "xkeyboard-config" 106RDEPENDS_${PN} += "xkeyboard-config"
107RRECOMMENDS_${PN} = "weston-conf liberation-fonts" 107RRECOMMENDS_${PN} = "weston-init liberation-fonts"
108RRECOMMENDS_${PN}-dev += "wayland-protocols" 108RRECOMMENDS_${PN}-dev += "wayland-protocols"
109 109
110USERADD_PACKAGES = "${PN}" 110USERADD_PACKAGES = "${PN}"