* [PATCH V3] weston-init: Add possibility to run weston as non-root user
@ 2019-09-11 4:29 Khem Raj
2019-09-13 12:27 ` Ross Burton
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2019-09-11 4:29 UTC (permalink / raw)
To: openembedded-core; +Cc: Otavio Salvador
These changes are from meta-96boards primarily
Launch the session via a udev rule based on what kind of display device
is available
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
---
v2: Drop duplicate isntall rule and use systemd_system_unitdir
v3: Use systemd_system_unitdir in FILES section too
meta/recipes-graphics/wayland/weston-init.bb | 24 +++++-
.../wayland/weston-init/71-weston-drm.rules | 2 +
.../wayland/weston-init/weston.ini | 74 +++++++++++++++++++
.../wayland/weston-init/weston.service | 13 ----
.../wayland/weston-init/weston@.service | 37 ++++++++++
5 files changed, 133 insertions(+), 17 deletions(-)
create mode 100644 meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules
create mode 100644 meta/recipes-graphics/wayland/weston-init/weston.ini
delete mode 100644 meta/recipes-graphics/wayland/weston-init/weston.service
create mode 100644 meta/recipes-graphics/wayland/weston-init/weston@.service
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 22ba5f3fb3..2c1cd1046c 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -3,15 +3,25 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = "file://init \
- file://weston.service \
+ file://weston.ini \
+ file://weston@.service \
+ file://71-weston-drm.rules \
file://weston-start"
S = "${WORKDIR}"
do_install() {
install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
- install -Dm0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
-
+ install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
+
+ # Install Weston systemd service and accompanying udev rule
+ install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service
+ sed -i -e s:/etc:${sysconfdir}:g \
+ -e s:/usr/bin:${bindir}:g \
+ -e s:/var:${localstatedir}:g \
+ ${D}${systemd_unitdir}/system/weston@.service
+ install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \
+ ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
# Install weston-start script
install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
@@ -28,4 +38,10 @@ RDEPENDS_${PN} = "weston kbd"
INITSCRIPT_NAME = "weston"
INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
-SYSTEMD_SERVICE_${PN} = "weston.service"
+FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service"
+
+CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini"
+
+SYSTEMD_SERVICE_${PN} = "weston@%i.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
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 @@
+ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fb0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
+ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
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 @@
+# configuration file for Weston
+
+#[core]
+#modules=xwayland.so,cms-colord.so
+#shell=desktop-shell.so
+#gbm-format=xrgb2101010
+
+#[shell]
+#background-image=/usr/share/backgrounds/gnome/Aqua.jpg
+#background-color=0xff002244
+#background-type=tile
+#clock-format=minutes
+#panel-color=0x90ff0000
+#locking=true
+#animation=zoom
+#startup-animation=fade
+#binding-modifier=ctrl
+#num-workspaces=6
+#cursor-theme=whiteglass
+#cursor-size=24
+
+#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
+#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
+#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
+#animation=fade
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
+#path=/usr/bin/gnome-terminal
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
+#path=/usr/bin/weston-terminal
+
+#[launcher]
+#icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
+#path=/usr/bin/google-chrome
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/arts.png
+#path=/build/weston-0lEgCh/weston-1.11.0/weston-flower
+
+#[input-method]
+#path=/usr/lib/weston/weston-keyboard
+
+#[output]
+#name=LVDS1
+#mode=1680x1050
+#transform=90
+#icc_profile=/usr/share/color/icc/colord/Bluish.icc
+
+#[output]
+#name=VGA1
+#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+#transform=flipped
+
+#[output]
+#name=X1
+#mode=1024x768
+#transform=flipped-90
+
+#[libinput]
+#enable_tap=true
+
+#[touchpad]
+#constant_accel_factor = 50
+#min_accel_factor = 0.16
+#max_accel_factor = 1.0
+
+#[screen-share]
+#command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
+
+#[xwayland]
+#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 @@
-[Unit]
-Description=Weston Wayland Compositor
-RequiresMountsFor=/run
-
-[Service]
-User=root
-PAMName=login
-EnvironmentFile=-/etc/default/weston
-ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS
-
-[Install]
-WantedBy=multi-user.target
-
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 @@
+[Unit]
+Description=Weston Wayland Compositor (on tty7)
+RequiresMountsFor=/run
+Conflicts=getty@tty7.service plymouth-quit.service
+After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service
+
+[Service]
+User=%i
+PermissionsStartOnly=true
+
+# Log us in via PAM so we get our XDG & co. environment and
+# are treated as logged in so we can use the tty:
+PAMName=login
+
+# Grab tty7
+UtmpIdentifier=tty7
+TTYPath=/dev/tty7
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+
+# stderr to journal so our logging doesn't get thrown into /dev/null
+StandardOutput=tty
+StandardInput=tty
+StandardError=journal
+
+EnvironmentFile=-/etc/default/weston
+
+# Weston does not successfully change VT, nor does systemd place us on
+# the VT it just activated for us. Switch manually:
+ExecStartPre=/usr/bin/chvt 7
+ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log $OPTARGS
+
+IgnoreSIGPIPE=no
+
+#[Install]
+#Alias=multi-user.target.wants/weston.service
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V3] weston-init: Add possibility to run weston as non-root user
2019-09-11 4:29 [PATCH V3] weston-init: Add possibility to run weston as non-root user Khem Raj
@ 2019-09-13 12:27 ` Ross Burton
2019-09-13 13:41 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2019-09-13 12:27 UTC (permalink / raw)
To: Khem Raj, openembedded-core; +Cc: Otavio Salvador
On 11/09/2019 05:29, Khem Raj wrote:
> .../wayland/weston-init/weston.ini | 74 +++++++++++++++++++
core-image-weston now fails:
file /etc/xdg/weston/weston.ini conflicts between attempted installs
of weston-init-1.0-r0.noarch and weston-conf-1.0-r0.qemux86_64
Ross
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V3] weston-init: Add possibility to run weston as non-root user
2019-09-13 12:27 ` Ross Burton
@ 2019-09-13 13:41 ` Khem Raj
2019-09-16 22:19 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2019-09-13 13:41 UTC (permalink / raw)
To: Ross Burton
Cc: Otavio Salvador, Patches and discussions about the oe-core layer
On Fri, Sep 13, 2019 at 5:27 AM Ross Burton <ross.burton@intel.com> wrote:
>
> On 11/09/2019 05:29, Khem Raj wrote:
> > .../wayland/weston-init/weston.ini | 74 +++++++++++++++++++
>
> core-image-weston now fails:
>
> file /etc/xdg/weston/weston.ini conflicts between attempted installs
> of weston-init-1.0-r0.noarch and weston-conf-1.0-r0.qemux86_64
>
on x86 qemu right. Sent a V4. give it a try
> Ross
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V3] weston-init: Add possibility to run weston as non-root user
2019-09-13 13:41 ` Khem Raj
@ 2019-09-16 22:19 ` Richard Purdie
2019-09-16 22:35 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2019-09-16 22:19 UTC (permalink / raw)
To: Khem Raj, Ross Burton
Cc: Otavio Salvador, Patches and discussions about the oe-core layer
On Fri, 2019-09-13 at 06:41 -0700, Khem Raj wrote:
> On Fri, Sep 13, 2019 at 5:27 AM Ross Burton <ross.burton@intel.com>
> wrote:
> > On 11/09/2019 05:29, Khem Raj wrote:
> > > .../wayland/weston-init/weston.ini | 74
> > > +++++++++++++++++++
> >
> > core-image-weston now fails:
> >
> > file /etc/xdg/weston/weston.ini conflicts between attempted
> > installs
> > of weston-init-1.0-r0.noarch and weston-conf-1.0-r0.qemux86_64
> >
>
> on x86 qemu right. Sent a V4. give it a try
Fails oe-selftest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/383/steps/8/logs/step2d
oe-selftest -r statetests.SStateTests.test_sstate_sametune_samesigs
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V3] weston-init: Add possibility to run weston as non-root user
2019-09-16 22:19 ` Richard Purdie
@ 2019-09-16 22:35 ` Khem Raj
0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2019-09-16 22:35 UTC (permalink / raw)
To: Richard Purdie
Cc: Otavio Salvador, Patches and discussions about the oe-core layer
On Mon, Sep 16, 2019 at 3:19 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Fri, 2019-09-13 at 06:41 -0700, Khem Raj wrote:
> > On Fri, Sep 13, 2019 at 5:27 AM Ross Burton <ross.burton@intel.com>
> > wrote:
> > > On 11/09/2019 05:29, Khem Raj wrote:
> > > > .../wayland/weston-init/weston.ini | 74
> > > > +++++++++++++++++++
> > >
> > > core-image-weston now fails:
> > >
> > > file /etc/xdg/weston/weston.ini conflicts between attempted
> > > installs
> > > of weston-init-1.0-r0.noarch and weston-conf-1.0-r0.qemux86_64
> > >
> >
> > on x86 qemu right. Sent a V4. give it a try
>
> Fails oe-selftest:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/383/steps/8/logs/step2d
>
> oe-selftest -r statetests.SStateTests.test_sstate_sametune_samesigs
>
Its expected to be machine specific now. Since we are housing
device-specific weston.ini files now see
weston-init/qemux86/weston.ini I have sent a v5 addressing this.
> Cheers,
>
> Richard
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-09-16 22:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 4:29 [PATCH V3] weston-init: Add possibility to run weston as non-root user Khem Raj
2019-09-13 12:27 ` Ross Burton
2019-09-13 13:41 ` Khem Raj
2019-09-16 22:19 ` Richard Purdie
2019-09-16 22:35 ` Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.