stm-st-stm32mp: weston-init: miscellaneous fixes

Check that weston-start exists before modifying it: after a recent change in
poky's weston-init recipe, this file only gets installed in non-systemd images.

Remove hardcoded systemd service path: some of the code ported from
meta-st-openstlinux assumes that the original weston-init systemd services are
installed under /lib, and it uses hardcoded paths to detect them. Yocto 5.0 now
has usrmerge enabled, so the services are installed in /usr/lib instead,
causing the check to fail. Replace the hardcoded path with its respective
variable.

https://onedigi.atlassian.net/browse/DEL-9011
https://onedigi.atlassian.net/browse/DEL-9045

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2024-06-20 18:39:57 +02:00
parent b2c1d3bcf1
commit e7fa96a781
1 changed files with 6 additions and 4 deletions

View File

@ -39,9 +39,8 @@ do_install:append() {
install -d ${D}${systemd_system_unitdir} ${D}${sbindir}
install -d ${D}/lib/systemd/system/
if [ -e ${D}/lib/systemd/system/weston.service ]; then
rm ${D}/lib/systemd/system/weston.service ${D}/lib/systemd/system/weston.socket
if [ -e ${D}/${systemd_system_unitdir}/weston.service ]; then
rm ${D}/${systemd_system_unitdir}/weston.service ${D}/${systemd_system_unitdir}/weston.socket
install -D -p -m0644 ${WORKDIR}/weston-launch.service ${D}${systemd_system_unitdir}/weston-launch.service
sed -i -e s:/etc:${sysconfdir}:g \
-e s:/usr/bin:${bindir}:g \
@ -59,7 +58,10 @@ do_install:append() {
# uncomment modules line for support of xwayland
sed -i -e 's,#xwayland=true,xwayland=true,g' ${D}${sysconfdir}/xdg/weston/weston.ini
fi
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
if [ -e ${D}${bindir}/weston-start ]; then
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
fi
# /etc/default/weston
install -d ${D}${sysconfdir}/default
echo "WESTON_USER=root" > ${D}${sysconfdir}/default/weston