summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-16 22:14:52 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-20 17:07:06 +0200
commitbb0882c5dad030f676e424265ebcd869bb3ff899 (patch)
treed95bb2d7ad6b5ac47427f73babe015b0ade02342 /meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend
parent97e5e76efa44f55ee9aaf3998bb3df38b829706c (diff)
Introduce meta-agl-profile-core and meta-agl-profile-graphics
Rework towards agl profiles. This change is part of a series of changes to create the AGL profiles. This set will mainly introduce the 'core' profile. It is setup to be a drop-in change, thus some files were kept in (dummy) locations for now. However, they'll be taken care of in the next changes in this series. The main target of the meta-agl-profile-core layer is to host: - a minimal, bootable image with network and package management enabled -- agl-image-boot - a minimal image with network and packagemanagement and the AGL APIs -- agl-image-minimal The layer meta-agl-profile-graphical is used as superset of these and includes support for egl+wayland+weston. All recipes concerning graphics were moved there. This is not a full profile as we still have to migrate some parts of meta-agl-demo in a follow-up changeset. The roadmap as discussed during the F2F session in Karlsruhe is: - week 16 : core profile and profiles w/o graphics - week 17 : graphical profiles - week 18 : final conversion of the demo image v2: moved agl-login-manager from -graphics to -core (see Jose's comment) v3: moved back after discussion - follow-up in separate changeset Change-Id: Idacb0d1274baac1f63f8d1b850d4b1104ac33918 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend')
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend79
1 files changed, 79 insertions, 0 deletions
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 000000000..1ca63b5de
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,79 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+inherit agl-graphical
+
+WESTONSTART ??= "/usr/bin/weston ${WESTONARGS}"
+WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/weston.log", "",d)}"
+
+SRC_URI += " \
+ file://weston_tmpfiles.conf \
+ file://weston.service.add \
+"
+
+do_install_append() {
+ sed -i "/\[Unit\]/aConflicts=getty@tty${WESTONTTY}.service" \
+ ${D}${systemd_system_unitdir}/weston.service
+
+ sed -i "/\[Service\]/r ${S}/weston.service.add" \
+ ${D}${systemd_system_unitdir}/weston.service
+
+ if ! grep -q '^Group=' ${D}${systemd_system_unitdir}/weston.service; then
+ sed -i "/\[Service\]/aGroup=root" ${D}${systemd_system_unitdir}/weston.service
+ fi
+ if ! grep -q '^User=' ${D}${systemd_system_unitdir}/weston.service; then
+ sed -i "/\[Service\]/aUser=root" ${D}${systemd_system_unitdir}/weston.service
+ fi
+
+ sed -e 's,User=root,User=${WESTONUSER},g' \
+ -e 's,Group=root,Group=${WESTONGROUP},g' \
+ -e 's,ExecStart=.*,ExecStart=${WESTONSTART},g' \
+ -e 's,@WESTONTTY@,${WESTONTTY},g' \
+ -e 's,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
+ -i ${D}${systemd_system_unitdir}/weston.service
+
+ # Add a rule to ensure the 'display' user has permissions to
+ # open the graphics device
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF'
+SUBSYSTEM=="drm", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service"
+EOF
+
+ # user 'display' must own /dev/tty${WESTONTTY} for weston to start correctly
+ cat >${D}${sysconfdir}/udev/rules.d/zz-tty.rules <<'EOF'
+SUBSYSTEM=="tty", KERNEL=="tty${WESTONTTY}", OWNER="${WESTONUSER}", SECLABEL{smack}="^", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service"
+EOF
+
+ # user 'display' must also be able to access /dev/input/*
+ cat >${D}${sysconfdir}/udev/rules.d/zz-input.rules <<'EOF'
+SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="^", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service"
+EOF
+
+ # user 'display' must also be able to access /dev/media*, etc.
+ cat >${D}${sysconfdir}/udev/rules.d/zz-remote-display.rules <<'EOF'
+SUBSYSTEM=="media", MODE="0660", GROUP="display", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service"
+SUBSYSTEM=="video4linux", MODE="0660", GROUP="display", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service"
+KERNEL=="uvcs", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*"
+KERNEL=="rgnmm", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*"
+EOF
+
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -Dm755 ${WORKDIR}/weston_tmpfiles.conf ${D}/${libdir}/tmpfiles.d/weston.conf
+
+ sed -e 's,@WESTONUSER@,${WESTONUSER},g' \
+ -e 's,@WESTONGROUP@,${WESTONGROUP},g' \
+ -i ${D}/${libdir}/tmpfiles.d/weston.conf
+}
+
+do_install_append_imx() {
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >>${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF'
+SUBSYSTEM=="gpu_class", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*"
+EOF
+
+}
+
+FILES_${PN} += "${libdir}/tmpfiles.d/*.conf"
+
+