summaryrefslogtreecommitdiff
diff options
authorKai-Chuan Hsieh <kaichuan.hsieh@canonical.com>2021-04-15 12:05:53 +0800
committerKai-Chuan Hsieh <kaichuan.hsieh@canonical.com>2021-04-15 18:16:10 +0800
commit7f42489d3b2119002d1480df743da5c7407c7478 (patch)
treec06d79f1ec4afe005cbe7e2b9a5c4f92b53f99d2
parent3d00bcd06167d36ed697f28fe64fb186c4ce7570 (diff)
Fix: Correct path if i2c number is changed
LP: #1922988 The i2c bus number might be changed after reboot. Get device path again if the file does not exist.
-rw-r--r--units/touchpad/jobs.pxu8
1 files changed, 5 insertions, 3 deletions
diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu
index bb6f596..794de79 100644
--- a/units/touchpad/jobs.pxu
+++ b/units/touchpad/jobs.pxu
@@ -228,7 +228,9 @@ id: touchpad/palm-rejection-firmware-labeling_{product_slug}
requires: device.driver == 'hid-multitouch'
estimated_duration: 5.0
command:
- abs_caps=$(cat </sys{path}/capabilities/abs)
+ dev_path=$(udev_resource.py -f TOUCHPAD | grep "path" | cut -d" " -f2)
+ abs_path="/sys$dev_path/capabilities/abs"
+ abs_caps=$(cat <"$abs_path")
abs_caps_hex=$((16#"$abs_caps"))
tool_type_bit=$((abs_caps_hex >> 55))
support=$((tool_type_bit & 1))
@@ -236,8 +238,8 @@ command:
exit 0
else
echo "Touchapd info:"
- cat </sys{path}/name
- cat </sys{path}/modalias
+ cat <"/sys$dev_path/name"
+ cat <"/sys$dev_path/modalias"
echo "Touchpad EV_ABS capabilities:"
echo "$abs_caps"
exit 1