Camilo Martin Posted January 3, 2017 Share Posted January 3, 2017 I'm trying to compile the tv.ko driver for the NanoPi M1 (to see if I can bake overscan compensation into it). First I compiled the whole of Armbian to see if I can produce the .ko in such a roundabout way, but besides being a very dumb/slow way of going about it, I can't find any file called "tv.ko" after running all of that (it probably gets cleaned up). Short of mounting the generated Armbian image manually and extracting tv.ko, is there a way to compile just the driver? It normally sits at: /lib/modules/3.4.112-sun8i/kernel/drivers/video/sunxi/disp2/tv/tv.ko And sources for it are under: sources/linux-sun8i/sun8i/drivers/video/sunxi/disp2/tv/ The modinfo is: filename: /lib/modules/3.4.112-sun8i/kernel/drivers/video/sunxi/disp2/tv/tv.ko alias: platform:tv license: GPL description: tv driver author: zengqi depends: intree: Y vermagic: 3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 I tried to insmod "tv.o" but that's not it... (yes, I have no idea what I'm doing) Link to comment Share on other sites More sharing options...
Igor Posted January 3, 2017 Share Posted January 3, 2017 https://github.com/igorpecovnik/lib/commit/e2c7fc5f25416580ab99fc61ad3380c99390d0bc Because it's build in by default. Link to comment Share on other sites More sharing options...
Camilo Martin Posted January 9, 2017 Author Share Posted January 9, 2017 https://github.com/igorpecovnik/lib/commit/e2c7fc5f25416580ab99fc61ad3380c99390d0bc Because it's build in by default. Thanks. I did manage to get drivers/video/sunxi/disp2/tv/tv.ko to compile, through compiling the whole thing. Still, it takes a lot of time because it really is compiling everything. So I spent a few moments each day looking at how to just compile the driver. Is it even possible to just compile one driver? I ask this because maybe I shouldn't be trying to do it. (The toolchain patches stuff on the fly and does so many things... it is amazing but at the same time something I'm not used to). Link to comment Share on other sites More sharing options...
Camilo Martin Posted January 10, 2017 Author Share Posted January 10, 2017 Also, wanted to add that compiling the tv.ko module works, but I get modprobe: ERROR: could not insert 'tv': Exec format error Which is strange because modprobe --force works, the module can be compiled and made to work. Is it some sort of signature thing where I should add a permission somewhere? (I just replaced the file at /lib/modules/3.4.112-sun8i/kernel/drivers/video/sunxi/disp2/tv/tv.ko - I can't seem to make it load just like that with /etc/modules though) Link to comment Share on other sites More sharing options...
jernej Posted January 10, 2017 Share Posted January 10, 2017 What Igor meant is that in newer version of Armbian TV driver is hardcoded into kernel and it is not module anymore. This means that it should work by changing only script.bin. I don't think you can properly load driver as a module if same driver is part of the kernel. Link to comment Share on other sites More sharing options...
Camilo Martin Posted January 10, 2017 Author Share Posted January 10, 2017 What Igor meant is that in newer version of Armbian TV driver is hardcoded into kernel and it is not module anymore. This means that it should work by changing only script.bin. I don't think you can properly load driver as a module if same driver is part of the kernel. But the image I'm using (Armbian_5.20_Nanopim1_Debian_jessie_3.4.112_desktop.img) has the driver as a module, so that was a recent change right? (I wonder if even if I edit a module and somehow get it to load without modprobe --force, will it get superseded by a dist-upgrade?) Thanks for the reply either way. Link to comment Share on other sites More sharing options...
Igor Posted January 10, 2017 Share Posted January 10, 2017 Unfortunately, you need to compile your own kernel if you want to play around here. At least we made this as easy as possible. You need to invoke kernel configuration menu or edit config manually and set tv to module or do whatever you want to the code in the process of building kernel. Link to comment Share on other sites More sharing options...
Camilo Martin Posted January 11, 2017 Author Share Posted January 11, 2017 Unfortunately, you need to compile your own kernel if you want to play around here. I'm willing to accept that, but there's just one thing I'm not understanding. When apt-get updates the kernel, it doesn't update every module, right? tv.ko and the other .kos would remain untouched and still work, is this correct? (I'm asking this because I presume compiling my own kernel means I won't be able to rely on apt-get for updates after that) Link to comment Share on other sites More sharing options...
Igor Posted January 11, 2017 Share Posted January 11, 2017 I'm willing to accept that, but there's just one thing I'm not understanding. When apt-get updates the kernel, it doesn't update every module, right? tv.ko and the other .kos would remain untouched and still work, is this correct? (I'm asking this because I presume compiling my own kernel means I won't be able to rely on apt-get for updates after that) Yes, it updates / overwrites modules too. If changes you made are generally useful, push then upstream and let others enjoy too and you don't need to worry about this. Link to comment Share on other sites More sharing options...
zador.blood.stained Posted January 11, 2017 Share Posted January 11, 2017 If changes you made are generally useful, push then upstream and let others enjoy too and you don't need to worry about this. Otherwise use "apt-mark hold <package_name>" to prevent upgrading the kernel packages Link to comment Share on other sites More sharing options...
Camilo Martin Posted February 14, 2017 Author Share Posted February 14, 2017 Just wanted to thank all the great users/devs of this community for helping out but at the end I just couldn't manage to find a way to compile the kernel module and gave up. Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2017 Share Posted March 5, 2017 I am sure it's possible to compile a kernel module apt-get -y install git git clone https://github.com/igorpecovnik/lib --depth 1 cp lib/compile.sh . ./compile.sh On a hosted webserver it works perfectly !!!!! (not behind a proxy) So, all is ok for me at this step The patch I need : https://github.com/igorpecovnik/lib/blob/master/patch/kernel/sun7i-default/0050-lircgpio_and_raw.patch And now I see that I've lost some buildroot knowledges.... Is there an apply-patch.sh ? May I put the patch in ~/crosscompile/userpatches ? Link to comment Share on other sites More sharing options...
Recommended Posts