I’m trying to get the WiFi adapter module for the Dell Edge Gateway 3001 to work with Balena… I’m currently using the Intel NUC image, and it works great with the built-in ethernet adapter. Unfortunately for me, the WiFi adapter’s module is not included in the NUC build. It is, however, available in the Linux kernel code: https://github.com/torvalds/linux/tree/master/drivers/net/wireless/rsi
Instead of adding my own custom support in the kernel build script and having to maintain my own fork of the recipe, I was wondering if I could use the kernel-module-build container to somehow build and load the modules that exist in the kernel code.
I went ahead and tried to bring in the rsi/ directory from the 4.18.14 kernel into the kernel-module-build example. Everything builds cool, but unfortunately I’m getting this now:
22.06.19 16:55:09 (-0600) kernel-module-rsi OS Version is 2.36.0+rev2
22.06.19 16:55:09 (-0600) kernel-module-rsi insmod: ERROR: could not insert module rsi_intel-nuc_2.36.0+rev2.prod/rsi_91x.ko: Unknown symbol in module
22.06.19 16:55:09 (-0600) kernel-module-rsi insmod: ERROR: could not insert module rsi_intel-nuc_2.36.0+rev2.prod/rsi_sdio.ko: Unknown symbol in module
Woot! It works! Had to manually insmod the mac80211 module in the host container before doing the RSI ones. However, I’m not sure how to get this to happen automatically.
FYI for anyone searching for info on the Dell Edge Gateway… I’ve decided to give up. I want to use the GPIO and it’s going to take a lot of effort to get the ad5593r module running. This device would be so great on Balena, but shoo… without a better way to bring in kernel modules, I’m out of time for it.
Usually this project is used for user written modules. Depending on the complexity of the user written modules it could still happen that some kernel dependencies are not met.
Well, for my uses, I was just looking at the GPIO (ad5592rad5593r) which is in the Industrial I/O section of the kernel: https://github.com/torvalds/linux/tree/master/drivers/iio/dac. You can see the list of modules that the pre-installed Ubuntu Core 16 has (it’s not entirely clear to me that it needs ALL of these though):
@shaunmulligan this basically boils down on having the ad5592r module enabled in the kernel. What’s your thoughts on enabling this in the genericx86-64 image?
I found the Makefile in some random corner of the web… it does show that I can redistribute it as long as I keep the copyright info, so I feel OK about sharing it. I can’t remember where I found it though.
If you’re interested in what the whole thing looked like, here’s what I believe is the final working code. I was not able to use Balena in the end of this project because of the kernel needing GPIO, (which has been included now!). I was only working on this for a short term contract project between jobs.
Taking the kernel-module-build example, add these directories: rsi/, mac80211/, firmware/.
Copy the contents of the RSI kernel source into rsi/, replacing the Makefile with this one Makefile.log (4.4 KB) (renamed with a .log to get around the forum file filter).
Copy the compiled mac80211.ko file from the existing kernel into a directory inside the container so that I could initialize it from this run script. There is probably a better way.
Copy the RPS files to firmware/.
Use the following Docker template and run script.
Dockerfile.template:
FROM balenalib/%%RESIN_MACHINE_NAME%%-debian
RUN apt-get update && apt-get install -y curl wget build-essential libelf-dev awscli bc flex libssl-dev python bison
COPY . /usr/src/app
WORKDIR /usr/src/app
ENV VERSION '2.36.0+rev2.prod'
RUN ./build.sh %%RESIN_MACHINE_NAME%% $VERSION rsi
CMD ./run.sh
run.sh:
#!/bin/bash
OS_VERSION=$(echo $RESIN_HOST_OS_VERSION | cut -d " " -f 2)
echo "OS Version is $OS_VERSION"
mkdir -p /lib/firmware/rsi
cp firmware/* /lib/firmware/rsi/
insmod mac80211/mac80211.ko
mod_dir="rsi_${RESIN_DEVICE_TYPE}_${OS_VERSION}*"
insmod $mod_dir/rsi_91x.ko
insmod $mod_dir/rsi_sdio.ko
lsmod | grep rsi
while true; do
sleep 60
done