Page 1 of 1

Looking to port project to Gentoo

Posted: Tue Aug 11, 2020 4:17 am
by DarkElvenAngel
Hello,

I've been working on an argon one replacement daemon. I wanted to bring support to Gentoo. I've installed the latest image with PINN.

I have a few questions about this image as I haven't used Gentoo for many years. I don't remember exactly how to get this all myself.

What init system is in use? I'm getting systemV I thought this would not be the case. I need to know so I can write the correct init script.

Everything else works properly with my installer, just need to sort out how to get the service to start on boot and there is a special command that must only run if the system is going to halt or power off.

Thanks.

Re: Looking to port project to Gentoo

Posted: Tue Aug 11, 2020 4:36 am
by markkuk
DarkElvenAngel wrote:
Tue Aug 11, 2020 4:17 am
What init system is in use? I'm getting systemV I thought this would not be the case. I need to know so I can write the correct init script.
OpenRC. See: https://wiki.gentoo.org/wiki/Handbook:A ... nitscripts

Re: Looking to port project to Gentoo

Posted: Tue Aug 11, 2020 1:06 pm
by DarkElvenAngel
markkuk wrote:
Tue Aug 11, 2020 4:36 am
DarkElvenAngel wrote:
Tue Aug 11, 2020 4:17 am
What init system is in use? I'm getting systemV I thought this would not be the case. I need to know so I can write the correct init script.
OpenRC. See: https://wiki.gentoo.org/wiki/Handbook:A ... nitscripts
Thanks, that's very helpful. Now I can see that my shutdown halt script also needs to run at runlevel 0

I'll get something together and give it a test.

Re: Looking to port project to Gentoo

Posted: Fri Aug 14, 2020 1:40 pm
by DarkElvenAngel
So I've come across another curiosity with this image and I wonder if like Manjaro there is another step to activate the I2C bus.

My overlay does the same as dtparam=i2c_arm=1 however if I don't use the GUI to turn on the i2c bus it doesn't seem to work. I also tried adding the i2c_arm line to the config.txt

Any ideas?

Re: Looking to port project to Gentoo

Posted: Fri Aug 14, 2020 9:14 pm
by sakaki
DarkElvenAngel,

on the image (assuming it is gentoo-on-rpi-64bit?) you need to ensure users in the i2c group can access I2C devices, and also ensure the i2c_dev kernel module is loaded.

This is carried out by the rpi-i2c service, installed and enabled by default. Its ebuild is here. As you can see, it directly installs a udev rule and a service which modprobes the necessary module at boot.

Check you don't have an old /boot/config.txt.tbc file lying around, as this can confuse the rpi-i2c service.

hth, sakaki

Re: Looking to port project to Gentoo

Posted: Fri Aug 14, 2020 10:28 pm
by DarkElvenAngel
sakaki wrote:
Fri Aug 14, 2020 9:14 pm
DarkElvenAngel,

on the image (assuming it is gentoo-on-rpi-64bit?) you need to ensure users in the i2c group can access I2C devices, and also ensure the i2c_dev kernel module is loaded.

This is carried out by the rpi-i2c service, installed and enabled by default. Its ebuild is here. As you can see, it directly installs a udev rule and a service which modprobes the necessary module at boot.

Check you don't have an old /boot/config.txt.tbc file lying around, as this can confuse the rpi-i2c service.

hth, sakaki
Thank you sakaki,

I understand why my overlay isn't working it's meant to work without the need of the dtparam=i2c_arm=on.

I will simply have my installer add this line into the config.txt and hopefully that will solve things.

The Gentoo image I'm using was installed with PINN as I'm trying to add support for more operating systems to this project.

Re: Looking to port project to Gentoo

Posted: Fri Aug 14, 2020 11:16 pm
by DarkElvenAngel
I seem to have broken the i2c it doesn't come up anymore. I've only been manually editting the config.txt file.

seems to be kernel related the i2c_dev module is loaded yet there are no entries in /dev

Re: Looking to port project to Gentoo

Posted: Sat Aug 15, 2020 8:53 pm
by DarkElvenAngel
I'm not sure what I did to it but I'm just going to reinstall it. I don't know the problem but the i2c bus isn't working at the module is loaded but the /dev/i2c-1 never comes up anymore. Even after reinstalling I know the Pi isn't the problem I have Manjaro installed as well and the i2c works.

I see how the i2c service works and I will just have the installer set the dtparam=i2c_arm=on since the device-tree data isn't processed.

The only other option would be to have the service modprobe i2c_arm is this appropriate?