We shouldn't be running weston as root. Supporting this will likely require re-enabling weston-launcher, which is currently disabled in the weston APKBUILD in aports.
Since the APKBUILD upstream also has these configuration options for disabling weston-launch and suid install, I filed an upstream bug here: https://bugs.alpinelinux.org/issues/7556
Probably worth keeping this issue open in github though, since profile.d/postmarketos.sh will have to change if upstream APKBUILD is modified to build these required components.
In my experience with Alpine's bug tracker it takes some time until you get a response. I've had better results with this approach:
#alpine-devel and ask if this could be mergedThen the Alpine devs have less work, and our changes go through faster (and we actually tested them our selves) :)
(For complex changes I suggest asking in IRC first.)
The reason of --disable-weston-launch seems to be that weston-launcher is not compatible with musl (it uses GNU's error()).
I found a patch from September 2016 to fix it that never got merged.
Since we are having building issues (see https://github.com/postmarketOS/pmbootstrap/issues/546) with weston now that weston 3.0.0 is out and available for Alpine, I've merged this patch in https://github.com/postmarketOS/pmbootstrap/pull/495.
Maybe we can kill two birds with one stone by updating weston to 3.0.0 and launching it using weston-launcher from now on.
@craftyguy @PabloCastellano @ollieparanoid now that we have weston 3.0.0 we should try to make it work without root.
Can you built Weston-launcher now? I think that suid utility is the only was to run it as a regular user.
On September 13, 2017 7:40:12 AM PDT, drebrez notifications@github.com wrote:
@craftyguy @PabloCastellano @ollieparanoid now that we have weston
3.0.0 we should try to make it work without root.--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/postmarketOS/pmbootstrap/issues/199#issuecomment-329189223
@craftyguy I didn't built anything, weston-launcher was already present in 3.0.0, I think thanks to @PabloCastellano 's patch
Ah, nice! In that case, probably just a matter of someone trying to use it to start weston as user :)
I can confirm that weston can be started as user.
Here what I've tried:
$ sudo apk add shadow
$ sudo groupadd weston-launch
$ sudo usermod -a -G weston-launch $USER
$ sudo chmod +s /usr/bin/weston-launch
$ sudo chown user:user /dev/fb0
changed /etc/inittab to respawn login with user instead of root
changed /etc/profile.d/start_weston.sh to call weston-launch
$ postmarketos-demos &
Awesome! I understand that this was just a proof of concept. Here are some remarks to integrate this properly:
shadow should be a dependency of postmarketos-base/dev/fb0 seems like a big hack to me. I think distributions used to have a video group, which could access the framebuffer. Does it work without the chown, when the user is in that group?user when creating the account in the postmarketos-base post-install scriptchmod +s /usr/bin/weston-launch should be done in the install step of westonYup, instead of "chown"ing /dev/fb0, 'user' should be added to the 'video'
group. That group has R/W access to fb0.
On Sun, Oct 01, 2017 at 02:52:01AM +0000, Oliver Smith wrote:
Awesome! I understand that this was just a proof of concept. Here are some remarks to integrate this properly:
- I guess
shadowshould be a dependency ofpostmarketos-base- chowning
/dev/fb0seems like a big hack to me. I think distributions used to have avideogroup, which could access the framebuffer. Does it work without the chown, when the user is in that group?- Additional groups could be added to
userwhen creating the account in thepostmarketos-basepost-installscript- I think the
chmod +s /usr/bin/weston-launchshould be done in theinstallstep ofweston--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/postmarketOS/pmbootstrap/issues/199#issuecomment-333349640
I can confirm that adding the user to the video group solves the permission:
usermod -a -G video user
Most helpful comment
I can confirm that weston can be started as user.
Here what I've tried:
changed
/etc/inittabto respawn login withuserinstead ofrootchanged
/etc/profile.d/start_weston.shto callweston-launch