Skip to content

dkms.post_remove blindly removes files #521

Description

@Athanasius

Version of xpadneo

v0.9-214-g8d20a23

Controller Model

  • Xbox One S controller
  • Xbox Elite 2 controller
  • Xbox Series X|S controller
  • Other:

Connection mode

  • Bluetooth connection
  • USB cable (not yet supported)
  • Xbox Dongle connection (not yet supported)

Installed Software

  • Anti-Micro (may affect button mappings)
  • OpenRGB (may mess up mappings and rumble stability)
  • Steam Input (enabled by default via Steam Desktop client)
  • Steam Link (usually via Raspberry Pi or other micro computers)
  • devices with QMK firmware (may affect udev rules, similar to OpenRGB)
  • netstick (shares input devices via network similar to Steam Link)
  • xboxdrv (user-space gamepad driver)
  • xone (kernel-space gamepad driver using the Xbox dongle or USB)
  • xow (alternative driver using the Xbox dongle)

Protocol Information

Please help us identify at which layer the problem can be found if you want
to report mapping errors or if the controller fails to be detected:

  • Steam Proton games are having issues
  • Steam Linux-native games are having issues
    • I don't use Steam or did not try
  • games running through Lutris, wine and/or Bottles are having issues
    • I don't use Lutris, Bottles, wine or did not try
  • Linux-native games are having issues
    • I don't use native games or did not try
  • Other software is having issues (describe software and issues below)
  • Running evtest is showing issues (describe the issues below)
    • Keep in mind that BTN_NORTH and BTN_WEST are intentionally swapped
  • Running jstest is showing issues (describe the issues below)
    • I don't have this tool or don't know how to use it
  • Running gamepad-tool is showing issues (post console output below)
    • I don't have this tool

Please describe how it is failing below in the next sections.

Severity / Impact

  • I've read the docs and the bug reporting instructions
  • I've applied the latest firmware update to the controller
  • I've tried disabling or running without above mentioned software
  • It does not work at all
  • It used to work in a previous version
  • It mostly works but sometimes it doesn't
  • I found a work-around
  • I probably didn't figure it all out but it's too early to give up
  • I don't know how to ...
  • It's too complicated
  • Fantastic work but ...
  • I can code and I want to help

Describe the Bug

dkms.post_remove is blindly removing files without checking if there's still a kernel installed that needs to make use of them. Specifically:

/etc/modprobe.d/xpadneo.conf
/etc/udev/rules.d/70-xpadneo-disable-hidraw.rules
/etc/udev/rules.d/60-xpadneo.rules

Steps to Reproduce

I use a script that first installs a new locally compiled kernel (using dpkg -i ...), and only if that succeeds do I then remove the version prior to the one currently running. i.e. I had 6.12.9 and 6.12.10 installed, am booted into 6.12.10 and have just installed 6.12.11. First 6.12.11 was installed, then 6.12.9 was removed. The latter operation invoked dkms.post_remove and removed the affected files.

Obviously if I first removed old-old version and then installed new version this would be moot, as the latter action would invoke dkms.post_install, but I have reason to do it in this order.

I only caught this because I keep /etc under git.

Expected Behavior

Some check to see if at least one DKMS applicable kernel is still installed, and if so do not remove the files.

In this instance I've worked around this by running the dkms.post_install manually to restore the files.

Perhaps the output of dkms status could be utilised for this purpose. It would be quicker to use dkms status hid-xpadneo/<version>, but I don't know if the version would easily be available to the script.

Screenshots / GIFs / Videos

System Information

# uname -a
Linux emilia 6.12.10-athan #1 SMP PREEMPT_DYNAMIC Fri Jan 17 14:25:31 GMT 2025 x86_64 GNU/Linux
# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
<presumed irrelevant>

Controller and Bluetooth Information

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions