summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2022-09-28 12:32:55 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2022-12-07 15:34:48 +0100
commitbed100b71cb3c36865abb8a8b1ebfdf0fe7bdd1e (patch)
treee7667f29c0c7e9ee902934a138aaf7e9e1243cc7
parentd8726f3394911b808b6097f7845fed7a00c31c0a (diff)
weston-init: shore up touch calibrator installation
- Avoid use INI_UNCOMMENT_ASSIGNMENTS to handle [libinput] section, since that's done in meta-freescale layer which can create a race condiction depending on the order of meta-freescale and meta-toradex-demos in BBLAYERS. - Add a sanity check to ensure "calibration_helper" and "touchscreen_calibrator" to be added to weston.ini only when they are not already in it by deleteting them in advance. This can prevent a force do_install (bitbake install -f) to add them in more than once. Related-to: ELB-4570 Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit 3e7226afbfd01187f13f8b6e4b0ae7996844ebe7) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--recipes-graphics/wayland/weston-init.bbappend14
1 files changed, 9 insertions, 5 deletions
diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend
index 7a385c0..223eb2c 100644
--- a/recipes-graphics/wayland/weston-init.bbappend
+++ b/recipes-graphics/wayland/weston-init.bbappend
@@ -5,15 +5,19 @@ SRC_URI += "file://toradex-save-touchscreen-calibration.sh"
PACKAGECONFIG[touchscreen-calibration] = ",,"
PACKAGECONFIG:append:tdx = " touchscreen-calibration"
-INI_UNCOMMENT_ASSIGNMENTS:append:tdx = " \
- \\[libinput\\] \
- enable_tap=true \
-"
-
do_install:append:tdx() {
if [ "${@bb.utils.contains('PACKAGECONFIG', 'touchscreen-calibration', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "s/^#\\[libinput\\]/[libinput]/g" ${D}${sysconfdir}/xdg/weston/weston.ini
+
+ sed -i -e "/calibration_helper=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
sed -i -e "/^\[libinput\]/a calibration_helper=${bindir}/toradex-save-touchscreen-calibration" ${D}${sysconfdir}/xdg/weston/weston.ini
+
+ sed -i -e "/touchscreen_calibrator=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
sed -i -e "/^\[libinput\]/a touchscreen_calibrator=true" ${D}${sysconfdir}/xdg/weston/weston.ini
+
+ sed -i -e "/enable_tap=/d" ${D}${sysconfdir}/xdg/weston/weston.ini
+ sed -i -e "/^\[libinput\]/a enable_tap=true" ${D}${sysconfdir}/xdg/weston/weston.ini
+
install -Dm0755 ${WORKDIR}/toradex-save-touchscreen-calibration.sh ${D}${bindir}/toradex-save-touchscreen-calibration
fi
}