meta-agl-core: Update weston/agl-compositor init
[AGL/meta-agl.git] / meta-agl-core / recipes-graphics / wayland / weston-init_aglcore.inc
1 SYSTEMD_AUTO_ENABLE = "enable"
2
3 do_install:append() {
4     # Remove upstream weston.ini to avoid conflict with weston-ini-conf package
5     rm -f ${D}${sysconfdir}/xdg/weston/weston.ini
6 }
7
8 RDEPENDS:${PN} += "weston-ini"
9
10 # Temporary effective backport of upstream commit ccdaab97
11 # This gets us on the same page as upstream with respect to running
12 # weston as non-root, and should make migrating to 3.5/Kirkstone
13 # easier.
14
15 FILESEXTRAPATHS:prepend := "${THISDIR}/weston-init:"
16
17 SRC_URI += " \
18            file://weston.service \
19            file://weston.socket \
20            file://weston-autologin \
21 "
22
23 do_install:append() {
24         rm -f ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
25         rm -f ${D}${systemd_system_unitdir}/weston@.service
26         rm -f ${D}${systemd_system_unitdir}/weston@.socket
27
28         install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
29         install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
30         if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
31                install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
32         fi
33
34         sed -i -e s:/etc:${sysconfdir}:g \
35                 -e s:/usr/bin:${bindir}:g \
36                 -e s:/var:${localstatedir}:g \
37                 ${D}${systemd_system_unitdir}/weston.service
38
39         install -dm 755 -o weston -g weston ${D}/home/weston
40 }
41
42 inherit useradd
43
44 USERADD_PACKAGES = "${PN}"
45
46 FILES_${PN} += "\
47     ${systemd_system_unitdir}/weston.service \
48     ${systemd_system_unitdir}/weston.socket \
49     /home/weston \
50 "
51
52 SYSTEMD_SERVICE_${PN} = "weston.service weston.socket"
53 USERADD_PARAM_${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston"
54 GROUPADD_PARAM_${PN} = "-r wayland"