summaryrefslogtreecommitdiff
diff options
authorclairlin <clair.lin@canonical.com>2022-07-14 13:07:58 +0800
committerclairlin <clair.lin@canonical.com>2022-07-14 17:12:45 +0800
commit28e3a3ca0fc32d8fc48711e063442c71f04ec327 (patch)
tree301ceac79d14746e113126cbfa1bb67e2ae04b83
parent3c36e1e68330d7cccd372db2a7bc697210fc10bf (diff)
Change: light_sensor_test.sh script
The light_sensor_test.sh currently only has one type of hid_sensor_als module. It will return a light sensor driver not found even though the function is available on the i2c type. Therefore, I find we can use the value of IIO_SENSOR_PROXY_TYPE to verify whether the system has light sensor hardware component or not. It is a more generic way to have the type with als instead of checking the specific "hid_sensor_als" driver.
-rwxr-xr-xbin/light_sensor_test.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/light_sensor_test.sh b/bin/light_sensor_test.sh
index cb8fbe9..494ca39 100755
--- a/bin/light_sensor_test.sh
+++ b/bin/light_sensor_test.sh
@@ -1,16 +1,16 @@
#!/bin/bash
#Check if light sensor driver available, this section will be retired after checkbox resource jobs implement the light sensor in Device check
-#Bug for reference https://bugs.launchpad.net/checkbox-support/+bug/1864960
-als_sensors=$(udevadm info --export-db|grep hid_sensor_als)
+#Bug for reference LP #1864960 and LP #1980797
+als_sensors=$(udevadm info --export-db|grep IIO_SENSOR_PROXY_TYPE |grep als)
-#Check hid_sensor_als driver is loaded and available first.
+#Check iio_sensor_als is ready and available first.
if [ -z "$als_sensors" ]
then
- echo "Light sensor driver not found"
+ echo "Light sensor is not found"
exit 1
else
- echo "Light sensor driver is available"
+ echo "Light sensor is available"
echo "$als_sensors"
fi