Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Any iio sensor proxy alternative for openrc?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Thu Sep 19, 2024 5:42 pm    Post subject: Any iio sensor proxy alternative for openrc? Reply with quote

[Administrator note: this post was originally attached to the four year old solved topic Any iio sensor proxy alternative for openrc?[SOLVED]. For reader convenience, I modified the quote attributions to point to the posts they quote, rather than being usernames with no link to the original thread. -Hu]

GDH-gentoo wrote:
Anroch2020 wrote:
The patch fail
Code:
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.


I'm having some trouble with this. You're saying that the indented lines (lines 4, 9, 10, and 14?) should have:

<space><tab><space><space><space><space>

as the white space at the beginning of the line?

And the lines with a dash (line 11?) should be:

-<tab><space><space><space><space>


Sorry, I've never tried to patch something before, please excuse my ignorance :)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22648

PostPosted: Thu Sep 19, 2024 6:02 pm    Post subject: Reply with quote

Welcome to the forums.

Rather than try to repair the patch, I suggest you get a clean copy, the easy way:
  • Start a reply-with-quote to the post containing the patch
  • In the text edit box on the reply page, copy the patch to your clipboard, and then paste it into your favorite editor.
  • Save the content of the editor as a patch file.
  • Close the reply-with-quote page without replying. You only needed it for the side effect of getting the text edit box.
This path preserves whitespace, where copying it from the reading view of the thread does not.
Back to top
View user's profile Send private message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Thu Sep 19, 2024 6:56 pm    Post subject: Reply with quote

Hu wrote:
Welcome to the forums.

Rather than try to repair the patch, I suggest you get a clean copy, the easy way:
  • Start a reply-with-quote to the post containing the patch
  • In the text edit box on the reply page, copy the patch to your clipboard, and then paste it into your favorite editor.
  • Save the content of the editor as a patch file.
  • Close the reply-with-quote page without replying. You only needed it for the side effect of getting the text edit box.
This path preserves whitespace, where copying it from the reading view of the thread does not.


Thank you! I'm glad to be here! I'm loving Gentoo; the performance gains are real!

Thanks for the tip, that was what I needed to do.


So I got it to patch, but trying to install it by running:

Code:
$ sudo ./configure --prefix=/usr --sysconfdir=/etc
bash: ./configure: No such file or directory



So I made configure.ac executable and ran:

Code:
$ sudo ./configure.ac --prefix=/usr --sysconfdir=/etc
./configure.ac: line 1: syntax error near unexpected token `2.59'
./configure.ac: line 1: `AC_PREREQ(2.59)'


and now I don't know what to do. I suppose the error has something to do with dependencies, because it mentions prereq's, but how to resolve it is beyond me.

It would be great if there was a way to get the latest version (3.5, I believe) to work, but it uses meson to install, so everything is different and the patch doesn't work on it.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1699
Location: South America

PostPosted: Thu Sep 19, 2024 8:29 pm    Post subject: Reply with quote

GreyWizard wrote:
It would be great if there was a way to get the latest version (3.5, I believe) to work, but it uses meson to install, so everything is different and the patch doesn't work on it.

I believe that version 3.5 doesn't need patching, just the extra option -Dsystemdsystemunitdir=/lib/systemd/system in the invocation of meson on a Gentoo OpenRC computer. Plus the service script for OpenRC because the installed systemd service unit file won't do anything.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Thu Sep 19, 2024 9:24 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Exactly. Was file 80-iio-sensor-proxy.rules installed in /lib/udev/rules.d, and file net.hadess.SensorProxy.conf installed in /etc/dbus-1/system.d?



Okay so the extra option let me install the service, and I was able to make a rc script, but net.hadess.SensorProxy.conf is not in the noted location and the service stops. find / -iname SensorProxy yeilded no results.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1699
Location: South America

PostPosted: Thu Sep 19, 2024 10:11 pm    Post subject: Reply with quote

GreyWizard wrote:
Okay so the extra option let me install the service, and I was able to make a rc script, but net.hadess.SensorProxy.conf is not in the noted location and the service stops. find / -iname SensorProxy yeilded no results.

