skiffos / SkiffOS

Any Linux distribution, anywhere.

Home Page:https://skiffos.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rtl8821cu: kernel module not loaded automatically

danyer opened this issue · comments

Hi,

as this is my first bug report to SkiffOS, I would like to say that it is an amazing project, thank you for making it possible!

Now for the bug ;)

I have an Odroid HC1 board. I also have an Odroid WiFi module 5BK (0bda:c820). I'm using SkiffOS 2023.02, default configuration.

The module for the WiFi card (8821cu.ko) is not loaded automatically.
It is not loaded manually with modprobe either.
If I load it with insmod, then everything works.

The problem I think resides in the fact that 8821cu.ko is in /lib/modules/6.1.11/extra and modprobe does not look in that folder.

Some console output from a freshly booted system:

root@skiffos-a7203d4f:~# lsusb|grep NIC
Bus 001 Device 002: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC
root@skiffos-a7203d4f:~# lsmod|grep 8821cu
root@skiffos-a7203d4f:~# modprobe 8821cu
modprobe: FATAL: Module 8821cu not found in directory /lib/modules/6.1.11
root@skiffos-a7203d4f:~# ls -l /lib/modules/6.1.11/extra/
total 5735
-rw-r--r-- 1 core core 3181816 Mar 21 17:11 8821cu.ko
-rw-r--r-- 1 core core 2690132 Mar 21 17:11 88XXau.ko
root@skiffos-a7203d4f:~# insmod /lib/modules/6.1.11/extra/8821cu.ko
root@skiffos-a7203d4f:~# ip a show wlan0
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether e0:e1:a9:33:e9:c3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.86.107/24 brd 192.168.86.255 scope global dynamic noprefixroute wlan0
       valid_lft 86217sec preferred_lft 86217sec
    inet6 fd53:cfb1:ee11:552a:be3d:390b:b614:a19c/64 scope global dynamic noprefixroute 
       valid_lft 1620sec preferred_lft 1620sec
    inet6 fe80::cec5:1fd1:efb6:4624/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

The module is perfect (after insmod-ed manually, I remove ethernet cable and use only wifi connection to test its reliability), it is a pity that it is not loaded automatically. I would be happy with a workaround ;)

Please ask for more details if needed, I will happily provide them.

Thank you,
Dan.

@danyer I've just updated rtl8821cu to a newer version, please have a try and see if you still have the issue, if so I'll look into fixing it.

git checkout master
git pull
# You should now be on commit ef74e8d55d42b47a3a993a1bc8c5f3796a7e7659
git status
# Checkout newer version of buildroot/
git submodule update
# Compile the changed packages (without a full rebuild)
make br/rtl8821cu-dirclean compile

I've tested on an intel/desktop system running SkiffOS and modprobe 8821cu works. So i think modprobe can see it, at least. modprobe does recognize the extra/ folder.

Perhaps this isn't working with the odroid kernel - after updating the package as per above, let me know if modprobe 8821cu works. If not, I have a couple HC2s an will try to reproduce.

If modprobe 8821cu still cannot find the module, try depmod -a then modprobe 8821cu again and let me know if that fixes it.

Maybe the kernel is not automatically probing the module because your particular device is not in the list of supported cards in the kernel module source.

In this case you can easily fix this by adding a root_overlay with a modules-load.d file:

mkdir -p ./overrides/root_overlay/etc/modules-load.d/
echo "8821cu" > ./overrides/root_overlay/etc/modules-load.d/10-rtl8821cu.conf
make compile

as this is my first bug report to SkiffOS, I would like to say that it is an amazing project, thank you for making it possible!

Thanks!

I can confirm that now it is working. I pulled the latest master which now was at commit 02ae7a0 (copy 8821cu.conf to target), updated the buildroot submodule and compiled.

With this latest build, the module is loaded automatically and a wlan0 interface is waiting to be configured. Immediately after issuing nmcli --ask dev wifi connect myssid and entering the wifi password I had received an IP. I rebooted the board, without Ethernet cable connected, and I was able to connect to it from my desktop on its wireless connection.

So everything is working like it should, thank you very much for your help!

@danyer great to hear!