Skip to content
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

Automatic update script, and 6.12 fixes #184

Merged
merged 14 commits into from
Nov 28, 2024

Conversation

LarryTheMagicDragon
Copy link
Contributor

I've made it create a script for the service. It stores the kernel version the module was compiled for in this script, on boot if they don't match it will recompile the module, and update the kernel version stored in the script.

@LarryTheMagicDragon
Copy link
Contributor Author

I forgot to mention I'm pretty sure this covers #113 and #137

@mmsaeed509
Copy link
Collaborator

it's gives an error

Traceback (most recent call last):
  File "/home/o0xwolf/.config/bspwm/bin/facer_rgb.py", line 203, in <module>
    with open(CHARACTER_DEVICE, 'wb') as cd:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/acer-gkbbl-0'

@LarryTheMagicDragon
Copy link
Contributor Author

I don't have a "/home/o0xwolf/.config/bspwm/bin/facer_rgb.py" file. The only files affected by this that should be in /opt/turbofan. Can you tell me more about where you got this error from, and what you did to get it?

@mmsaeed509
Copy link
Collaborator

/home/o0xwolf/.config/bspwm/bin/facer_rgb.py is the same script /opt/turbo-fan/facer_rgb.py

/opt/turbo-fan/facer_rgb.py gives the same error

/opt/turbo-fan/facer_rgb.py
Traceback (most recent call last):
  File "/opt/turbo-fan/facer_rgb.py", line 205, in <module>
    with open(CHARACTER_DEVICE, 'wb') as cd:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/acer-gkbbl-0'

@LarryTheMagicDragon
Copy link
Contributor Author

I believe this is a problem in upstream, I installed the base version, restarted my computer, and then ran install_service.sh again after restarting my computer, and got the same problem. I will attempt to fix my branch so that it can be installed repeatedly without restarting, but as far as I can tell this problem exists independent of the changes that I have made.

@LarryTheMagicDragon
Copy link
Contributor Author

I believe I have fixed the issue. As far as I can tell it is caused by calling insmod on the facer module while having a version of the facer module loaded. the install script, and service script remove /dev/acer-gkbbl-0 and /dev/acer-gkbbl-static-0, if the module cannot be reloaded it will fail to recreate them. on my system the problem seems to be fixed, I am now waiting for feedback from others

@LarryTheMagicDragon LarryTheMagicDragon changed the title Added a poor mans version of DKMS Automatic update script, and 6.12 fixes Nov 24, 2024
@Ki-wimon
Copy link

Ki-wimon commented Nov 25, 2024

On PH315-54; kernel version 6.12.1-arch1-1 (64-bit), both install.sh and install_service.sh runs but not works (the turbo mode is not on when the turbo button pressed).
Here's the log of install.sh:

make -C /lib/modules/6.12.1-arch1-1/build M=/home/user/acer-predator-turbo-and-rgb-keyboard-linux-module modules
make[1]: Entering directory '/usr/lib/modules/6.12.1-arch1-1/build'
  CC [M]  /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.o
/home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.c: In function ‘acer_wmi_notify’:
/home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.c:2961:21: warning: unused variable ‘status’ [-Wunused-variable]
 2961 |         acpi_status status;
      |                     ^~~~~~
/home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.c: At top level:
/home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.c:1977:20: warning: ‘WMID_gaming_get_u64’ defined but not used [-Wunused-function]
 1977 | static acpi_status WMID_gaming_get_u64(u64 *value, u32 cap)
      |                    ^~~~~~~~~~~~~~~~~~~
  MODPOST /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/Module.symvers
  CC [M]  /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.mod.o
  CC [M]  /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/.module-common.o
  LD [M]  /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.ko
  BTF [M] /home/user/acer-predator-turbo-and-rgb-keyboard-linux-module/src/facer.ko
make[1]: Leaving directory '/usr/lib/modules/6.12.1-arch1-1/build'
if [ -f "/var/lib/shim-signed/mok/MOK.priv" ] && [ -f "/var/lib/shim-signed/mok/MOK.der" ]; then \
        sudo kmodsign sha512 /var/lib/shim-signed/mok/MOK.priv /var/lib/shim-signed/mok/MOK.der src/facer.ko; \
fi
rmmod: ERROR: Module facer is not currently loaded
[ 1009.851440] systemd-ssh-generator[6519]: Binding SSH to AF_UNIX socket /run/ssh-unix-local/socket.
[ 1009.851442] systemd-ssh-generator[6519]: → connect via 'ssh .host' locally
[ 1122.845661] facer: Acer Laptop WMI Extras unloaded
[ 1122.901033] acer_wmi: Acer Laptop ACPI-WMI Extras
[ 1122.901064] acer_wmi: Function bitmap for Communication Button: 0x801
[ 1122.907464] input: Acer WMI hotkeys as /devices/virtual/input/input30
[ 1208.921714] acer_wmi: Acer Laptop WMI Extras unloaded
[ 1208.972087] facer: Acer Laptop ACPI-WMI Extras
[ 1208.972115] facer: Function bitmap for Communication Button: 0x801
[ 1208.981893] input: Acer WMI hotkeys as /devices/virtual/input/input31
[*] Done

the log of systemctl status turbo-fan.service looks like:

