Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DKMS support and documentation #195

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Conversation

so-rose
Copy link
Contributor

@so-rose so-rose commented Oct 23, 2022

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:

  • General docs for signing this module for use with Secure Boot systems in INSTALLING.md, both with and without DKMS.
  • Documentation on using DKMS to install and sign this module.
  • A dkms.tmpl.conf file, which requires the user to replace COMMIT_ID_VERSION (with a sed script provided in INSTALLING.md) and write the result to dkms.conf.

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
Copy link
Contributor

tgxn commented Jul 17, 2023

LGTM

@tgxn tgxn merged commit 8496396 into xmm7360:master Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants