forked from Freescale/meta-freescale
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweston-init.bbappend
More file actions
138 lines (107 loc) · 5.33 KB
/
weston-init.bbappend
File metadata and controls
138 lines (107 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
# OpenGL is not required for parts with GPU support for 2D but not 3D
IMX_REQUIRED_DISTRO_FEATURES_REMOVE = ""
IMX_REQUIRED_DISTRO_FEATURES_REMOVE:imxgpu2d = "opengl"
IMX_REQUIRED_DISTRO_FEATURES_REMOVE:imxgpu3d = ""
REQUIRED_DISTRO_FEATURES:remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}"
SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config"
PACKAGECONFIG ??= " \
no-idle-timeout \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xwayland', '', d)} \
${PACKAGECONFIG_GBM_FORMAT} \
${PACKAGECONFIG_REPAINT_WINDOW} \
${PACKAGECONFIG_SIZE} \
${PACKAGECONFIG_USE_G2D} \
"
# Mainline BSPs dont support xwayland
PACKAGECONFIG:remove:use-mainline-bsp = "xwayland"
PACKAGECONFIG_GBM_FORMAT ?= ""
PACKAGECONFIG_GBM_FORMAT:mx8mq-nxp-bsp ?= "gbm-format"
PACKAGECONFIG_GBM_FORMAT:mx93-nxp-bsp ?= "gbm-format"
GBM_FORMAT_VALUE:mx8mq-nxp-bsp = "argb8888"
GBM_FORMAT_VALUE:mx93-nxp-bsp = "argb8888"
PACKAGECONFIG_REPAINT_WINDOW ?= ""
PACKAGECONFIG_REPAINT_WINDOW:mx8-nxp-bsp ?= "repaint-window"
PACKAGECONFIG_REPAINT_WINDOW:mx9-nxp-bsp ?= "repaint-window"
PACKAGECONFIG_SIZE ?= ""
PACKAGECONFIG_SIZE:mx8mq-nxp-bsp ?= "size"
SIZE_VALUE:mx8mq-nxp-bsp = "1920x1080"
HAS_G2D = "false"
HAS_G2D:imxgpu2d = "true"
PACKAGECONFIG_USE_G2D ?= ""
PACKAGECONFIG_USE_G2D:imxgpu2d ?= "use-g2d"
PACKAGECONFIG_USE_G2D:mx8qm-nxp-bsp ?= ""
PACKAGECONFIG_USE_G2D:mx8qxp-nxp-bsp ?= ""
PACKAGECONFIG_USE_G2D:mx8dx-nxp-bsp ?= ""
PACKAGECONFIG_USE_G2D:mx93-nxp-bsp ?= "use-g2d"
PACKAGECONFIG_USE_G2D:mx943-nxp-bsp ?= "use-g2d"
USE_G2D_VALUE = "true"
USE_G2D_VALUE:mx6-nxp-bsp = "1"
USE_G2D_VALUE:mx7-nxp-bsp = "1"
PACKAGECONFIG[gbm-format] = ",,"
PACKAGECONFIG[rdp] = ",,"
PACKAGECONFIG[repaint-window] = ",,"
PACKAGECONFIG[size] = ",,"
PACKAGECONFIG[use-g2d] = ",,"
PACKAGECONFIG[xwayland] = ",,"
update_file() {
sed -i -e "s,$1,$2," $3
}
insert_line_before() {
sed -i -e "/$1/i $2" $3
}
insert_line_after() {
sed -i -e "/$1/a $2" $3
}
do_install:append() {
# Replace the template variables
sed -i -e 's,@bindir@,${bindir},g' ${D}${sysconfdir}/xdg/weston/weston.ini
if [ -f "${UNPACKDIR}/weston.config" ]; then
install -Dm0755 ${UNPACKDIR}/weston.config ${D}${sysconfdir}/default/weston
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'gbm-format', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^\[core\]/a gbm-format=${GBM_FORMAT_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'rdp', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "s|^command=${bindir}/weston .*|& --rdp-tls-cert=${sysconfdir}/freerdp/keys/server.crt --rdp-tls-key=${sysconfdir}/freerdp/keys/server.key|" ${D}${sysconfdir}/xdg/weston/weston.ini
sed -i -e "/^\[core\]/a modules=screen-share.so" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'repaint-window', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^\[core\]/a repaint-window=16" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'size', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^\[shell\]/a size=${SIZE_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-g2d', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^\[core\]/a use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
elif ${HAS_G2D}; then
sed -i -e "/^\[core\]/a #use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "no" ]; then
sed -i -e "s/^xwayland=true/#xwayland=true/g" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
# Add weston.log back, used by NXP for testing
update_file "ExecStart=/usr/bin/weston " "ExecStart=/usr/bin/weston --log=\$\{XDG_RUNTIME_DIR\}/weston.log " ${D}${systemd_system_unitdir}/weston.service
# FIXME: weston should be run as weston, not as root
update_file "User=weston" "User=root" ${D}${systemd_system_unitdir}/weston.service
update_file "Group=weston" "Group=root" ${D}${systemd_system_unitdir}/weston.service
# FIXME: Upstream this change
insert_line_before "ExecStart=" "ExecStartPre=+chvt 7" ${D}${systemd_system_unitdir}/weston.service
# FIXME: fix the underlying problem and drop this workaround
insert_line_after "ExecStart=" "Restart=on-failure" ${D}${systemd_system_unitdir}/weston.service
else
# Install weston-socket.sh for sysvinit as well
install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
fi
# Include commented gbm-format
if ! [ "${@bb.utils.contains('PACKAGECONFIG', 'gbm-format', 'yes', 'no', d)}" = "yes" ]; then
sed -i -e "/^\[core\]/a #gbm-format=${GBM_FORMAT_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
}
do_install:append:mx6-nxp-bsp() {
update_file "--no-resizeable" "--no-clients-resize" ${D}${sysconfdir}/xdg/weston/weston.ini
}
do_install:append:mx7-nxp-bsp() {
update_file "--no-resizeable" "--no-clients-resize" ${D}${sysconfdir}/xdg/weston/weston.ini
}