diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-09-16 15:35:02 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-19 15:27:02 +0100 |
commit | b418ececee2c22f334cc31f70aff71ba9571b431 (patch) | |
tree | 75c9e22de9d5ecd6f9211c2a7ff675707f14eed3 /meta | |
parent | 9c22a5a8a8dd0d5645adeb937ca3ffc8d1c6f6ec (diff) | |
download | poky-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.inc | 1 | ||||
-rw-r--r-- | meta/conf/layer.conf | 1 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-conf.bb | 35 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init.bb | 28 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules | 2 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini | 2 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini | 2 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/weston.ini | 74 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/weston.service | 13 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/weston@.service | 37 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston_7.0.0.bb | 2 |
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>" | |||
718 | RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denys@ti.com>" | 718 | RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denys@ti.com>" |
719 | RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alex.kanavin@gmail.com>" | 719 | RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alex.kanavin@gmail.com>" |
720 | RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denys@ti.com>" | 720 | RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denys@ti.com>" |
721 | RECIPE_MAINTAINER_pn-weston-conf = "Denys Dmytriyenko <denys@ti.com>" | ||
722 | RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denys@ti.com>" | 721 | RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denys@ti.com>" |
723 | RECIPE_MAINTAINER_pn-wget = "Yi Zhao <yi.zhao@windriver.com>" | 722 | RECIPE_MAINTAINER_pn-wget = "Yi Zhao <yi.zhao@windriver.com>" |
724 | RECIPE_MAINTAINER_pn-which = "Anuj Mittal <anuj.mittal@intel.com>" | 723 | RECIPE_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 @@ | |||
1 | SUMMARY = "Weston, a Wayland compositor, configuration files" | ||
2 | HOMEPAGE = "http://wayland.freedesktop.org" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | |||
6 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
7 | |||
8 | CONFFILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini" | ||
9 | |||
10 | FILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini" | ||
11 | |||
12 | PACKAGES = "${PN}" | ||
13 | |||
14 | do_configure[noexec] = '1' | ||
15 | do_compile[noexec] = '1' | ||
16 | |||
17 | do_install() { | ||
18 | : | ||
19 | } | ||
20 | |||
21 | do_install_qemux86() { | ||
22 | mkdir -p ${D}/${sysconfdir}/xdg/weston | ||
23 | cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini | ||
24 | [core] | ||
25 | backend=fbdev-backend.so | ||
26 | EOF | ||
27 | } | ||
28 | |||
29 | do_install_qemux86-64() { | ||
30 | mkdir -p ${D}/${sysconfdir}/xdg/weston | ||
31 | cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini | ||
32 | [core] | ||
33 | backend=fbdev-backend.so | ||
34 | EOF | ||
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 | |||
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
4 | 4 | ||
5 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
6 | |||
5 | SRC_URI = "file://init \ | 7 | SRC_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 | ||
9 | S = "${WORKDIR}" | 13 | S = "${WORKDIR}" |
10 | 14 | ||
11 | do_install() { | 15 | do_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 | ||
21 | inherit allarch update-rc.d distro_features_check systemd | 33 | inherit 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 |
24 | REQUIRED_DISTRO_FEATURES = "opengl" | 36 | REQUIRED_DISTRO_FEATURES = "opengl" |
@@ -28,4 +40,10 @@ RDEPENDS_${PN} = "weston kbd" | |||
28 | INITSCRIPT_NAME = "weston" | 40 | INITSCRIPT_NAME = "weston" |
29 | INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." | 41 | INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." |
30 | 42 | ||
31 | SYSTEMD_SERVICE_${PN} = "weston.service" | 43 | FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service" |
44 | |||
45 | CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini" | ||
46 | |||
47 | SYSTEMD_SERVICE_${PN} = "weston@%i.service" | ||
48 | SYSTEMD_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 @@ | |||
1 | ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fb0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service" | ||
2 | ACTION=="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] | ||
2 | backend=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] | ||
2 | backend=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] | ||
2 | Description=Weston Wayland Compositor | ||
3 | RequiresMountsFor=/run | ||
4 | |||
5 | [Service] | ||
6 | User=root | ||
7 | PAMName=login | ||
8 | EnvironmentFile=-/etc/default/weston | ||
9 | ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=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] | ||
2 | Description=Weston Wayland Compositor (on tty7) | ||
3 | RequiresMountsFor=/run | ||
4 | Conflicts=getty@tty7.service plymouth-quit.service | ||
5 | After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service | ||
6 | |||
7 | [Service] | ||
8 | User=%i | ||
9 | PermissionsStartOnly=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: | ||
13 | PAMName=login | ||
14 | |||
15 | # Grab tty7 | ||
16 | UtmpIdentifier=tty7 | ||
17 | TTYPath=/dev/tty7 | ||
18 | TTYReset=yes | ||
19 | TTYVHangup=yes | ||
20 | TTYVTDisallocate=yes | ||
21 | |||
22 | # stderr to journal so our logging doesn't get thrown into /dev/null | ||
23 | StandardOutput=tty | ||
24 | StandardInput=tty | ||
25 | StandardError=journal | ||
26 | |||
27 | EnvironmentFile=-/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: | ||
31 | ExecStartPre=/usr/bin/chvt 7 | ||
32 | ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log $OPTARGS | ||
33 | |||
34 | IgnoreSIGPIPE=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" | |||
104 | RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" | 104 | RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" |
105 | 105 | ||
106 | RDEPENDS_${PN} += "xkeyboard-config" | 106 | RDEPENDS_${PN} += "xkeyboard-config" |
107 | RRECOMMENDS_${PN} = "weston-conf liberation-fonts" | 107 | RRECOMMENDS_${PN} = "weston-init liberation-fonts" |
108 | RRECOMMENDS_${PN}-dev += "wayland-protocols" | 108 | RRECOMMENDS_${PN}-dev += "wayland-protocols" |
109 | 109 | ||
110 | USERADD_PACKAGES = "${PN}" | 110 | USERADD_PACKAGES = "${PN}" |