Use the new hid-sony and hid-playstation modules from the mainline in old Linux kernels!
This package blacklists the existing hid-sony and hid-playstation kernel modules from loading. Instead, the new kernel modules hid-sony-joy and hid-playstation-joy provided by this package will be used instead.
$ lsmod | grep joy
hid_sony_joy 40960 0
hid_playstation_joy 20480 0
ff_memless 20480 2 hid_playstation_joy,hid_sony_joy
joydev 32768 0- Update your Ubuntu to the latest version first, and reboot (with the latest Linux kernel)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot- Prepare the environment for kernel module compiling. Ensure your
/etc/apt/sources.listwhether the belowdeb-srcare enabled/uncommented or not. Replacefocalwith your distribution version of Ubuntu.
deb-src http://archive.ubuntu.com/ubuntu focal main
deb-src http://archive.ubuntu.com/ubuntu focal-updates main- Install the build dependencies of the linux kernel
sudo apt-get update
sudo apt-get build-dep linux linux-image-$(uname -r)::warning:: If you are using a kernel version below
5.9, you must use the deb package ending with-multicolor.5.9kernels or older has no support for the LED class multicolor. This flag includes the patches and kernels for that.
::warning:: If you are using a kernel version higher or equal to
5.9, you must NOT use the-multicolorpackage to avoid conflicts with the existingled-class-multicolormodule. You can check by doingmodinfo led-class-multicolor
-
Download latest release from here, or build it yourself using the instructions below.
-
Install required
playstation-joy-dkmsdependencies
sudo apt-get install build-essential dkms- Install the deb package
sudo apt-get install ./playstation-joy-dkms_20220314-1.deb
# or
sudo dpkg -i ./playstation-joy-dkms_20220314-1.deb
- This command will automatically compile the DKMS modules upon install. If the build failed, verify have you installed the kernel build dependencies correctly.
- Retry DKMS installation:
sudo dkms autoinstall - If
makekeeps failing, manually debug bycdto/usr/src/playstation-joy-dkms-VERSIONHEREand runmakehere manually.
- Retry DKMS installation:
- Reboot your computer to take effect
sudo rebootSo easy, just do this:
sudo apt-get remove --purge playstation-joy-dkms
- You will need
gitandmaketo build the files. Installingbuild-essentialin Ubuntu will do.
sudo apt-get update
sudo apt-get install git build-essential- Clone or download this repository
git clone git@github.com:m2robocon/playstation-joy-dkms.git- If you have modification to the files and want to update on existing machines, change the version parameter in the root
Makefile. The format isYYYYMMDD + revision number:
PACKAGE=playstation-joy-dkms
VERSION=20220314-1If you used the INCLUDE_LED_CLASS_MULTICOLOR=true flag, make sure to add -multicolor to the back of the version string to indicate it.
- Package it with
make
make clean # clean build folder
make prepare # fetch linux from upstream, reset to HEAD, patch files, prepare fakeroot
make deb # package into deb
# or simply:
# normal packaging without led-class-multicolor
make all
# package with led-class-multicolor
INCLUDE_LED_CLASS_MULTICOLOR=true make allpatches- Contains necessary patches for the modules to work properly and better. Will be patched on deb packaging.
src/linux- The official
kernel.orgLinux kernel submodule, currently checked out to tagv5.15
- The official
src/playstation-joy-dkms- Simply have symbolic links back to the Linux kernel submodules for editing convenience
Makefilefor dkms compilation on target machine
control-template- A template file of
DEBIAN/control, specifies the debian package metadata
- A template file of
pre-uninstall-template.sh- A template file of
DEBIAN/prerm, the pre-remove script
- A template file of
post-install-template.sh- A template file of
DEBIAN/postinst, the post-install script
- A template file of
dkms-template.conf- A template file of
dkms.conf, specifies the DKMS configurations
- A template file of
playstation-joy-dkms.conf- A
/etc/modprobe.dfile to blacklist existinghid-sonyandhid-playstationmodules.
- A
Makefile- Handles the deb packaging
Sources of hid-sony and hid-playstation are checked out to the master branch using the mainline drivers.
Multiple patches are applied to make it work with older kernels.
To use an another version of reference kernel. cd to the src/linux submodule and checkout the commit or tag you want:
cd src/linux
git fetch --all --tags
git checkout tags/v5.15Licensed under GPLv3.