iio-sensor-proxy 3.5 should have net.hadess.SensorProxy.conf installed in /usr/share/dbus-1/system.d, with the same effect. Is it not there?
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Thu Sep 19, 2024 10:18 pm    Post subject: Reply with quote

Oh, yes, but for some reason find didn't find it.

Okay, so here's what I get, and the log files didn't get created:

Code:

# rc-service iio-sensor-proxy start
 * Starting iio-sensor-proxy ...
 * start-stop-daemon: (null) does not exist
 * Failed to start iio-sensor-proxy                                               [ !! ]
 * ERROR: iio-sensor-proxy failed to start
[/code]
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1699
Location: South America

PostPosted: Thu Sep 19, 2024 10:45 pm    Post subject: Reply with quote

GreyWizard wrote:
Code:
 * start-stop-daemon: (null) does not exist

Did you use the script that was posted in this thread? Repeat with the verbose option:

Code:
# rc-service -v iio-sensor-proxy start

_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Thu Sep 19, 2024 10:48 pm    Post subject: Reply with quote

Yeah, the second version with the logging stuff.

Code:
$ sudo rc-service -v iio-sensor-proxy start
* 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: (null) does not exist
* Failed to start iio-sensor-proxy                                                                                                                                                   [ !! ]
* ERROR: iio-sensor-proxy failed to start
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1699
Location: South America

PostPosted: Fri Sep 20, 2024 6:15 pm    Post subject: Reply with quote

GreyWizard wrote:
Code:
 * start-stop-daemon: (null) does not exist

I see, iio-sensor-proxy 3.5 now installs the executable in a different directory, and is no longer found by PATH search, so an absolute pathname is needed in the OpenRC service script. Try changing this line:

Code:
command=/usr/libexec/iio-sensor-proxy

Well, I think that is the pathname, go check :)
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
GreyWizard
n00b
n00b


Joined: 12 Sep 2024
Posts: 6
Location: The Deep South

PostPosted: Sun Sep 22, 2024 9:31 pm    Post subject: Reply with quote

Fantastic! It works!

Mr. GDH-gentoo, you are a gentleman and a scholar, and you have my thanks!

In an effort to streamline this thread for the next guy, following is a shortlist of the steps I took to get iio-sensor-proxy (version 3.5) to work on Gentoo with OpenRC on a device that does not have the correct drivers to read the accelerometers for screen rotation out of the box (in my case, a Lenovo Yoga 7i 16IRL8).

First, I cloned the iio-sensor-proxy repository. I cloned it to my desktop, but you can put it anywhere, as it is only temporary, and can be deleted after installation.
Code:
git clone https://gitlab.freedesktop.org/hadess/iio-sensor-proxy.git ~/Desktop/iio-sensor-proxy/


Next, I ran the commands shown in the README with the addition of a flag to get it to install even though I don't have the systemd requirement. This may need to be run as root.
Code:
cd ~/Desktop/iio-sensor-proxy/
meson _build -Dprefix=/usr -Dsystemdsystemunitdir=/lib/systemd/system
ninja -v -C _build install


Then, you must manually create a file for OpenRC to be able to run iio-sensor-proxy, since it was meant for systemd and doesn't make one automatically.
Code:
cat > /etc/init.d/iio-sensor-proxy << EOF
#!/sbin/openrc-run

command=/usr/libexec/iio-sensor-proxy
command_background=yes
pidfile=/run/iio-sensor-proxy.pid

depend() {
   need dbus localmount
}
EOF


You will probably have to run that as root. If that doesn't work, use your favorite text editor and create a new file /usr/libexec/iio-sensor-proxy and paste the above (everything in between the EOF's) into the file. I omitted the logging stuff.

Finally, you must add the program to OpenRC in such a way that it will run when you start up your computer. You will need to run this as root too, probably.
Code:
rc-update add iio-sensor-proxy default


Lastly, restart your computer. Either that or you may be able to just start it manually with:
Code:
rc-service iio-sensor-proxy start

Then log out and back in (to restart your desktop environment).

It automatically popped up in KDE Plasma settings for me, and worked after a reboot. This was practically the last thing keeping me from having near identical hardware support to the Windows 11 that came with the laptop, so I'm super excited to have it working :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum