MC7710 linux driver builder
I have an MC7710 running on an x230. Whenever apt upgrades the kernel, I have to rebuild the bloody driver manually, as there isn't a DKMS module for the Linux QMI USB Drivers for the Sierra AirPrime series.
This is the preliminary framework I wrote up to atleast automate the process of building and installing the modules. Future TODO is to do Full DKMS-ization of the build.
Before Anything Else
The Sierra sources require the kernel include file linux/memcontrol.h to be edited in
different ways depending on the kernel version the module is being built against. This
framework edits the code expecting that the kernel version being used is 5.0.0 or greater.
Starting from version S2.42N2.62, the Seirra source package now contains a dkms/ folder
(which is included here) somewhat inspired by this repo, but very limited in what it can do
(only builds against running kernel version, still requires manual kernel includes editing).
If you decide to use that instead, please read everything in the DKMS conf and Makefiles, and
examine dkms build logs carefully for any issues and errors.
Licensing
- All driver code is copyright of their respective owners under their licensing
- My code is licensed under a modified BSD license as detailed in the LICENSE file
Requirements
- Recent modern Bash
- Recent version of DKMS
- All the other requirements as listed on the driver package page on the Sierra Wireless website.
Last Few Tested Build Environments
-
Lenovo Thinkpad x230 running Xubuntu "18.04.4 LTS (Bionic Beaver)" with
dkmsversion2.3-3ubuntu9.7and running linux kernel version 5.3.0 (version5.3.0-59-generic) to build Sierra Linux QMI Drivers versionS2.42N2.62for packagelinux-image-5.3.0-61-generic(version5.3.0-61.55~18.04.1) on archamd64viaupdatesapt repo (apt upgrade). -
Lenovo Thinkpad x230 running Xubuntu "20.04.1 LTS (Focal Fossa)" with
dkmsversion2.8.1-5ubuntu1and linux kernel version 5.4.0 viaupdatesapt repo (packagelinux-image-5.4.0-52-genericversion5.4.0-52.57for archamd64) to build Sierra Linux QMI Drivers versionS2.42N2.63.
Build Instructions
-
(First time install only) Clone this repo into
/usr/src/SierraLinuxQMIdrivers:sudo git clone https://github.com/samveen/MC7710_driver_builder /usr/src/SierraLinuxQMIdrivers -
Create a link to the source dir with a version number(easier versioned driver updates):
sudo ln -s /usr/src/SierraLinuxQMIdrivers SierraLinuxQMIdrivers-S2.42N2.63 -
Register the module with DKMS:
sudo dkms add --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 -
Build and install the module:
sudo dkms build --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 sudo dkms install --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 -
Check status:
sudo dkms status --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 -
Get rid of the DKMS setup in case it's a pain:
sudo dkms uninstall --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 sudo dkms remove --verbose -m SierraLinuxQMIdrivers -v S2.42N2.63 --all sudo rm -fR /usr/src/SierraLinuxQMIdrivers\* -
Update older versions of modules(remixes install and cleanup instructions above):
# Remove old versions of drivers from all kernels sudo dkms remove SierraLinuxQMIdrivers/S2.42N2.62 --all # Update source cd /usr/src/SierraLinuxQMIdrivers && sudo git pull & cd .. # Move old driver version link to correct version number sudo mv SierraLinuxQMIdrivers-S2.42N2.62 SierraLinuxQMIdrivers-S2.42N2.63 # Alternative syntax for dkms commands sudo dkms add --verbose SierraLinuxQMIdrivers/S2.42N2.63 sudo dkms build SierraLinuxQMIdrivers/S2.42N2.63 sudo dkms install SierraLinuxQMIdrivers/S2.42N2.63 sudo dkms status --verbose SierraLinuxQMIdrivers/S2.42N2.63
TODO
- Add kernel module signing for secure boot (Needs some research in Machine owner keys, via mokutil maybe).
Notes
- The driver version in this repo is
S2.42N2.62(latest as of June 25, 2020). - List of versions of the Linux QMI USB drivers is available here.
- My Makefile improvements submitted to Sierra) are now included.
- I've had to submit a second patch to Sierra for a similar problem as previously.
- IMPORTANT The Sierra build installs the modules into
/lib/modules/${kversion}/kernel/drivers/net/usb, butdkmsignores the correspondingDEST_MODULE_LOCATIONin thedkms.conffor Ubuntu, as per design, putting the modules into/lib/modules/${kversion}/updates/dkmsinstead . More details at the Ubuntu dkms manpage