● turbo-fan.service - Enables turbo button
     Loaded: loaded (/etc/systemd/system/turbo-fan.service; enabled; preset: disabled)
     Active: active (exited) since Mon 2024-11-25 18:23:45 CST; 13s ago
 Invocation: d792e77f854d401e9ec534242cadc6b7
    Process: 8602 ExecStart=/bin/bash /opt/turbo-fan/service.sh (code=exited, status=0/SUCCESS)
   Main PID: 8602 (code=exited, status=0/SUCCESS)
   Mem peak: 113.3M
        CPU: 1.477s

Nov 25 18:23:47 archlinux bash[9036]: [ 1536.405497] nvidia 0000:01:00.0: [drm] fb1: nvidia-drmdrmfb frame buffer device
Nov 25 18:23:47 archlinux bash[9036]: [ 1559.717160] systemd-ssh-generator[8595]: Binding SSH to AF_UNIX socket /run/ssh-unix-local/socket.
Nov 25 18:23:47 archlinux bash[9036]: [ 1559.717162] systemd-ssh-generator[8595]: → connect via 'ssh .host' locally
Nov 25 18:23:47 archlinux bash[9036]: [ 1560.012201] systemd-ssh-generator[8766]: Binding SSH to AF_UNIX socket /run/ssh-unix-local/socket.
Nov 25 18:23:47 archlinux bash[9036]: [ 1560.012203] systemd-ssh-generator[8766]: → connect via 'ssh .host' locally
Nov 25 18:23:47 archlinux bash[9036]: [ 1561.447204] facer: Acer Laptop WMI Extras unloaded
Nov 25 18:23:47 archlinux bash[9036]: [ 1561.515687] facer: Acer Laptop ACPI-WMI Extras
Nov 25 18:23:47 archlinux bash[9036]: [ 1561.515726] facer: Function bitmap for Communication Button: 0x801
Nov 25 18:23:47 archlinux bash[9036]: [ 1561.525624] input: Acer WMI hotkeys as /devices/virtual/input/input32
Nov 25 18:23:47 archlinux bash[8602]: [*] Done

@LarryTheMagicDragon
Copy link
Contributor Author

@Ki-wimon Does the RGB still work? does "lsmod | grep facer" show any output?

@Ki-wimon
Copy link

I'm sorry that I downgrade my linux kernel to 6.11.9 in the end. I didn't test that.

@LarryTheMagicDragon
Copy link
Contributor Author

@Ki-wimon Thank you for your input. I'll see what I can do to resolve the issue

@LarryTheMagicDragon
Copy link
Contributor Author

@Ki-wimon I have made some modifications and I'd like to know if this fixes turbo for you. If you run 'journalctl -f | grep facer' in a separate terminal and then install it, it will give a much clearer view of what is happening on your system.

@OVA-Charmao
Copy link

OVA-Charmao commented Nov 26, 2024

@Ki-wimon I have made some modifications and I'd like to know if this fixes turbo for you. If you run 'journalctl -f | grep facer' in a separate terminal and then install it, it will give a much clearer view of what is happening on your system.

I know I wasn't asked this but I'm having issues as well so hopefully this will help.

[luther@TheBillyRig ~]$ journalctl -f | grep facer
Nov 26 16:33:23 TheBillyRig bash[7277]:   CC [M]  /opt/turbo-fan/src/facer.o
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c: In function ‘acer_wmi_notify’:
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c:2966:18: error: implicit declaration of function ‘wmi_get_event_data’ [-Wimplicit-function-declaration]
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c: In function ‘acer_wmi_input_setup’:
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c:3219:49: error: passing argument 2 of ‘wmi_install_notify_handler’ from incompatible pointer type [-Wincompatible-pointer-types]
Nov 26 16:33:23 TheBillyRig bash[7279]:                  from /opt/turbo-fan/src/facer.c:22:
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c: At top level:
Nov 26 16:33:23 TheBillyRig bash[7279]: /opt/turbo-fan/src/facer.c:1977:20: warning: ‘WMID_gaming_get_u64’ defined but not used [-Wunused-function]
Nov 26 16:33:23 TheBillyRig bash[7274]: make[3]: *** [scripts/Makefile.build:229: /opt/turbo-fan/src/facer.o] Error 1
Nov 26 16:33:23 TheBillyRig bash[7284]: insmod: ERROR: could not load module src/facer.ko: No such file or directory

Using "lsmod | grep facer" returns nothing for me.. Hope this helps!

@LarryTheMagicDragon
Copy link
Contributor Author

@OVA-Charmao I've looked at your log message and it looks like you're trying to install the base version. I tried both my pr, and the base version as a sanity check, and I only have those errors on the base version. You should try this branch by running 'git clone https://github.com/LarryTheMagicDragon/acer-predator-turbo-and-rgb-keyboard-linux-module.git' and the attempting to install as you normally would

@OVA-Charmao
Copy link

I managed to get it to actually work. I thought I was doing the proper git on your fork of the main branch but the README.md file on that git doesn't show the LarryTheMagicDragon git. It still showed the JafarAkhondali one. That was my fault as I wasn't paying attention. Thank you!

@LarryTheMagicDragon
Copy link
Contributor Author

@OVA-Charmao Thanks for letting me know, it really helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants