Skip to content

Compiling & signing ch343 with dkms #70

@roblinksdata

Description

@roblinksdata

I've got secureboot working on my machine and that introduced some problems when I tried to build and load the kernel module. My machine refused to load the module since it of course wasn't signed.

I figured out how to get it compiled and loaded using dkms. As a guid to others in a similar situation, I thought it'd be worthwhile to give a quick run-down of the key steps that I found necessary to get it working:

  • Install the relevant dkms and mokutil packages for your distro
  • Make sure to enroll the machine generated MOK key in firmware (this will require a reboot).
  • Ensure you have the relevant headers for your kernel installed (and a version of gcc that matches your kernel)
  • Clone this repository to /usr/src/chc343-2.0.
  • Add a file called dkms.conf into the directory with the below configuration.
  • sudo dkms add -m ch343 -v 2.0
  • sudo dkms build -m ch343 -v 2.0
  • sudo dkms install -m ch343 -v 2.0

All being well, you should now be able to load the module with sudo modprobe ch343.

dkms.conf

Make sure you replace CC=gcc-15 with the gcc executable that is compatible with that which built your kernel.

PACKAGE_NAME="ch343"
PACKAGE_VERSION="2.0"
MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build/driver CC=gcc-15"
CLEAN="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build/driver clean"
BUILT_MODULE_NAME[0]="ch343"
BUILT_MODULE_LOCATION=driver/
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="yes"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions