-
Notifications
You must be signed in to change notification settings - Fork 120
dkms.post_remove
blindly removes files
#521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, I discovered this problem lately while working on the DKMS stuff. I've setup some instructions here: I also added a note to the release notes in Github: I think the package manager should handle this problem. DKMS doesn't have a post remove hook which only runs after the last instance is removed. And we may have conflicting changes between versions anyways. So the package manager should take care of not allowing different versions to be installed at the same time - just different kernel instances of the same version. Suggestions are welcome. I think we should rename Installing different versions of xpadneo at the same time isn't really supported - and your package manager should complain loudly about it. Of course it can only do this if you use the new installation helpers. And we should probably remove the post and pre hooks in that case? I'm not very familiar with DKMS because I'm developing on a non-DKMS distribution. How do other projects handle this if they need to deploy udev rules? |
Just to be clear, my issue is purely about uninstalling an old kernel version. I'm still using the exact same xpadneo version across all installed kernels, precisely because DKMS is taking care of that. This is "different kernel instances of the same version": 14:52:38 0$ dkms status
hid-xpadneo/v0.9-214-g8d20a23, 6.12.10-athan, x86_64: installed
hid-xpadneo/v0.9-214-g8d20a23, 6.12.11-athan, x86_64: installed
nvidia/550.144.03, 6.12.10-athan, x86_64: installed
nvidia/550.144.03, 6.12.11-athan, x86_64: installed
v4l2loopback/0.13.2, 6.12.10-athan, x86_64: installed
v4l2loopback/0.13.2, 6.12.11-athan, x86_64: installed
virtualbox/7.1, 6.12.10-athan, amd64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
virtualbox/7.1, 6.12.10-athan, x86_64: installed
virtualbox/7.1, 6.12.11-athan, amd64: installed
virtualbox/7.1, 6.12.11-athan, x86_64: installed (Ignore the virtualbox gripes, it's not a "proper" dkms setup, just one I hacked together as the actual virtualbox method of installing kernel modules wasn't working 100% for me). If I now did I think the basic issue here is that the current setup is conflating "things an OS package would do" with "things DKMS does". The installation of the modprobe and udev files should be handled at the package level, not the DKMS level. In my case the issue arises because 1) I'm using xpadneo from source, but 2) the xpadneo DKMS configuration attempts to perform these package level operations without sufficient finesse to ensure those files remain in place whilst any instance of the kernel module exists. Obviously in the "installing from source" case there's no package management happening. On checking the Users are either:
I see this behaviour of |
Yes, during testing I removed the hooks from the DKMS config file. But this introduced some unwanted problems. I think we should reconsider that before tagging v0.10. I still think that, when installing from source, xpadneo should not try to be smart about keeping or not keeping the files. Rather, DKMS should do the right thing and provide separate hooks for the initial installation and final uninstallation. I don't want to replicate functionality which DKMS could easily provide for a whole community. We should consider the following:
This makes me think that xpadneo is properly behaving:
If this still triggers the wrong actions, it's either a bad kernel package script, DKMS is behaving wrong, or DKMS docs are wrong. I'd go even further and say that kernel package script should probably use A symmetric action would be to use But maybe I am understanding DKMS completely wrong. OTOH, I have a gut feeling of DKMS not implementing a proper separation of concerns since some time now. It also doesn't properly catch all errors and/or doesn't bubble them up to the caller. |
Version of xpadneo
v0.9-214-g8d20a23
Controller Model
Connection mode
Installed Software
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:
evtest
is showing issues (describe the issues below)BTN_NORTH
andBTN_WEST
are intentionally swappedjstest
is showing issues (describe the issues below)gamepad-tool
is showing issues (post console output below)Please describe how it is failing below in the next sections.
Severity / Impact
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: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 invokeddkms.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 usedkms status hid-xpadneo/<version>
, but I don't know if the version would easily be available to the script.Screenshots / GIFs / Videos
System Information
Controller and Bluetooth Information
Additional Context
The text was updated successfully, but these errors were encountered: