Plippo / asus-wmi-screenpad

Variation of the asus-wmi kernel module with screenpad brightness support
Other
159 stars 20 forks source link

Error building for Kernel 6.2.2-arch1-1 #48

Closed Kwanky-Millet closed 1 year ago

Kwanky-Millet commented 1 year ago

The module build returns bad exit status: 2

Make Log FIle

DKMS make.log for asus-wmi-1.0 for kernel 6.2.2-arch1-1 (x86_64)
Saturday 04 March 2023 08:23:15 PM IST
  CC [M]  /var/lib/dkms/asus-wmi/1.0/build/asus-wmi.o
  CC [M]  /var/lib/dkms/asus-wmi/1.0/build/asus-nb-wmi.o
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:925:24: error: initialization of ‘int (*)(struct power_supply *, struct acpi_battery_hook *)’ from incompatible pointer type ‘int (*)(struct power_supply *)’ [-Werror=incompatible-pointer-types]
  925 |         .add_battery = asus_wmi_battery_add,
      |                        ^~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:925:24: note: (near initialization for ‘battery_hook.add_battery’)
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:926:27: error: initialization of ‘int (*)(struct power_supply *, struct acpi_battery_hook *)’ from incompatible pointer type ‘int (*)(struct power_supply *)’ [-Werror=incompatible-pointer-types]
  926 |         .remove_battery = asus_wmi_battery_remove,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:926:27: note: (near initialization for ‘battery_hook.remove_battery’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:252: /var/lib/dkms/asus-wmi/1.0/build/asus-wmi.o] Error 1
make: *** [Makefile:2021: /var/lib/dkms/asus-wmi/1.0/build] Error 2
GeraldWodni commented 1 year ago

Can confirm, here is my log:

DKMS make.log for asus-wmi-1.0 for kernel 6.2.2-arch1-1 (x86_64)
Thu  9 Mar 17:35:54 CET 2023
  CC [M]  /var/lib/dkms/asus-wmi/1.0/build/asus-wmi.o
  CC [M]  /var/lib/dkms/asus-wmi/1.0/build/asus-nb-wmi.o
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:932:24: error: initialization of ‘int (*)(struct power_supply *, struct acpi_battery_hook *)’ from incompatible pointer type ‘int (*)(struct power_supply *)’ [-Werror=incompatible-pointer-types]
  932 |         .add_battery = asus_wmi_battery_add,
      |                        ^~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:932:24: note: (near initialization for ‘battery_hook.add_battery’)
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:933:27: error: initialization of ‘int (*)(struct power_supply *, struct acpi_battery_hook *)’ from incompatible pointer type ‘int (*)(struct power_supply *)’ [-Werror=incompatible-pointer-types]
  933 |         .remove_battery = asus_wmi_battery_remove,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/asus-wmi/1.0/build/asus-wmi.c:933:27: note: (near initialization for ‘battery_hook.remove_battery’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:252: /var/lib/dkms/asus-wmi/1.0/build/asus-wmi.o] Error 1
make: *** [Makefile:2021: /var/lib/dkms/asus-wmi/1.0/build] Error 2
Kwanky-Millet commented 1 year ago

Hey, did anyone figure out any fixes/workarounds yet?

GeraldWodni commented 1 year ago

It seems the linux ABI has changed in version 6.2

There must be a lot of affected modules out there. I found one that had the same error and was fixed

The patch shows, that it might not be hard to fix.

I might try and have a go at it, or do you @Kwanky-Millet want to give it a shot?

Plippo commented 1 year ago

What surprises me is that prepare_for_current_kernel.sh downloads the current version of the module sources that fits your kernel and patches it. As the affected code that produces this error is not part of the patch, it should match the kernel version and there should be no problem. Did you run prepare_for_current_kernel.sh? Has there been any error in the output of that script?

Kwanky-Millet commented 1 year ago

It seems the linux ABI has changed in version 6.2

There must be a lot of affected modules out there. I found one that had the same error and was fixed

The patch shows, that it might not be hard to fix.

I might try and have a go at it, or do you @Kwanky-Millet want to give it a shot?

As @Plippo mentioned, re-running prepare_for_current_kernel.sh should pull relevant module sources and issue should be resolved. It worked for me.

@Plippo I did not know this and I simply ran the install command up until now, apologies. Everything works fine now, thanks a lot!

GeraldWodni commented 1 year ago

@Plippo I was using the AUR module and just assumed it would do what it should. Uninstalling the module and following your instructions after some cleanup and now it works like a charm.

Apologies for the confusion. @Kwanky-Millet thank you for pointing out that running the script fixed everything for you.