ZRtmWrJqXcjbqBLIMBYMCeUw / Logitech-G923-Linux-Kernel-Driver

This project is intended to add support for the Logitech G923 steering wheel to the Linux kernel.
GNU General Public License v3.0
32 stars 0 forks source link

G923 patches - how use them? #4

Closed kdw2060 closed 2 years ago

kdw2060 commented 2 years ago

Hi, from reading the readme it seems as if the G923 patches can be manually installed somehow. Could you please point me into the right direction on how to do that? Do I need to modify kernel system files somewhere? Or, do patches like that get automatically included in rolling release distros like Manjaro? Would consider changing distro if my wheel would work there.

Or am I mistaken and is it necessary to wait till these patches make it to a future linux kernel?

ydallilar commented 2 years ago

You can use the PKGBUILD below. You can follow up this:

https://github.com/berarma/new-lg4ff/pull/50

_pkgname='new-lg4ff'
pkgname='new-lg4ff-dkms-git'
pkgver=0.3.1.r19.gfaeb74f
pkgrel=1
pkgdesc="Experimental Logitech force feedback module (DKMS)"
arch=('i686' 'x86_64')
url="https://github.com/berarma/new-lg4ff"
license=('GPL2')
install="${pkgname}.install"
depends=('dkms')
makedepends=('git')
conflicts=("${_pkgname}-dkms")
source=(
    "git+https://github.com/JacKeTUs/new-lg4ff#branch=g923"
    "${pkgname}.install"
)
md5sums=(
    'SKIP'
    '6c5008edd485130b1a4752030bbaaa2d'
)

pkgver() {
    cd "$srcdir/${_pkgname}"
    git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
    cd "$srcdir/${_pkgname}"
    sed -e "s/0.1/${pkgver}/" -i "dkms.conf"
}

package() {
    cd "$srcdir/${_pkgname}"
    install -dm 755 "${pkgdir}/usr/src/${_pkgname}-${pkgver}"
    install -dm 755 "${pkgdir}/usr/src/${_pkgname}-${pkgver}/usbhid"
    install -m 644 usbhid/usbhid.h "${pkgdir}/usr/src/${_pkgname}-${pkgver}/usbhid/"
    install -m 644 hid-ids.h hid-lg.h hid-lg4ff.h "${pkgdir}/usr/src/${_pkgname}-${pkgver}/"
    install -m 644 hid-lg.c hid-lg2ff.c hid-lg3ff.c hid-lg4ff.c hid-lgff.c "${pkgdir}/usr/src/${_pkgname}-${pkgver}/"
    install -m 644 Kbuild Makefile dkms.conf "${pkgdir}/usr/src/${_pkgname}-${pkgver}/"
}
kdw2060 commented 2 years ago

I understood that alternate lg4ff firmware only works with the PS version of the wheel (I have the xbox version), no?

ydallilar commented 2 years ago

Yes, the work is only for PS version. Sorry.

There may be some folks which have already instructions for other distros. I don't know. But, the patches are not part of the kernel as far as I can see so changing distros won't help in that regard. Patches won't get included automatically in any distro.

For arch, packing a kernel is somewhat straightforward and I would assume similar for Manjaro. What you need to is to apply the patches and repackage your own custom kernel. The instructions are (for archlinux, I am not very familiar with manjaro docs but the concepts should be similar):

https://wiki.archlinux.org/title/Patching_packages#Applying_patches https://wiki.archlinux.org/title/Kernel/Arch_Build_System

The second link suggests starting with official linux PKGBUILD for arch linux. You can instead grab the one from Manjaro of your favorite kernel.

s3rg3 commented 2 years ago

i have just sent an email to the HID kernel modules manager, for letting him know that there is demand for the xbox version.

i let you know what is going on as soon i have an answer.

ZRtmWrJqXcjbqBLIMBYMCeUw commented 2 years ago

Hi, from reading the readme it seems as if the G923 patches can be manually installed somehow. Could you please point me into the right direction on how to do that? Do I need to modify kernel system files somewhere? Or, do patches like that get automatically included in rolling release distros like Manjaro? Would consider changing distro if my wheel would work there.

Or am I mistaken and is it necessary to wait till these patches make it to a future linux kernel?

The changes are usually added to the upstream but were not in this case. I am not sure of the intricacies of deciding which patches make into the mainline kernel but this patch in particular had some compilation errors: https://patchwork.kernel.org/project/linux-input/patch/20210527134104.217865-3-rickytaylor26@gmail.com/.

To add to @ydallilar's explanation, I would suggest finding whichever fork version of the Linux kernel your particular distribution is using. I use Manjaro and was able to compile a patched kernel with the following instructions: https://forum.manjaro.org/t/howto-build-a-patched-kernel-module/48757

With respect to the compilation error on these particular patches, I briefly described here how to fix the error and get the kernel to compile properly: https://github.com/ZRtmWrJqXcjbqBLIMBYMCeUw/Logitech-G923-Linux-Kernel-Driver#g923-xbox-version. Please do let us know if/how well these patches work as I only have the PS version of the wheel (which uses the third party berarma/lg4ff driver).

s3rg3 commented 2 years ago

i made a new issue with the current state of the xbox version here

kdw2060 commented 2 years ago

Thank you all for the useful information. Considering the difficulty level and my Dirt games still not working after the patching, I'll resort to dual-booting Windows for now.