I'm trying to get Linux working with my Lenovo Yoga 530-14ARR laptop. It has a wireless Realtek "rtl8821ce" card, which is not recognized out of the box by my brand new Lubuntu 18.10 install (I tried other lightweight distros before, without success). According to this question's top answer, compiling this and modprobe
the resulting module should do the trick.
Unfortunately, I can't get it to compile on my machine:
liloboot@lubuntu:~/rtl8821ce$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.18.0-10-generic/build M=/home/liloboot/rtl8821ce modules
make[1]: Entering directory '/usr/src/linux-headers-4.18.0-10-generic'
Makefile:982: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
CC [M] /home/liloboot/rtl8821ce/os_dep/linux/os_intfs.o
/home/liloboot/rtl8821ce/os_dep/linux/os_intfs.c:1325:22: error: initialization of ‘u16 (*)(struct net_device *, struct sk_buff *, void *, u16 (*)(struct net_device *, struct sk_buff *))’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, void *, short unsigned int (*)(struct net_device *, struct sk_buff *))’} from incompatible pointer type ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *, u16 (*)(struct net_device *, struct sk_buff *))’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *, short unsigned int (*)(struct net_device *, struct sk_buff *))’} [-Werror=incompatible-pointer-types]
.ndo_select_queue = rtw_select_queue,
^~~~~~~~~~~~~~~~
/home/liloboot/rtl8821ce/os_dep/linux/os_intfs.c:1325:22: note: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:327: /home/liloboot/rtl8821ce/os_dep/linux/os_intfs.o] Error 1
make[1]: *** [Makefile:1546: _module_/home/liloboot/rtl8821ce] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.18.0-10-generic'
make: *** [Makefile:1902: modules] Error 2
EDIT: Following chili555's comment, I tried this. It finally worked but I had several problems that I want to point out in an answer. See below.