0

I’m trying to upgrade my system from Ubuntu 22.04 to 24.04, but I’m encountering an issue with the tp-smapi-dkms package. During the upgrade process, I get the following error:

Removing old tp_smapi-0.43 DKMS files...
Deleting module tp_smapi-0.43 completely from the DKMS tree.
Loading new tp_smapi-0.43 DKMS files...
Building for 6.8.0-52-generic
Building initial module for 6.8.0-52-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/tp-smapi-dkms.0
.crash'
Error! Bad return status for module build on kernel: 6.8.0-52-generic (x86_64)
Consult /var/lib/dkms/tp_smapi/0.43/build/make.log for more information.
dpkg: error processing package tp-smapi-dkms (--configure):
 installed tp-smapi-dkms package post-installation script subprocess returned er
ror exit status 10
Errors were encountered while processing:
 tp-smapi-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

I checked the log, and this is what it contains:

DKMS make.log for tp_smapi-0.43 for kernel 6.8.0-52-generic (x86_64)
Mon Mar 10 03:29:57 PM CET 2025
make: Entering directory '/usr/src/linux-headers-6.8.0-52-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  You are using:           gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  CC [M]  /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o
  CC [M]  /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o
  CC [M]  /var/lib/dkms/tp_smapi/0.43/build/hdaps.o
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:42: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
   94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
      |                                          ^
In file included from ./include/linux/fs.h:25,
                 from ./include/linux/compat.h:17,
                 from ./arch/x86/include/asm/ia32.h:7,
                 from ./arch/x86/include/asm/elf.h:10,
                 from ./include/linux/elf.h:6,
                 from ./include/linux/module.h:19,
                 from /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:33:
./include/linux/semaphore.h:34: note: macro "DEFINE_SEMAPHORE" defined here
   34 | #define DEFINE_SEMAPHORE(_name, _n)     \
      | 
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:8: error: type defaults to ‘int’ in declaration of ‘DEFINE_SEMAPHORE’ [-Werror=implicit-int]
   94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
      |        ^~~~~~~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function ‘thinkpad_ec_lock’:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:112:35: error: ‘thinkpad_ec_mutex’ undeclared (first use in this function); did you mean ‘thinkpad_ec_lock’?
  112 |         ret = down_interruptible(&thinkpad_ec_mutex);
      |                                   ^~~~~~~~~~~~~~~~~
      |                                   thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:112:35: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function ‘thinkpad_ec_try_lock’:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:126:30: error: ‘thinkpad_ec_mutex’ undeclared (first use in this function); did you mean ‘thinkpad_ec_lock’?
  126 |         return down_trylock(&thinkpad_ec_mutex);
      |                              ^~~~~~~~~~~~~~~~~
      |                              thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function ‘thinkpad_ec_unlock’:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:138:13: error: ‘thinkpad_ec_mutex’ undeclared (first use in this function); did you mean ‘thinkpad_ec_lock’?
  138 |         up(&thinkpad_ec_mutex);
      |             ^~~~~~~~~~~~~~~~~
      |             thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function ‘thinkpad_ec_try_lock’:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:127:1: error: control reaches end of non-void function [-Werror=return-type]
  127 | }
      | ^
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: At top level:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:8: warning: ‘DEFINE_SEMAPHORE’ defined but not used [-Wunused-variable]
   94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
      |        ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:36: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
  115 | static DEFINE_SEMAPHORE(smapi_mutex);
      |                                    ^
In file included from ./include/linux/fs.h:25,
                 from ./include/linux/compat.h:17,
                 from ./arch/x86/include/asm/ia32.h:7,
                 from ./arch/x86/include/asm/elf.h:10,
                 from ./include/linux/elf.h:6,
                 from ./include/linux/module.h:19,
                 from /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:38:
./include/linux/semaphore.h:34: note: macro "DEFINE_SEMAPHORE" defined here
   34 | #define DEFINE_SEMAPHORE(_name, _n)     \
      | 
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:8: error: type defaults to ‘int’ in declaration of ‘DEFINE_SEMAPHORE’ [-Werror=implicit-int]
  115 | static DEFINE_SEMAPHORE(smapi_mutex);
      |        ^~~~~~~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: In function ‘store_battery_start_charge_thresh’:
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:780:15: error: ‘smapi_mutex’ undeclared (first use in this function)
  780 |         down(&smapi_mutex);
      |               ^~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:780:15: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: In function ‘store_battery_stop_charge_thresh’:
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:822:15: error: ‘smapi_mutex’ undeclared (first use in this function)
  822 |         down(&smapi_mutex);
      |               ^~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: At top level:
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:8: warning: ‘DEFINE_SEMAPHORE’ defined but not used [-Wunused-variable]
  115 | static DEFINE_SEMAPHORE(smapi_mutex);
      |        ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.8.0-52-generic/Makefile:1925: /var/lib/dkms/tp_smapi/0.43/build] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.8.0-52-generic'

I am a newbie to Linux and I am unsure how to resolve the error. As mentioned in the title I have a Lenovo thinkPad T14 machine.

Has anyone encountered this issue or know how to fix it? Any help would be greatly appreciated!

1 Answers1

0

Fixed the issue by updating tp-smapi package from here