Build new Drivers - Debian Image

Hello selina,
hello together,

on the images Debian isnt possible to build drivers for wifi. There are misssing some kernel packages. Is it possible to publish it and we can install it via apt ? So we can nothing do on the system
Everthing what i will it isnt possible. It makes me angry.

make ARCH=riscv CROSS_COMPILE= -C /lib/modules/5.15.0-starfive/build M=/root/rtl8188eu modules
make[1]: Entering directory ‘/usr/src/linux-headers-5.15.0-starfive’
Makefile:699: arch/riscv64/Makefile: No such file or directory
make[1]: *** No rule to make target ‘arch/riscv64/Makefile’. Stop.
make[1]: Leaving directory ‘/usr/src/linux-headers-5.15.0-starfive’
make: *** [Makefile:155: modules] Error 2

Then i tried the second way. Built the driver with the sdk. That was successfully. Next upload ko and firmware to the image.
Then i got the error with modprobe and insmod
3049.627950] 8188eu: Unknown symbol iwe_stream_add_event (err -2)
[ 3049.634466] 8188eu: Unknown symbol wireless_send_event (err -2)
[ 3049.640575] 8188eu: Unknown symbol iwe_stream_add_point (err -2)

When there is an other way then please explain the procedure ?

many thanks
Damian

1 Like

I did same kind of setup.
Used linux-menuconfig to enable the dedicated module of my wifi dongle (rtl8192cu in my case) then rebuild sdk.
Compilation ok, modules and stuff generated in 5.15.0-dirty then flash image to sdcard and so on.

When logged through uart, i can see that folder 5.15.0-dirty is not there but 5.15.0 is there instead.
2 questions:

  • how to avoid the dirty even if i commited the changes due to kernel config update
  • or how to flash the correct module 5.15.0-dirty instead of the original 5.15.0 ?

I’m wondering if in your case you are missing to upload some dependencies

Thanks

Hello Bertcay,

for the first point of your question:
You run ./build.sh and genimage.sh in the SDK root ?
touch .scmversion in the Kernel source VisionFive2/linux and in your SDK root do:
make linux-menuconfig and disable CONFIG_LOCALVERSION_AUTO.
And it works without dirty and the + sign.

And then in VisionFive2/linux/Makefile change Line 5 EXTRAVERSION = -starfive when you use the starfive Debian image. When you use the SDK image then leave it empty.

For all the devices the linux-firmware is missing too.
Please note that there are many other things missing where I keep coming across errors.

I hope it helps you ?

Regards
Damian

Hello Damian,

Many points here.

touch .scmversion in the Kernel source VisionFive2/linux and in your SDK root do:
make linux-menuconfig and disable CONFIG_LOCALVERSION_AUTO.

that made the job ! then right now 5.15.0-dirty is no more referenced and my driver is built in the right folder VisionFive2/work/module_install_path/lib/modules/5.15.0/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rtl8192cu.ko
But is still not included in the final img

Then, following your post, I decided to use build.sh and genimage.sh (previously I was using make && make buildroot_rootfs && make img)
→ That’s worse with build & genimage : I can’t even boot :slight_smile:

which image do you burn to your SD. From work the SDcard.img. Has it a new timestamp ?

yes yes image was regenerated

make vmlinux

unlocked the situation … I though it was done in some steps …
Then lsmod shows driver is loaded.

1 Like