Author Topic: Debian: linux-headers-3.4.79 / kernel modules / v4l2loopback  (Read 167 times)

Offline cubus

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Debian: linux-headers-3.4.79 / kernel modules / v4l2loopback
« on: November 02, 2017, 04:05:21 pm »
Dear Cubieboard community,

I'm trying to compile a kernel module (v4l2loopback) for 3.4.79 kernel, which is included in the debian image: debian-jessie-server-cubieaio-emmc-v1.0.img.
As I do not need a new kernel, I tried to do this on my CubieAIO system directly to mind complications with cross-compilation, which I never did before, neither I did much of kernel- or module compilation.

So my basic question in short words is: Are the linux-headers-3.4.79 available somewhere?

Assuming, that the answer is "no" (searching for days now), I tried several things:

Approach 1: Change kernel to the one offered by Debian Jessie repository
The out-of-the-box Debian repository offers: linux-headers-3.16.0-4-all-armhf. After installing using apt, "uname -r" still shows 3.4.79. I tried the same after upgrading to stretch and install 4.9.0.4 packages, still showing 3.4.79 as the current version. Even after reboot.
Question: Is there some way to run/activate these newly installed kernel versions?

Approach 2: Use headers from Cubian sources
I tried to use linux-headers-3.4.79-sun7i, which I downloaded from https://github.com/mmplayer/cubian-packages. After changing the included .config with the config file from /boot/ directory, compilation works, but probing the module (having to use --force) ends in a "Segmentation fault" and many hexadecimal numbers.
Question: Should Cubian and Debian sources/packages be compatible in any way?

Approach 2b: Create packages from Cubian sources
Trying to generate .deb or .pkg files running "./build-deb linux-headers-3.4.79-sun7i" leads to: "dpkg-deb: error: control directory has bad permissions 2755 (must be >=0755 and <=0775)"
Question: Where the heck is the "control directory"?

Approach 3: Switch to mainline kernel (didn't try already)
Much information I found was related to the usage of "mainline" kernel. Cubian seems to be quite outdated (last release: 2013?) - so I assume, nobody needs it anymore, because the mainline kernel supports the cubieboards anyway? Switching to the mainline would be the most attractive solution in long terms anyway, right? Since I have no idea about how much efforts this approach will take, let me please ask something before:
Question1: Is there an EMMC installation image for the Cubieboard AIO20 built with the mainline kernel?
Question2: I understand, that there currently is no display driver included in the mainline kernel. Can this driver be added without having to cross-compile and build an installer image?

It would be great to find some solution resulting in having a working kernel and it's according headers installed. I would not even mind switching to lubuntu (where I currently got similar results).
Alternatively, compiled versions of kernel modules (especially: v4l2loopback.ko) would do the job too of course.

All the best!

Offline cubus

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Debian: linux-headers-3.4.79 / kernel modules / v4l2loopback
« Reply #1 on: November 06, 2017, 12:17:12 pm »
In the meantime, I got a solution:

Code: [Select]
apt install build-essential git
cd /usr/local/src
git clone https://github.com/mmplayer/linux-sunxi.git -b dev/sunxi-3.4 –depth=1
mv /lib/modules/3.4.79/build /lib/modules/3.4.79/build.distributed
ln -s /usr/local/src/linux-sunxi /lib/modules/3.4.79/build
cd linux-sunxi
cp /proc/config.gz .
gzip -d config.gz
mv config .config
make oldconfig
make prepare
make modules_prepare

then, eg. for installing v4l2loopback:
Code: [Select]
apt install v4l2loopback-dkms
modprobe --force v4l2loopback
Still have to "--force" the modprobe command, even if both - kernel and module.ko file info shows up 3.4.79