piControl folder

Topics about the Software of Revolution Pi
Post Reply
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

piControl folder

Post 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
User avatar
nicolaiB
KUNBUS
Posts: 871
Joined: 21 Jun 2018, 10:33
Answers: 7
Location: Berlin
Contact:

Re: piControl folder

Post 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
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

Re: piControl folder

Post 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
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

Re: piControl folder

Post 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
User avatar
nicolaiB
KUNBUS
Posts: 871
Joined: 21 Jun 2018, 10:33
Answers: 7
Location: Berlin
Contact:

Re: piControl folder

Post 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
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

Re: piControl folder

Post 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
User avatar
nicolaiB
KUNBUS
Posts: 871
Joined: 21 Jun 2018, 10:33
Answers: 7
Location: Berlin
Contact:

Re: piControl folder

Post 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
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

Re: piControl folder

Post 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
User avatar
nicolaiB
KUNBUS
Posts: 871
Joined: 21 Jun 2018, 10:33
Answers: 7
Location: Berlin
Contact:

Re: piControl folder

Post 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
songha
Posts: 27
Joined: 02 Jul 2021, 12:48
Answers: 0

Re: piControl folder

Post by songha »

Hi Nicolai,

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

Song
Post Reply