You are not logged in.
Pages: 1
Hello.
I need to compile this kernel module: https://bugs.launchpad.net/ubuntu/+sour … ug/2000947
But when I run the make command:
make -j4 -C /lib/modules/$(uname -r)/build M=$(pwd) modules
I get
scripts/Makefile.build:41: /home/jenia/Documents/kernel-modules/camera/Makefile: No such file or directory
make[1]: *** No rule to make target '/home/jenia/Documents/kernel-modules/camera/Makefile'. Stop.
make: *** [Makefile:2021: /home/jenia/Documents/kernel-modules/camera] Error 2
Notice that I have the -C flag there pointing the make program to the directory `/lib/modules/$(uname -r)/build` where the makefile is located.
How do I correctly point the make to `/lib/modules/$(uname -r)/build`?
It's also note worthy if I remove all other flag other than the -C flag: `make -C /lib/modules/$(uname -r)/build modules`
I get:
mkdir: cannot create directory ‘.tmp_17624’: Permission denied
Can someone please tell me, how do I compile correctly that kernel module?
Last edited by jenia (2023-04-23 18:42:41)
Offline
/home/jenia/Documents/kernel-modules/camera/Makefile which is missing is the Makefile for the module. /lib/modules/$(uname -r)/build/Makefile is the Makefile for the kernel build system which calls the module Makefile in the directory passed via M=$(pwd)
Edit:
See also https://docs.kernel.org/kbuild/modules.html
Edit2:
https://patchwork.kernel.org/project/li … board.com/
Last edited by loqs (2023-03-10 00:23:01)
Offline
Hello loqs. Thanks kindly for the help. I have a follow up question, where do I find the makefile that should be in /home/jenia/Documents/kernel-modules/camera/Makefile ?
Its not in the original launchpad thread.
?
Should I write one myself to simply compile that .c file?
Offline
$ git clone https://github.com/archlinux/svntogit-packages --single-branch --branch 'packages/linux' linux # get the current PKGBUILD for Arch's kernel package
$ gpg --import keys/pgp/* # import the signing keys it uses
$ makepkg -Codd --noprepare # get the kernel source
$ curl -o media-uvcvideo-Force-UVC-version-to-1.0a-for-0408-4035.diff https://patchwork.kernel.org/project/linux-media/patch/20230115205210.20077-1-laurent.pinchart@ideasonboard.com/raw/ #get the patch
$ cd src/archlinux-linux/
$ git apply -v ../../media-uvcvideo-Force-UVC-version-to-1.0a-for-0408-4035.diff # apply the patch
$ cd drivers/media/usb/uvc/
$ make -C /lib/modules/$(uname -r)/build M=$PWD
# make -C /lib/modules/$(uname -r)/build M=$PWD modules_install # install the module ( I have not tested this last command )
Last edited by loqs (2023-03-10 01:19:23)
Offline
ok. I finally had time to do this and it ran flawlessly. I suggest to keep this page open for anyone consulting the instruction above: https://wiki.archlinux.org/title/Kernel_module
Offline
Thank you loqs!!
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
One more critical instruction to anyone trying to replicate this, change the device IDs in the patch with the ones outputted from lsusb on your machine.
Last edited by jenia (2023-04-23 15:02:01)
Offline
seth: I can't see the option to edit the title only the messages I posted.
Offline
seth: I can't see the option to edit the title only the messages I posted.
You have to edit the first post in the thread to have the option to edit the title.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I am really sorry if this comment might be considered necro-bumping, but I found that while this post really solves the issue, the solution isn't complete in which every kernel upgrade or re-installation will overwrite the patch.
I wanted to create a pacman hook to re-run the steps provided by loqs, but redownloading the entire kernel source before applying the patch each time I upgrade the linux kernel isn't practical.
I found that https://github.com/Kvalme/uvc is supposed to solve the same issue, but I wasn't convinced that applying a random kernel module patch on github is safe, so I combined both approaches, added audit and precaution instructions and created another repo to automate the process using pacman hooks: https://github.com/gchamon/uvc
Hope this helps other people with this issue, and sorry if my approach is too involved and there are other simpler ways to solve this, but I was battling this problem for the last couple of days and I think this is the best solution so far.
Offline
@gchamon have you considered working with the kernel developers to resolve the issue? https://patchwork.kernel.org/project/li … board.com/ ended with a request for information from someone with the hardware to which there was no response. You could also check if the issue is still present in mainline and the linux-media tree.
Offline
@loqs nice, I didn't see they were in need of testers with the required hardware. I am going to reach out. I just assumed these things take long. Thanks!
Offline
Pages: 1