Kernel module in tree compile error

i need to have the module MT7921E it is no compiled by default

i have install all the tools and the kernel source

cd /usr/lib/modules/$(uname -r)/source

i copy the orignal .config created by redhat with this
cp -v /boot/config-$(uname -r) .config

*i edit the .config and replace

CONFIG_MT7921E is not set

by
CONFIG_MT7921E=m

i have installed the folowing rpms

sudo yum group install “Development Tools” -y
sudo yum -y install ncurses-devel make gcc bc openssl-devel
sudo yum -y install elfutils-libelf-devel
sudo yum -y install rpm-build
sudo yum -y install python3
sudo dnf config-manager --enable powertools
sudo yum -y install dwarves

i try just to make a bzImage
make bzImage
scripts/kconfig/conf --syncconfig Kconfig

configuration written to .config

DESCEND objtool
/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Makefile.build:37: /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Build.include: Aucun fichier ou dossier de ce type
make[4]: *** Aucune règle pour fabriquer la cible « /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Build.include ». Arrêt.
make[3]: *** [Makefile:47: /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/objtool/fixdep-in.o] Error 2
make[2]: *** [/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Makefile.include:4: fixdep] Error 2
make[1]: *** [Makefile:65: objtool] Error 2
make: *** [Makefile:1699: tools/objtool] Error 2

what am i doing wrong ?

same when i try to compile the module
make modules
DESCEND objtool
/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Makefile.build:37: /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Build.include: Aucun fichier ou dossier de ce type
make[4]: *** Aucune règle pour fabriquer la cible « /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Build.include ». Arrêt.
make[3]: *** [Makefile:47: /usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/objtool/fixdep-in.o] Error 2
make[2]: *** [/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64/tools/build/Makefile.include:4: fixdep] Error 2
make[1]: *** [Makefile:65: objtool] Error 2
make: *** [Makefile:1699: tools/objtool] Error 2

when i take the source kernel from Index of /pub/linux/kernel/v4.x/

it works without any troubel

i have also see that the .c are not part of the source kernel when it is installed by rpm

A page for Ubuntu claimed that mt7921 requires kernel 5.12 or newer. While Red Hat backports features, I’d not expect that much.

ELRepo builds mainline kernel that might have that module. See ELRepo | kernel-ml

Pro: no need to compile.
Con: you will depend on ELRepo for all kernel updates.

It work with elrepo but only the last kernel 5.16ML is working the 5.4 LT not i have a black screen on the L15 lenovo laptop.

with the kerne 5.16ml i have experiment from time to time a total freeze of the computer so this no a solution.

I try to recompile the redhat kernel because the source driver is present but not enabled int the .config.

If you have used a text editor to make the change, that may or may not work. This is because a change in one config option might require additional change(s).

Try running ‘make menuconfig’ to edit the config. Or with your manually modified .config file, try running ‘make oldconfig’.

The module is compiled sucessfully now but during the probe of the device it return à négative réponse of-5. I m gonna compare the output with thé same source but using elrepo kernel 5 because it s working on this kernel

Serge Sterck
FMSB-Computer Service Manager
Service Informatique- Dienst Informatica
T 02 506 97 15 serge.sterck@fmsb.be