From 28e3a3ca0fc32d8fc48711e063442c71f04ec327 Mon Sep 17 00:00:00 2001 From: clairlin Date: Thu, 14 Jul 2022 13:07:58 +0800 Subject: 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. --- bin/light_sensor_test.sh | 10 +++++----- 1 file 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 -- cgit v1.2.3