Page 1 of 1

piControl folder

Posted: 07 Feb 2023, 14:19
by songha
Hi everyone,

I want to modify the kernel module "piControl" in my revpi connect. But I can't find where this folder locates in the directory! Can someone help me please?
piControl folder is found on : https://github.com/RevolutionPi/piControl

Thank you very much!
Song

Re: piControl folder

Posted: 07 Feb 2023, 15:15
by nicolaiB
Hi

piControl is a kernel module and can be build with the usual tools (see https://github.com/RevolutionPi/piContr ... r/Makefile for an example). The compiled modules are located in /lib/modules (for each arch).

Nicolai

Re: piControl folder

Posted: 07 Feb 2023, 15:43
by songha
Thank you for your quickly answer,

now i have another problem. When i tried to run makefile using "make" or "sudo make" command. I have the following problem. I'm sure that the directory exits there.
p/s: i haven't changed anything from piControl Repo!

Thank you for your help!
Song

Image

Re: piControl folder

Posted: 07 Feb 2023, 16:58
by songha
Hi,

now i clone the piControl for my revpi connect and run the makefile on it. I have already assigned a directory for " KDIR := /lib/modules/ยง(shell uname -r)/extra " in the makefile. The old error is gone. But i received an other error like following:

Image

Please help me,
Song

Re: piControl folder

Posted: 07 Feb 2023, 17:54
by nicolaiB

Code: Select all

# install kernel headers, which are required for the build
sudo apt-get install -y raspberrypi-kernel-headers

# clone sources
git clone https://github.com/RevolutionPi/piControl.git
cd piControl

# make modifications
# [...]

# compile module
KDIR=/usr/src/linux-headers-$(uname -r) make

# test module without overriding the release one
# unload old module
rmmod piControl

# load new one
insmod piControl.ko

Re: piControl folder

Posted: 07 Feb 2023, 19:15
by songha
Thank you Nicolas,

now run my makefile. But i have other problem. :cry:

Image



I installed kernel image : 4.19.95-rt38-v7 using sudo apt-get install -y raspberrypi-kernel

Re: piControl folder

Posted: 07 Feb 2023, 20:39
by nicolaiB
Which branch of the piControl sources do you use? You're using an older kernel 4.19 which is not supported by the latest Master. Please make sure that you update the kernel or use the legacy revpi-4.19 branch of piControl.

Nicolai

Re: piControl folder

Posted: 07 Feb 2023, 21:52
by songha
Thank you Nicolai,

i'm using now the brach for 4.19 and everything works fine now.
But i can't use the command "rmmod piControl". It said that piControl is in use. Even i use "--force" option. I also tried the "modprobe" command but it doesn't work too. If i disable "piControl" from booting. It also can't remove piControl module because the piControl module is not loaded into kernel.
So, i have to remove manually the piControl.ko file in lib/modules/...../extra folder for each arch by using "rm" command and copy the new .ko file into it using "cp" command. After rebooting it same to be work fine with new .ko module. But that's an inconvenient way...
If you have faced this problem before, pls tells me how to solve it.

Thank you very much,

Song

Re: piControl folder

Posted: 07 Feb 2023, 22:15
by nicolaiB
Yes, this is a known issue with the 4.19 branch. It is fixed in 5.10 / master. There are no plans to fix this for the legacy version. So probably the solution is to replace the piControl.ko and restart after that (if you don't want to backport the changes).

Nicolai

Re: piControl folder

Posted: 07 Feb 2023, 23:59
by songha
Hi Nicolai,

so i think the best way is to upgrade the version for linux kernel. Many thanks for your help.

Song