Open toni1727 opened 3 years ago
Hi @toni1727 Have you resolved the integration of LSM9DS1 in your source code and getting the value through the apk file successfully?? I am also trying to integrate LSM6DSM sensor with my Android 11 source code and i have followed the steps as mentioned in the link:https://github.com/STMicroelectronics/STMems_Android_Sensor_HAL_IIO.git .
[ 1% 24/1701] build out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows FAILED: out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows /bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tm p out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/policy.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_i ntermediates/sepolicy_neverallows.tmp neverallow -w -f out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/policy_2.conf || ( echo \"\" 1>&2; echo \"sepolicy-analyze failed. This is most likely due to the use\" 1>&2; echo \"of an expanded attribute in a neverallow assertion. Please fix\" 1>&2; echo \"the policy.\" 1>&2; exit 1 ) ) && (touch ou t/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp ) && (mv out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_nevera llows.tmp out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows )" device/nxp/imx8m/sepolicy/STSensors.te:8:ERROR 'unknown type persist_file' at token ';' on line 58506:
allow STSensors persist_file:dir { open getattr read search ioctl lock watch watch_reads }; checkpolicy: error(s) encountered while parsing configuration [ 1% 25/1701] build out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy FAILED: out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy /bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/pro duct/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/ sepolicy.tmp permissive > out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/phyboard_polis/ obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ]; then echo \"==========\" 1>&2; echo \"ERROR: permissive domains not allowed in user builds\" 1>&2; e cho \"List of invalid domains:\" 1>&2; cat out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2; exit 1; fi ) && (mv out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy )" device/nxp/imx8m/sepolicy/STSensors.te:8:ERROR 'unknown type persist_file' at token ';' on line 62204:
allow STSensors persist_file:dir { open getattr read search ioctl lock watch watch_reads }; checkpolicy: error(s) encountered while parsing configuration 16:43:16 ninja failed with: exit status 1
Any solution to deal with the error??
Thanks in advance.
Hello and Happy new year!,
I'm using the LSM9DS1 sensor and i added the st_imu68 IIO driver into my kernel.
https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.14.y-gh/drivers/iio/imu/st_imu68
Inside /sys/bus/iio/devices i can read raw devices. So the driver is working fine.
But the app still cannot read the data.
The LOG is this:
ueventd.rc
common iio char devices
/dev/iio:device* 0666 system system
common sensors files
/sys/bus/iio/devices/iio:device buffer/enable 0666 system system /sys/bus/iio/devices/iio:device buffer/length 0666 system system /sys/bus/iio/devices/iio:device* buffer/watermark 0666 system system
/sys/bus/iio/devices/iio:device* dev 0666 system system
/sys/bus/iio/devices/iio:device sampling_frequency 0666 system system /sys/bus/iio/devices/iio:device sampling_frequency_available 0666 system system
/sys/bus/iio/devices/iio:device scan_elements/in_timestamp_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_timestamp_index 0666 system system /sys/bus/iio/devices/iio:device* scan_elements/in_timestamp_type 0666 system system
/sys/bus/iio/devices/iio:device hwfifo_flush 0666 system system /sys/bus/iio/devices/iio:device hwfifo_enabled 0666 system system /sys/bus/iio/devices/iio:device hwfifo_watermark 0666 system system /sys/bus/iio/devices/iio:device injection_mode 0666 system system /sys/bus/iio/devices/iio:device* trigger/current_trigger 0666 system system
accelerometer sensor
/sys/bus/iio/devices/iio:device scan_elements/in_accel_x_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_accel_y_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_accel_z_en 0666 system system /sys/bus/iio/devices/iio:device in_accel_x_scale 0666 system system /sys/bus/iio/devices/iio:device in_accel_y_scale 0666 system system /sys/bus/iio/devices/iio:device in_accel_z_scale 0666 system system /sys/bus/iio/devices/iio:device in_accel_x_raw 0666 system system /sys/bus/iio/devices/iio:device in_accel_y_raw 0666 system system /sys/bus/iio/devices/iio:device* in_accel_z_raw 0666 system system
/sys/bus/iio/devices/iio:device* in_accel_injection_raw 0666 system system
magnetometer sensor
/sys/bus/iio/devices/iio:device scan_elements/in_magn_x_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_magn_y_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_magn_z_en 0666 system system /sys/bus/iio/devices/iio:device in_magn_x_scale 0666 system system /sys/bus/iio/devices/iio:device in_magn_y_scale 0666 system system /sys/bus/iio/devices/iio:device in_magn_z_scale 0666 system system /sys/bus/iio/devices/iio:device in_magn_x_raw 0666 system system /sys/bus/iio/devices/iio:device in_magn_y_raw 0666 system system /sys/bus/iio/devices/iio:device* in_magn_z_raw 0666 system system
gyroscope sensor
/sys/bus/iio/devices/iio:device scan_elements/in_anglvel_x_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_anglvel_y_en 0666 system system /sys/bus/iio/devices/iio:device scan_elements/in_anglvel_z_en 0666 system system /sys/bus/iio/devices/iio:device in_anglvel_x_scale 0666 system system /sys/bus/iio/devices/iio:device in_anglvel_y_scale 0666 system system /sys/bus/iio/devices/iio:device in_anglvel_z_scale 0666 system system /sys/bus/iio/devices/iio:device in_anglvel_x_raw 0666 system system /sys/bus/iio/devices/iio:device in_anglvel_y_raw 0666 system system /sys/bus/iio/devices/iio:device* in_anglvel_z_raw 0666 system system
Dts file (I don't have an IRQ pin physically connected. I don't know if that is mandatory. Or the configuration would have to be different.):
'cat /proc/interrupts'
Also I modified SELinux policy: (I don't know if that is necesary)
But I received two errors when I compile:
STSensors.te:8:ERROR 'unknown type persist_file' at token ';'
"ERROR: permissive domains not allowed in user builds" violated by allow STSensors system_data_file:file { write create setattr append unlink rename }