xmm7360 / xmm7360-pci

PCI driver for Fibocom L850-GL modem based on Intel XMM7360 modem
403 stars 81 forks source link

Added DKMS support and documentation #195

Closed so-rose closed 11 months ago

so-rose commented 1 year ago

I'm using DKMS to manage this module, in part because it makes it easy to manage signing the kernel module to appease Secure Boot. It makes my life a lot simpler, so I thought I'd contribute it back. Hope it can be useful!

This PR adds:

When the source repo is copied to /usr/src, the user-created dkms.conf is automatically picked up on by DKMS when performing dkms install. From there, everything works smoothly.

Why no dkms.conf?

DKMS versioning is important - otherwise DKMS will never think there's been an update, even if there has been.

The only way I could think of to version xmm7360-pci was by commit-id, as there are no releases. Unfortunately, dkms.conf can't automatically grab the commit-id of HEAD.

We can't update dkms.conf every time there's a commit. So, we have to insist that the user runs a one-liner sed script (documented in INSTALLING.md), one avoids introducing the chore of manually updating a version string every time there's a change.

There's probably a better way, but this is simple and it works. Also, if someone happens to copy dkms.tmpl.conf directly into dkms.conf, it'll still work - the version will just be COMMIT_ID_VERSION.

How-To (also in INSTALLING.md)

The following instructions are copy/pasted from INSTALLING.md. I've tested them on my own machine.

# Feed Commit ID as Package Version to dkms.conf
COMMIT_ID=$(git rev-parse HEAD)
sed "s/COMMIT_ID_VERSION/$COMMIT_ID/g" dkms.tmpl.conf > dkms.conf

# Install in /usr/src
sudo cp -r ./ /usr/src/xmm7360-pci-$COMMIT_ID/

# Install with DKMS
sudo dkms install xmm7360-pci/$COMMIT_ID
sudo modprobe xmm7360

After this, the user simply runs sudo ./scripts/lte.sh up as usual.

tgxn commented 11 months ago

LGTM