Moderator Control Panel ]

Impossible to compile drivers in Ubuntu

It's important to keep your driver and software updated.

Impossible to compile drivers in Ubuntu

Postby SPiKeGoD » Fri Dec 20, 2024 4:40 am

Hi.

I can't install drivers on Ubuntu

Code: Select All Code
uname -a
Linux ubuntec 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux


I always get this error when i run "make -j4":

Code: Select All Code
make[2]: Entering directory '/usr/src/linux-headers-6.8.0-51-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
  You are using:           gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
  CC [M]  /home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.o
  LD [M]  /home/user/Downloads/tbsdrivers/media_build/v4l/cx25840.o
  CC [M]  /home/user/Downloads/tbsdrivers/media_build/v4l/dw9714.o
  CC [M]  /home/user/Downloads/tbsdrivers/media_build/v4l/dw9768.o
  CC [M]  /home/user/Downloads/tbsdrivers/media_build/v4l/dw9807-vcm.o
/home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.c: In function 'ccs_set_ctrl':
/home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.c:668:21: error: too many arguments to function 'pm_runtime_get_if_active'
  668 |         pm_status = pm_runtime_get_if_active(&client->dev, true);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.c:22:
./include/linux/pm_runtime.h:75:12: note: declared here
   75 | extern int pm_runtime_get_if_active(struct device *dev);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: /home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.o] Error 1
