drtyhlpr / rpi23-gen-image

Advanced Debian "stretch" and "buster" bootstrap script for RPi 0/1/2/3 and QEMU
GNU General Public License v2.0
307 stars 123 forks source link

Kernel version issue : 5.10.44-v7 with wrong architecture of binaries in /usr/src/linux (SOLVED) #229

Open g-vidal opened 3 years ago

g-vidal commented 3 years ago

I cannot compile drivers for :

Bus 001 Device 004: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 001 Device 005: ID 0bda:b812 Realtek Semiconductor Corp. RTL88x2bu [AC1200 Techkey]

Drivers sources (some versions) are available in github but when I try to compile them it fails because the linux-headers packages bear version 5.10.0-7-armmp in their names while Version displayed is 5.10.40-1 and uname gives 5.10.44-v7.

uname -a
Linux raspife3P 5.10.44-v7 #1 SMP Sat Jun 19 18:49:32 CEST 2021 armv7l GNU/Linux
dpkg -l linux-headers*
ii  linux-headers-5.10.0-7-armmp  5.10.40-1    armhf        Header files for Linux 5.10.0-7-armmp
ii  linux-headers-5.10.0-7-common 5.10.40-1    all          Common header files for Linux 5.10.0-7

there must be something wrong either in my config file or in the bootstrap process, but unfortunatenately beyond my knowledge and skills can anybody propose a workaround or fix up this problem to enable use the wifi extensions.

#-----------------------
#--- Kernel settings ---
#-----------------------
BUILD_KERNEL=true
KERNEL_BRANCH=rpi-5.10.y
KERNEL_REDUCE=false
KERNEL_HEADERS=true
KERNEL_MENUCONFIG=false
KERNEL_CCACHE=true
KERNEL_REMOVESRC=true
KERNELSRC_CLEAN=true
KERNELSRC_CONFIG=true
KERNEL_DEFAULT_GOV=ondemand
KERNEL_VIRT=false
KERNEL_SECURITY=false
KERNEL_DHKEY=true

Many thanks

g-vidal commented 3 years ago

I have further investigated and in the linux sources (/usr/src/linux) copied inside the image, at least some binaries are x86_64 instead of armhf. I did not notice that until I tried to compile drivers for realtek wifi dongles that are not provided in the packages rtl88x2bu and tl88x2bu.

It seeems that the linux source copied on the image is the host's and not the guests's.

g-vidal commented 3 years ago

Solution has been to download and compile the kernel on the raspberry Pi then the installation of rtl88x2bu and tl88x2bu works like a charm. BUT that workaround does not fix the problem of the wrong architecture of some binaries in /usr/src/linux if anybody with knowledge in cross compilation may help, it could be a progress thanks