Hi everybody
I have been using LibreElec for quite some time and the vanilla install has always been perfect for me. But I am building a new box for my daughter and with the box connected using ethernet everything is wonderful. However, she has an cheap USB Wifi adapter (RTL88x2BU) which is not supported. Being rather scrooge-like rather than buy her a new USB Adadpter I thought I would have a go at building the module myself.
First off on one of my servers (Ubuntu 20.04 LTS) to get some proof that this approach was going to work I cloned GitHub - cilynx/rtl88x2bu: rtl88x2bu driver updated for current kernels.
Then I used dkms to add, build and install the module and finally ran a modprobe rtl88x2bu. Plugged in the USB Adapter and hey-presto I have a working Wireless Adapter on my server
This small success set me off an a number of abortive attempts to build LibreElec locally but after a few attempts I now have an Ubuntu 18.04 LTS VirtualBox that will cleanly build Libreleec 9.2 Generic x86_64 and I have tested this by installing on my daughters machine and all is fine and dandy with the Ethernet connection.
Small steps being the watch word I then followed one of the thread on this forum to try to build an rtl88x2bu module. Under ~/http://LibreELEC.tv/packages/ I created a folder RTL88x2BU and in that folder created a package.mk containing the following
PKG_NAME="RTL88x2BU"
PKG_VERSION="439c7dbd9e43acd91d5704a50b68647716c52505"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/cilynx/rtl88x2bu"
PKG_URL="https://github.com/cilynx/rtl88x2bu/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="Realtek RTL88x2BU Linux driver"
PKG_IS_KERNEL_PKG="yes"
pre_make_target() {
unset LDFLAGS
}
make_target() {
make V=1 \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}
Display More
I edited distributions/LibreELEC/options and added the new driver
ADDITIONAL_DRIVERS="RTL8192CU RTL8192DU RTL8192EU RTL8188EU RTL8812AU RTL88x2BU"
I then rebuilt the LibreElec using "PROJECT=Generic ARCH=x86_64 make image" which threw no errors and when it had completed I had a number of files under ~/http://LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.2-devel/RTL88x2BU-439c7dbd9e43acd91d5704a50b68647716c52505 including a 88x2bu.ko
-rw-rw-r-- 1 paul paul 4471088 Jul 26 10:23 88x2bu.ko
-rw-rw-r-- 1 paul paul 1434 Jul 26 10:23 88x2bu.mod.c
-rw-rw-r-- 1 paul paul 3920 Jul 26 10:23 88x2bu.mod.o
-rw-rw-r-- 1 paul paul 4476592 Jul 26 10:23 88x2bu.o
-rw-rw-r-- 1 paul paul 268 Nov 14 2020 build.sh
-rw-rw-r-- 1 paul paul 64 Nov 14 2020 clean
drwxrwxr-x 4 paul paul 4096 Jul 26 10:23 core
-rw-rw-r-- 1 paul paul 237 Nov 14 2020 dkms.conf
drwxrwxr-x 9 paul paul 4096 Jul 26 10:23 hal
-rw-rw-r-- 1 paul paul 1902 Nov 14 2020 halmac.mk
-rw-rw-r-- 1 paul paul 54 Nov 14 2020 ifcfg-wlan0
drwxrwxr-x 5 paul paul 12288 Nov 14 2020 include
-rw-rw-r-- 1 paul paul 130 Nov 14 2020 Kconfig
-rw-rw-r-- 1 paul paul 18092 Nov 14 2020 LICENSE
-rwxrwxr-x 1 paul paul 70373 Nov 14 2020 Makefile
-rw-rw-r-- 1 paul paul 133 Jul 26 10:23 modules.order
-rw-rw-r-- 1 paul paul 0 Jul 26 10:23 Module.symvers
drwxrwxr-x 3 paul paul 4096 Jul 26 10:23 os_dep
drwxrwxr-x 2 paul paul 4096 Jul 26 10:23 platform
-rw-rw-r-- 1 paul paul 5445 Nov 14 2020 README.md
-rw-rw-r-- 1 paul paul 1920 Nov 14 2020 rtl8822b.mk
-rw-rw-r-- 1 paul paul 423 Nov 14 2020 runwpa
-rw-rw-r-- 1 paul paul 294 Nov 14 2020 wlan0dhcp
Display More
I then burned the new img file to USB and installed LibreElec as normal
Sadly, plugging in the USB Adapter had no effect and no Wifi connections are showing
As far as I can see there are no new modules under /lib/modules/5.1.16 (there are five RTL folders but they were there previously)
I have obviously missed or mucked up something but for the life of me cannot see what
Any assistance would be most appreciated
Regards
Paul