Repository navigation
Open
Description
Latest version cloned from git master does not build with kernel 7.2
make -C /lib/modules/7.2.2-1-siduction-amd64/build M=~/source/tp_smapi O=/lib/modules/7.2.2-1-siduction-amd64/build modules
make[1]: Entering directory '/usr/src/linux-headers-7.2.2-1-siduction-amd64'
make[2]: Entering directory '~/source/tp_smapi'
warning: pahole version differs from the one used to build the kernel
The kernel was built with: 131
You are using: 0
CC [M] thinkpad_ec.o
CC [M] tp_smapi.o
tp_smapi.c: In function ‘show_tp_ec_bat_str’:
tp_smapi.c:672:9: error: implicit declaration of function ‘strncpy’ [-Wimplicit-function-declaration]
672 | strncpy(buf, (char *)row+offset, maxlen);
| ^~~~~~~
tp_smapi.c:47:1: note: include ‘<string.h>’ or provide a declaration of ‘strncpy’
46 | #include <linux/platform_device.h>
+++ |+#include <string.h>
47 | #include <asm/uaccess.h>
tp_smapi.c:672:9: warning: incompatible implicit declaration of built-in function ‘strncpy’ [-Wbuiltin-declaration-mismatch]
672 | strncpy(buf, (char *)row+offset, maxlen);
| ^~~~~~~
tp_smapi.c:672:9: note: include ‘<string.h>’ or provide a declaration of ‘strncpy’
make[4]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/scripts/Makefile.build:294: tp_smapi.o] Error 1
make[3]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/Makefile:2211: .] Error 2
make[2]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/Makefile:260: __sub-make] Error 2
make[2]: Leaving directory '~/source/tp_smapi'
make[1]: *** [Makefile:260: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-7.2.2-1-siduction-amd64'
make: *** [Makefile:46: modules] Error 2
Someone also reported this on Ubuntu Launchpad: https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/2165822
Metadata
Metadata
Assignees
Labels
No labels
Activity
evgeni commentedon Aug 29, 2026
See #81
dtl131 commentedon Aug 29, 2026
Yes, I can confirm that #81 allows successful build.
Thanks.
evgeni commentedon Aug 30, 2026
Do the string-returning battery attributes still work? I've not yet booted a machine that is compatible with smapi to try it out.
dtl131 commentedon Aug 30, 2026
I don't have a Thinkpad. I was just reporting build failure because of the Ubuntu bug report.
evgeni commentedon Aug 30, 2026
Are you the Ubuntu maintainer of that package?
dtl131 commentedon Aug 30, 2026
I don't think Ubuntu has a designated maintainer, as the last few changes were done by different people. It seems they just take the Debian package and change the arch to amd64 only.
linuxPackages.tp_smapi: mark as broken for kernel >= v7.2
linuxPackages.tp_smapi: patch strncpy
ArtifyCZ commentedon Sep 26, 2026
The kernel module has been failing to build for NixOS as well. I patched it with the open PR's commit, and I am writing this comment primarily to get notified by GitHub when it gets closed so that we can get rid of the patch.
linuxPackages.tp_smapi: patch strncpy