make[4]: *** Se espera a que terminen otras tareas....
make[3]: *** [/usr/src/linux-headers-6.8.0-51-generic/Makefile:1925: /home/user/Downloads/tbsdrivers/media_build/v4l] Error 2
make[2]: *** [Makefile:240: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.8.0-51-generic'
make[1]: *** [Makefile:53: default] Error 2
make[1]: se sale del directorio '/home/user/Downloads/tbsdrivers/media_build/v4l'
make: *** [Makefile:26: all] Error 2



I have to try to edit the file "/home/user/Downloads/tbsdrivers/media_build/v4l/ccs-core.c" and change the call of the function "pm_runtime_get_if_active(&client->dev, true);" by "pm_runtime_get_if_active(&client->dev);"

But when i run the command "make -j4" the "pm_runtime_get_if_active(&client->dev, true);" is coming back and get the same error again...

I am desesperate... Please, help me, i can't run my tbs moi pro amd :(

Thanks you very much in advance
SPiKeGoD
 
Posts: 22
Joined: Wed Mar 29, 2017 2:44 am

Re: Impossible to compile drivers in Ubuntu

Postby crazycat » Fri Dec 20, 2024 4:52 am

Look like forced backport from newer kernels > 6.8
Disable v6.8-ccs.patch in media_build/backports/backports.txt

https://github.com/tbsdtv/linux_media/issues/370
crazycat
 
Posts: 570
Joined: Mon Jan 31, 2011 2:46 am
Location: Ukraine, Kharkiv

Re: Impossible to compile drivers in Ubuntu

Postby SPiKeGoD » Fri Dec 20, 2024 5:19 am

crazycat Wrote:Look like forced backport from newer kernels > 6.8
Disable v6.8-ccs.patch in media_build/backports/backports.txt

https://github.com/tbsdtv/linux_media/issues/370


I have made this:

Code: Select All Code
git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media
cd media_build
nano backports/backports.txt     [b](and comment the line #add v6.8-ccs.patch)[/b]
make dir DIR=../media
make allyesconfig
sed -i -r 's/(^CONFIG.*_RC.*=)./\1n/g' v4l/.config
sed -i -r 's/(^CONFIG.*_IR.*=)./\1n/g' v4l/.config
make -j4
make install
reboot


And now it has finished well!!

Thanks you very much @crazycat !! You are amazing!
SPiKeGoD
 
Posts: 22
Joined: Wed Mar 29, 2017 2:44 am

Re: Impossible to compile drivers in Ubuntu

Postby Drifting » Fri Jan 10, 2025 6:55 am

Thank you all for the contributions, this was driving me nuts on a fresh install of Ubuntu
Drifting
 
Posts: 15
Joined: Fri Jul 15, 2011 9:07 pm

Re: Impossible to compile drivers in Ubuntu

Postby BlueSky » Wed Jan 29, 2025 3:46 am

I have a question for crazycat (or anyone who may know). On our system it has always been the case that every time there is a kernel update we wound up having to rebuild the drivers, I suspect because the kernel update wipes out the directory where the drivers are stored. In the past I had always downloaded the driver archive and then ran a script to rebuild the drivers (so I did not need to go and re-get the archive containing the drivers every time; I only did that when updated drivers were required), but earlier this month we updated the server to Ubuntu 24.04 and of course the old driver archive we had saved no longer worked. So we followed the instructions above (thank you!!!) and the drivers installed and are working now.

But today I got a notification that there is a kernel update (first one since the server upgrade) and assuming it does the usual thing of wiping out the existing drivers, I am wondering what is the bare minimum I need to do to get them working again. It appears that everything got installed to the /usr/src/media_build and /usr/src/media directories and I am hoping the kernel update will not mess with those in any way, so my question is could I just do this:

Code: Select All Code
cd /usr/src/media_build
sudo make install
reboot

or should I also run the "sudo make -j4" before the "sudo make install"? Or are neither of those sufficient and I have to do everything from scratch? I really want to know how to do this without having to re-download the drivers using git every time, just in case git is down or unreachable from my location.
BlueSky
 
Posts: 31
Joined: Sat Nov 08, 2014 12:46 pm

Re: Impossible to compile drivers in Ubuntu

Postby SPiKeGoD » Thu Jan 30, 2025 8:30 am

SPiKeGoD Wrote:
Code: Select All Code
git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media
cd media_build
nano backports/backports.txt     [b](and comment the line #add v6.8-ccs.patch)[/b]
make dir DIR=../media
make allyesconfig
sed -i -r 's/(^CONFIG.*_RC.*=)./\1n/g' v4l/.config
sed -i -r 's/(^CONFIG.*_IR.*=)./\1n/g' v4l/.config
make -j4
make install
reboot




It is NOT working for me in other installation:

Code: Select All Code
uname -a
Linux tbs2951 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux


The same error:

Code: Select All Code
make[2]: Leaving directory '/root/tbsdrivers/media_build/linux'
make -C /lib/modules/5.15.0-130-generic/build M=/root/tbsdrivers/media_build/v4l  modules
make[2]: Entering directory '/usr/src/linux-headers-5.15.0-130-generic'
  CC [M]  /root/tbsdrivers/media_build/v4l/ccs-core.o
  CC [M]  /root/tbsdrivers/media_build/v4l/cs3308.o
  CC [M]  /root/tbsdrivers/media_build/v4l/cs5345.o
  CC [M]  /root/tbsdrivers/media_build/v4l/cs53l32a.o
/root/tbsdrivers/media_build/v4l/ccs-core.c: In function 'ccs_set_ctrl':
/root/tbsdrivers/media_build/v4l/ccs-core.c:668:21: error: too few arguments to function 'pm_runtime_get_if_active'
  668 |         pm_status = pm_runtime_get_if_active(&client->dev);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/tbsdrivers/media_build/v4l/ccs-core.c:22:
./include/linux/pm_runtime.h:55:12: note: declared here
   55 | extern int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:297: /root/tbsdrivers/media_build/v4l/ccs-core.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:1910: /root/tbsdrivers/media_build/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.15.0-130-generic'
make[1]: *** [Makefile:53: default] Error 2
make[1]: Leaving directory '/root/tbsdrivers/media_build/v4l'
make: *** [Makefile:26: all] Error 2



I have commented the line on backports.txt but always I get the same error

Any ideas?
SPiKeGoD
 
Posts: 22
Joined: Wed Mar 29, 2017 2:44 am

Re: Impossible to compile drivers in Ubuntu

Postby BlueSky » Sun Feb 16, 2025 2:15 am

SPiKeGoD Wrote:
crazycat Wrote:Look like forced backport from newer kernels > 6.8
Disable v6.8-ccs.patch in media_build/backports/backports.txt

https://github.com/tbsdtv/linux_media/issues/370


I have made this:

Code: Select All Code
git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media
cd media_build
nano backports/backports.txt     [b](and comment the line #add v6.8-ccs.patch)[/b]
make dir DIR=../media
make allyesconfig
sed -i -r 's/(^CONFIG.*_RC.*=)./\1n/g' v4l/.config
sed -i -r 's/(^CONFIG.*_IR.*=)./\1n/g' v4l/.config
make -j4
make install
reboot


And now it has finished well!!

Thanks you very much @crazycat !! You are amazing!


Just FYI if you are trying to script this in a bash script, instead of using "nano backports/backports.txt (and comment the line #add v6.8-ccs.patch)" you can just do this:

Code: Select All Code
sed -i 's/^add v6.8-ccs.patch/# add v6.8-ccs.patch/' backports/backports.txt

(I am not a coder; I went to https://duck.ai and used Llama 3.3 70B to come up with that. Not that I could not have figured that out by searching the web but it would have taken me at least ten times as long).

BUT I am still trying to figure out if there is any way to do this without having to access github.com every time. My issue is that every time there is a kernel update (and Ubuntu seems to get a lot of kernel updates, sometimes every week or two) the drivers stop working until they are reinstalled. My big fear is always that I will do a kernel update and then Github will be down, or for some other reason I won't be able to access the current drivers. Previously I was able to download drivers once, in a file called media_build-2024-08-29.tar.bz2, and then install that using a script (at least until those drivers wouldn't build anymore, but that only seemed to happen about once every two or three years, and then I would just go get the newest file). But that does not seem to work anymore in Ubuntu 24.04. Since the /usr/src/media_build directory is still there after a kernel update I thought maybe I could just delete the /usr/src/media directory and then follow all the instructions after the two "git clone" lines but no, it fails at "make dir DIR=../media" (which I originally thought just created the /usr/src/media directory, but apparently it does more than that, and apparently the "git clone" lines have to be executed against the latest kernel for it to work).

So if anyone could advise me as to how to download and store the drivers on my system so I can rebuild from a static build each time I would very much appreciate it.
BlueSky
 
Posts: 31
Joined: Sat Nov 08, 2014 12:46 pm

Re: Impossible to compile drivers in Ubuntu

Postby smile » Mon Feb 17, 2025 11:15 am

Hello
We recommend disable the system auto updated kernel version .
if the kernel version updated, you just rebuild the drivers . do not need re-download the drivers .
use those command.

make distclean
make -j4
make install

reboot
smile
 
Posts: 181
Joined: Sun Oct 09, 2011 9:51 am


Return to Driver & Software Update

Who is online

Users browsing this forum: No registered users and 10 guests