Skip to content

Testing and Installing

Maximilian Luz edited this page Dec 18, 2020 · 5 revisions

Note: You normally do not need to manually install these modules if you are already using a kernel from https://github.com/linux-surface/linux-surface.

To test these modules, you need a custom kernel with the patches found in this repository applied. These patches are in the mainline kernel since v5.6. For a full set of patches, see this repository. Furthermore, you need to ensure that the following config values are set:

CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y

If you're using a mainline v5.6 kernel from one of the common distros (Ubuntu, Debian, Arch, ..., basically anything that's intended for desktop use), this should all be set. If you have all the prequisites, you can

Build/Test the modules

You can build the modules by running make inside the module/ directory. After that, you can load the modules by running make insmod and remove them by running make rmmod.

If you have the linux-surface kernel installed, you will need to unload the built-in SAM modules first. Similar to loading the externally built modules, you can do this by running make modprobe-unload. You can load the in-kernel modules again after testing via make modprobe-load.

As an alternative to the make targets, you can also run the ssam-modprobe script directly, with no parameters to load the in-kernel modules, the -r parameter to unload the in-kernel modules, the insmod parameter to load the externally built modules from the current directory (i.e. your current directory needs to be module/src/), and rmmod to unload the externally built modules.

Permanently install the modules

If you want to permanently install the modules (or ensure it is loaded during boot), you can run make dkms-install. To uninstall it, run make dkms-uninstall. In case you've installed a patched kernel already contiaining the in-kernel version of this module, dkms should detect this and override the in-kernel modules with the externally built ones. This should get reverted by uninstalling the modules via the command above.