


Yes from source, https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/ this package is necessary for the screenrotation and ambient light functions in gnomeGDH-gentoo wrote:Bastien Nocera, is it any wonder... As far as I can tell looking at the source repository, all the package wants from systemd is its .pc file, to know where to put its service unit file. It can probably be coerced into working with OpenRC by patching its configure.ac file and udev rule, and writing an OpenRC service script for the iio-sensor-proxy program. Gentoo does not have this package, were you intending to install it from source, or what?

Code: Select all
--- configure.ac 2020-03-23 07:06:06.000000000 -0300
+++ configure.ac 2020-06-21 14:04:26.381164850 -0300
@@ -32,11 +32,10 @@
[with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)"/rules.d"])
AC_SUBST([udevrulesdir], [$with_udevrulesdir])
-PKG_CHECK_EXISTS(systemd, [], [AC_MSG_ERROR(systemd development libraries are required)])
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[],
- [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+ [with_systemdsystemunitdir=/lib/systemd/system])
if test x$with_systemdsystemunitdir != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fiCode: Select all
$ patch <remove-systemd-build-dep.patch
patching file configure.ac
$ autoreconf -v
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: configure.ac: not using Gettext
autoreconf-2.69: running: aclocal
autoreconf-2.69: configure.ac: tracing
autoreconf-2.69: configure.ac: not using Libtool
autoreconf-2.69: running: /usr/bin/autoconf-2.69
autoreconf-2.69: configure.ac: not using Autoheader
autoreconf-2.69: running: automake --no-force
docs/Makefile.am:51: warning: EXTRA_DIST multiply defined in condition TRUE ...
gtk-doc.make:51: ... 'EXTRA_DIST' previously defined here
docs/Makefile.am:49: 'gtk-doc.make' included from here
src/Makefile.am:5: warning: shell glib-compile-resources --sourcedir=$(srcdir: non-POSIX variable name
src/Makefile.am:5: (probably a GNU make extension)
autoreconf-2.69: Leaving directory `.'
The patch failAnd see if it builds. This should make the build system install the service unit file in /lib/systemd/system (Gentoo's default without systemd). The location can be changed by passing a --with-systemdsystemunitdir option to the configure script.
Code: Select all
patching file configure.ac
Hunk #1 FAILED at 32.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej

Check that indented lines really have a TAB character after the first character (a space or a '-', depending on the line), followed by 4 spaces. Copy & paste from the forum might have messed whitespace characters.Anroch2020 wrote:The patch failCode: Select all
patching file configure.ac Hunk #1 FAILED at 32. 1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej

This output is ok?Check that indented lines really have a TAB character after the first character (a space or a '-', depending on the line), followed by 4 spaces. Copy & paste from the forum might have messed whitespace characters.
Code: Select all
patch
patching file configure.ac
Hunk #1 succeeded at 32 with fuzz 2.

Sucesfully builded and installed but the sensor dont work, Is it possible that I have forgotten some parameter in the kernel?Hu wrote:Yes. Fuzz indicates that the lines were not found at precisely the planned offset, but that the patch was close enough and was applied. This often means that the version you patched is not exactly the version that the patch author started from. In some cases, particularly when the area to patch is repeated in the target file, a fuzz-apply can mean that the patch was applied incorrectly. For the context shown for this patch, I doubt that patch could get it wrong and still report success. Please try it out and report whether it works for you.

Haha, too greedy. The test was just to see if the package would build, i.e. if the dependency on systemd was superfluous. Nothing will work until there is an OpenRC service script to start the service. That has to be written, because the package only provides a systemd service unit file.Anroch2020 wrote:Sucesfully builded and installed but the sensor dont work, Is it possible that I have forgotten some parameter in the kernel?

::lol:The test was just to see if the package would build, i.e. if the dependency on systemd was superfluous. Nothing will work until there is an OpenRC service script to start the service. That has to be written, because the package only provides a systemd service unit file.
Code: Select all
[Unit]
Description=IIO Sensor Proxy service
[Service]
Type=dbus
BusName=net.hadess.SensorProxy
ExecStart=/usr/sbin/iio-sensor-proxy
#Uncomment this to enable debug
#Environment="G_MESSAGES_DEBUG=all"
# Lockdown
ProtectSystem=strict
ProtectControlGroups=true
ProtectHome=true
ProtectKernelModules=true
PrivateTmp=true
RestrictAddressFamilies=AF_UNIX AF_LOCAL AF_NETLINK
MemoryDenyWriteExecute=true
RestrictRealtime=true


Code: Select all
#!/sbin/openrc-run
command=iio-sensor-proxy
command_background=yes
pidfile=/run/iio-sensor-proxy.pid
depend() {
need dbus localmount
}Code: Select all
# rc-update add iio-sensor-proxy default
I rebooted and the sensors not work, cheking rc-status the service apparently is crashedGDH-gentoo wrote:OK. When running systemd, what supposedly happens is that the udev rule adds a "systemd" tag to all sensors that match, systemd sees that and creates a device unit for them, with a "Wants=" dependency on the service unit. This autostarts the iio-sensor-proxy daemon.
Now the following is totally untested, because I lack the required hardware.
You could start the daemon unconditionally, regardless of whether there is any relevant hardware, and obviously without everything that systemd does when it sees the directives that are listed after the "# Lockdown" comment, by adding the following service to the default runlevel:
/etc/init.d/iio-sensor-proxyCode: Select all
#!/sbin/openrc-run command=iio-sensor-proxy command_background=yes pidfile=/run/iio-sensor-proxy.pid depend() { need dbus localmount }You probably need to reboot to redo the coldplug sequence, and start the service.Code: Select all
# rc-update add iio-sensor-proxy default
Code: Select all
Runlevel: default
dbus [ started ]
NetworkManager [ started ]
sysklogd [ started ]
acpid [ started ]
netmount [ started ]
xdm [ started ]
alsasound [ started ]
bluetooth [ started ]
cronie [ started ]
firewalld [ started ]
iio-sensor-proxy [ crashed ]
laptop_mode [ started ]
thermald [ started ]
vmware [ started ]
local [ started ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
xdm-setup [ started ]
Dynamic Runlevel: manual
openrc-settingsd [ started ]
Code: Select all
$ sudo rc-service -v iio-sensor-proxy restart
* Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/iio-sensor-proxy stop
* Stopping iio-sensor-proxy ...
* Will stop iio-sensor-proxy
* Will stop PID 12595
* Will stop processes of `iio-sensor-proxy'
* start-stop-daemon: no matching processes found [ ok ]
* Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/iio-sensor-proxy start
* Starting iio-sensor-proxy ...
* start-stop-daemon: fopen `/run/iio-sensor-proxy.pid': No such file or directory
* Detaching to start `iio-sensor-proxy' ... [ ok ]

Code: Select all
#!/sbin/openrc-run
command=iio-sensor-proxy
command_background=yes
pidfile=/run/iio-sensor-proxy.pid
output_log=/var/log/iio-sensor-proxy-stdout.log
error_log=/var/log/iio-sensor-proxy-stderr.log
export G_MESSAGES_DEBUG=all
depend() {
need dbus localmount
}
Its working now!, thanks for helping me without your help I would have gone back to systemdGDH-gentoo wrote:Oh, the daemon is exiting, apparently. Try this service script:
/etc/init.d/iio-sensor-proxyThis should create logs in files /var/log/iio-sensor-proxy-stdout.log and /var/log/iio-sensor-proxy-stderr.log when the service is started or restarted and then crashes, and should make them verbose. Then post the contents of these files.Code: Select all
#!/sbin/openrc-run command=iio-sensor-proxy command_background=yes pidfile=/run/iio-sensor-proxy.pid output_log=/var/log/iio-sensor-proxy-stdout.log error_log=/var/log/iio-sensor-proxy-stderr.log export G_MESSAGES_DEBUG=all depend() { need dbus localmount }
Code: Select all
/var/log/iio-sensor-proxy-stdout.log
** (process:4770): DEBUG: 16:39:19.303: Found IIO poll als at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200041.9.auto/iio:device5
** (process:4770): DEBUG: 16:39:19.303: Found device /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200041.9.auto/iio:device5 of type ambient light sensor at IIO Polling Light sensor
** (process:4770): DEBUG: 16:39:19.304: Found associated trigger at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/trigger1
** (process:4770): DEBUG: 16:39:19.304: Found IIO buffer accelerometer at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1
** (process:4770): DEBUG: 16:39:19.304: No auto-detected location, falling back to display location
** (process:4770): DEBUG: 16:39:19.304: Found device /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1 of type accelerometer at IIO Buffer accelerometer
** (process:4770): DEBUG: 16:39:19.304: Found IIO buffer compass at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0
** (process:4770): DEBUG: 16:39:19.304: Found device /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0 of type compass at IIO Buffer Compass
** (process:4770): DEBUG: 16:39:19.308: Found associated trigger at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/trigger1
** (process:4770): DEBUG: 16:39:19.310: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/scan_elements/in_accel_x_en
** (process:4770): DEBUG: 16:39:19.310: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/scan_elements/in_accel_z_en
** (process:4770): DEBUG: 16:39:19.310: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/scan_elements/in_timestamp_en
** (process:4770): DEBUG: 16:39:19.310: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/scan_elements/in_accel_y_en
** (process:4770): DEBUG: 16:39:19.522: Trying to read 'in_accel_x_scale' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.522: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_x_scale: No such file or directory
** (process:4770): DEBUG: 16:39:19.522: Trying to read 'in_accel_scale' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.522: Trying to read 'in_accel_x_offset' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_x_offset: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_offset' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Got type for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_z_scale' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_z_scale: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_scale' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_z_offset' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_z_offset: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_offset' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Got type for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_timestamp_scale' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_timestamp_scale: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_scale' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_scale: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_timestamp_offset' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_timestamp_offset: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_offset' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_offset: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Got type for in_timestamp: is signed: 1, bytes: 8, bits_used: 64, shift: 0, mask: 0x18446744073709551615, be: 0
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_y_scale' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_y_scale: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_scale' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_y_offset' (name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.523: Failed to read float from /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1/in_accel_y_offset: No such file or directory
** (process:4770): DEBUG: 16:39:19.523: Trying to read 'in_accel_offset' (generic name) from dir '/sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200073.4.auto/iio:device1'
** (process:4770): DEBUG: 16:39:19.524: Got type for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.524: Built channel array for in_accel_x: index: 0, is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.524: Built channel array for in_accel_y: index: 1, is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.524: Built channel array for in_accel_z: index: 2, is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x4294967295, be: 0
** (process:4770): DEBUG: 16:39:19.524: Built channel array for in_timestamp: index: 3, is signed: 1, bytes: 8, bits_used: 64, shift: 0, mask: 0x18446744073709551615, be: 0
** (process:4770): DEBUG: 16:39:19.524: Failed to auto-detect mount matrix, falling back to identity
** (process:4770): DEBUG: 16:39:19.524: No auto-detected location, falling back to display location
** (process:4770): DEBUG: 16:39:19.528: Found associated trigger at /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/trigger0
** (process:4770): DEBUG: 16:39:19.531: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0/scan_elements/in_magn_z_en
** (process:4770): DEBUG: 16:39:19.531: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0/scan_elements/in_magn_y_en
** (process:4770): DEBUG: 16:39:19.531: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0/scan_elements/in_magn_x_en
** (process:4770): DEBUG: 16:39:19.531: Enabled sensor /sys/devices/pci0000:00/INT3432:00/i2c-0/i2c-SMO91D0:00/0018:0483:91D1.0001/HID-SENSOR-200083.6.auto/iio:device0/scan_elements/in_rot_from_north_magnetic_tilt_comp_en

Excelent! If it is working, I suggest commenting the added lines, because the /var/log files can grow indefinitely and fill your disk. You can uncomment them whenever you need them again.Anroch2020 wrote:Its working now!, thanks for helping me without your help I would have gone back to systemd
I don't know if it was the new script or if it because i enabled all the hid sensors in the kernel
Code: Select all
#output_log=/var/log/iio-sensor-proxy-stdout.log
#error_log=/var/log/iio-sensor-proxy-stderr.log
#export G_MESSAGES_DEBUG=all
Done,Thank you!, now i have a full functional gentoo tablet!Excelent! If it is working, I suggest commenting the added lines, because the /var/log files can grow indefinitely and fill your disk. You can uncomment them whenever you need them again.
Code: Select all
#output_log=/var/log/iio-sensor-proxy-stdout.log #error_log=/var/log/iio-sensor-proxy-stderr.log #export G_MESSAGES_DEBUG=all