@@ -45,6 +45,7 @@ PACKAGECONFIG_USE_G2D:mx8qm-nxp-bsp ?= ""
4545PACKAGECONFIG_USE_G2D :mx8qxp -nxp -bsp ?= ""
4646PACKAGECONFIG_USE_G2D :mx8dx -nxp -bsp ?= ""
4747PACKAGECONFIG_USE_G2D :mx93 -nxp -bsp ?= "use-g2d"
48+ PACKAGECONFIG_USE_G2D :mx943 -nxp -bsp ?= "use-g2d"
4849
4950USE_G2D_VALUE = "true"
5051USE_G2D_VALUE :mx6 -nxp -bsp = "1"
@@ -57,6 +58,18 @@ PACKAGECONFIG[size] = ",,"
5758PACKAGECONFIG [use -g2d ] = ",,"
5859PACKAGECONFIG [xwayland ] = ",,"
5960
61+ update_file () {
62+ sed -i -e "s,$1,$2," $3
63+ }
64+
65+ insert_line_before () {
66+ sed -i -e "/$1/i $2" $3
67+ }
68+
69+ insert_line_after () {
70+ sed -i -e "/$1/a $2" $3
71+ }
72+
6073do_install :append () {
6174 # Replace the template variables
6275 sed -i -e 's,@bindir@,${bindir} ,g' ${D}${sysconfdir} /xdg /weston /weston . ini
@@ -91,4 +104,35 @@ do_install:append() {
91104 if [ "${@ bb . utils . contains ('PACKAGECONFIG' , 'xwayland' , 'yes' , 'no' , d )}" = "no" ]; then
92105 sed -i -e "s/^xwayland=true/#xwayland=true/g" ${D}${sysconfdir} /xdg /weston /weston . ini
93106 fi
107+
108+ if ${@ bb . utils . contains ('DISTRO_FEATURES' , 'systemd' , 'true' , 'false' , d )}; then
109+ # Add weston.log back, used by NXP for testing
110+ update_file "ExecStart=/usr/bin/weston " "ExecStart=/usr/bin/weston --log=\$\{XDG_RUNTIME_DIR\}/weston.log " ${D}${systemd_system_unitdir} /weston . service
111+
112+ # FIXME: weston should be run as weston, not as root
113+ update_file "User=weston" "User=root" ${D}${systemd_system_unitdir} /weston . service
114+ update_file "Group=weston" "Group=root" ${D}${systemd_system_unitdir} /weston . service
115+
116+ # FIXME: Upstream this change
117+ insert_line_before "ExecStart=" "ExecStartPre=+chvt 7" ${D}${systemd_system_unitdir} /weston . service
118+
119+ # FIXME: fix the underlying problem and drop this workaround
120+ insert_line_after "ExecStart=" "Restart=on-failure" ${D}${systemd_system_unitdir} /weston . service
121+ else
122+ # Install weston-socket.sh for sysvinit as well
123+ install -D -p -m0644 ${WORKDIR} /weston -socket . sh ${D}${sysconfdir} /profile . d /weston -socket . sh
124+ fi
125+
126+ # Include commented gbm-format
127+ if ! [ "${@ bb . utils . contains ('PACKAGECONFIG' , 'gbm-format' , 'yes' , 'no' , d )}" = "yes" ]; then
128+ sed -i -e "/^\[core\]/a #gbm-format=${GBM_FORMAT_VALUE} " ${D}${sysconfdir} /xdg /weston /weston . ini
129+ fi
130+ }
131+
132+ do_install :append :mx6 -nxp -bsp () {
133+ update_file "--no-resizeable" "--no-clients-resize" ${D}${sysconfdir} /xdg /weston /weston . ini
134+ }
135+
136+ do_install :append :mx7 -nxp -bsp () {
137+ update_file "--no-resizeable" "--no-clients-resize" ${D}${sysconfdir} /xdg /weston /weston . ini
94138}
0 commit comments