#1146537 tp-smapi-dkms: module fails to build for Linux 7.2: error: implicit declaration of function 'strncpy' #1146537
- Package:
- tp-smapi-dkms
- Source:
- tp-smapi-dkms
- Description:
- ThinkPad hardware/firmware access modules source - dkms version
- Submitter:
- Andreas Beckmann
- Date:
- 2026-10-09 12:23:03 UTC
- Severity:
- normal
- Tags:
Hi,
tp-smapi-dkms fails to build a module for Linux 7.2 in experimental:
DKMS (dkms-3.2.2) make.log for tp_smapi/0.45 for kernel 7.2-amd64 (x86_64)
Wed Sep 2 19:45:18 UTC 2026
Building module(s)
# command: make -j14 KERNELRELEASE=7.2-amd64 -C /lib/modules/7.2-amd64/build M=/var/lib/dkms/tp_smapi/0.45/build HDAPS=1
make: Entering directory '/usr/src/linux-headers-7.2-amd64'
make[1]: Entering directory '/var/lib/dkms/tp_smapi/0.45/build'
CC [M] thinkpad_ec.o
CC [M] tp_smapi.o
CC [M] hdaps.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[3]: *** [/usr/src/linux-headers-7.2-common/scripts/Makefile.build:294: tp_smapi.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/src/linux-headers-7.2-common/Makefile:2211: .] Error 2
make[1]: *** [/usr/src/linux-headers-7.2-common/Makefile:260: __sub-make] Error 2
make[1]: Leaving directory '/var/lib/dkms/tp_smapi/0.45/build'
make: *** [/usr/src/linux-headers-7.2-common/Makefile:260: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-7.2-amd64'
# exit code: 2
# elapsed time: 00:00:01
----------------------------------------------------------------
Andreas
This oneliner fixed it for me: https://github.com/linux-thinkpad/tp_smapi/pull/81/files
Hello, I workaround it with: $ sudo sed -i \ 's/strncpy(buf, (char \*)row+offset, maxlen);/strscpy(buf, (char *)row+offset, maxlen);/' \ /var/lib/dkms/tp_smapi/0.45/build/tp_smapi.c $ sudo sed -i 's/strncpy(buf, (char \*)row+offset, maxlen);/strscpy(buf, (char *)row+offset, maxlen);/' /usr/src/tp_smapi-0.45/tp_smapi.c $ sudo dkms remove -m tp_smapi -v 0.45 --all $ sudo dkms add -m tp_smapi -v 0.45 $ sudo dkms build -m tp_smapi -v 0.45 -k 7.2.8+deb14-amd64 $ sudo dkms install -m tp_smapi -v 0.45 -k 7.2.8+deb14-amd64 Regards,
Hello Evgeny, Since this package broke my APT assisted upgrade, it is scheduled for auto removal in 8 days (Oct 10th), and I found it to be in LowNMU threshold list, and besides seeing your comment at: - https://github.com/linux-thinkpad/tp_smapi/pull/81#issuecomment-5544569200 I have uploaded it to delayed queue 7 with NMU update you can find as salsa MR: - https://salsa.debian.org/debian/tp-smapi/-/merge_requests/5 You can also find debdiff file attached in this report. I have also built package locally and installed it on my system fine: $ sudo dpkg -i tp-smapi-dkms_0.45-1.1_amd64.deb (S'està llegint la base de dades… hi ha 453710 fitxers i directoris instal·lats actualment.) S'està preparant per a desempaquetar tp-smapi-dkms_0.45-1.1_amd64.deb… Module tp_smapi/0.45 for kernel 7.2.8+deb14-amd64 (x86_64): Before uninstall, this module version was ACTIVE on this kernel. Deleting /lib/modules/7.2.8+deb14-amd64/updates/dkms/thinkpad_ec.ko.xz Deleting /lib/modules/7.2.8+deb14-amd64/updates/dkms/tp_smapi.ko.xz Deleting /lib/modules/7.2.8+deb14-amd64/updates/dkms/hdaps.ko.xz Restoring archived original module /lib/modules/7.2.8+deb14-amd64/kernel/drivers/platform/x86/hdaps.ko.xz Running depmod.... done. Deleting module tp_smapi/0.45 completely from the DKMS tree. S'està desempaquetant tp-smapi-dkms (0.45-1.1) sobre (0.45-1)… S'està configurant tp-smapi-dkms (0.45-1.1)… Loading new tp_smapi/0.45 DKMS files... Building for 7.0.10+deb14-amd64, 7.1.12+deb14-amd64 and 7.2.8+deb14-amd64 Building initial module tp_smapi/0.45 for 7.0.10+deb14-amd64 Sign command: /lib/modules/7.0.10+deb14-amd64/build/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Building module(s)... done. Signing module /var/lib/dkms/tp_smapi/0.45/build/thinkpad_ec.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/tp_smapi.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/hdaps.ko Installing /lib/modules/7.0.10+deb14-amd64/updates/dkms/thinkpad_ec.ko.xz Installing /lib/modules/7.0.10+deb14-amd64/updates/dkms/tp_smapi.ko.xz Found pre-existing /lib/modules/7.0.10+deb14-amd64/kernel/drivers/platform/x86/hdaps.ko.xz, archiving for uninstallation Installing /lib/modules/7.0.10+deb14-amd64/updates/dkms/hdaps.ko.xz Running depmod.... done. Building initial module tp_smapi/0.45 for 7.1.12+deb14-amd64 Sign command: /lib/modules/7.1.12+deb14-amd64/build/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Building module(s)... done. Signing module /var/lib/dkms/tp_smapi/0.45/build/thinkpad_ec.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/tp_smapi.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/hdaps.ko Installing /lib/modules/7.1.12+deb14-amd64/updates/dkms/thinkpad_ec.ko.xz Installing /lib/modules/7.1.12+deb14-amd64/updates/dkms/tp_smapi.ko.xz Found pre-existing /lib/modules/7.1.12+deb14-amd64/kernel/drivers/platform/x86/hdaps.ko.xz, archiving for uninstallation Installing /lib/modules/7.1.12+deb14-amd64/updates/dkms/hdaps.ko.xz Running depmod.... done. Building initial module tp_smapi/0.45 for 7.2.8+deb14-amd64 Sign command: /lib/modules/7.2.8+deb14-amd64/build/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Building module(s)... done. Signing module /var/lib/dkms/tp_smapi/0.45/build/thinkpad_ec.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/tp_smapi.ko Signing module /var/lib/dkms/tp_smapi/0.45/build/hdaps.ko Installing /lib/modules/7.2.8+deb14-amd64/updates/dkms/thinkpad_ec.ko.xz Installing /lib/modules/7.2.8+deb14-amd64/updates/dkms/tp_smapi.ko.xz Found pre-existing /lib/modules/7.2.8+deb14-amd64/kernel/drivers/platform/x86/hdaps.ko.xz, archiving for uninstallation Installing /lib/modules/7.2.8+deb14-amd64/updates/dkms/hdaps.ko.xz Running depmod.... done. Thanks very much for your understanding. Regards
We believe that the bug you reported is fixed in the latest version of
tp-smapi, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1146537@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Héctor Orón Martínez <zumbi@debian.org> (supplier of updated tp-smapi package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 02 Oct 2026 13:32:46 +0200
Source: tp-smapi
Architecture: source
Version: 0.45-1.1
Distribution: unstable
Urgency: medium
Maintainer: Evgeni Golov <evgeni@debian.org>
Changed-By: Héctor Orón Martínez <zumbi@debian.org>
Closes: 1146537
Changes:
tp-smapi (0.45-1.1) unstable; urgency=medium
.
* Non-maintainer upload.
* d/p/use_strscpy_instead_of_strncpy_since_7.2.patch: fixes build against
Linux kernel 7.2
(Closes: #1146537)
Checksums-Sha1:
be0d3a92522a9b887f9ed3e0c53efe3ac2d2b712 1909 tp-smapi_0.45-1.1.dsc
ced1ea185dc6acdf0dd9f2a51cd75fc14a19fa82 40001 tp-smapi_0.45.orig.tar.gz
31c4d6846c9c5faea8be057982a6b5e235b07187 6236 tp-smapi_0.45-1.1.debian.tar.xz
674784afaafe8d495cbcf1102ae2a7a213b30f8e 5819 tp-smapi_0.45-1.1_source.buildinfo
Checksums-Sha256:
b2a754859c6d262f15c2261f5f33c5e3d27fc224b6c56f7f730be7e075f13f21 1909 tp-smapi_0.45-1.1.dsc
627b15affc3ed993d633be1421b66db8c96789464390029b86bb16b00239bb24 40001 tp-smapi_0.45.orig.tar.gz
b066e073d52f5354026e2b39d4edde1e09ddbd18e2f935e05a3daaa28ae1538c 6236 tp-smapi_0.45-1.1.debian.tar.xz
eb5accb2a1b41b0098d8f1fffa0e34b72117836b33857b8f36bf8941d97043cc 5819 tp-smapi_0.45-1.1_source.buildinfo
Files:
a46c3498e0a425e330b57f9b2f3ed067 1909 kernel optional tp-smapi_0.45-1.1.dsc
c796e498f649db66b099f2afbdc1ce2a 40001 kernel optional tp-smapi_0.45.orig.tar.gz
da63056f1c356819f3e1b6beaeac25eb 6236 kernel optional tp-smapi_0.45-1.1.debian.tar.xz
7e9fa553367ed9c9419496c6f399ce86 5819 kernel optional tp-smapi_0.45-1.1_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE6Q8IiVReeMgqnedOryKDqnbirHsFAmq/mQ8ACgkQryKDqnbi
rHsXKhAAjZJGjSV0wv52iflShZ80i3dzYaT3HGaQ21YvHDpBnp1204iA2WD7qUQB
3yrdPS7WDY86HpstUItxpuSxXXF8p8lI41DOs/hBvx0aw206QVIPrqKF35j3Ibeb
oVtSF+L7PqxmR0ferAdilXFoE2hlErFgM44JMR2/UebD7PsaiYVuE8YHDMfofQlr
sYT9/BWo0sKHkImjD2TVhidd1afzMQtjPxwchaBHydmFDswskFQX7/vIQypnYXFB
NpI01RjXS6ZBtj60yBXE1NYeQo8h+jWiztPK8IYCP+8nIuTQf9j7pPE68dqJqKPD
Xe5gtoHV4j73q3RXxD80WFdP50Ccub11cgVz0DofAoD3QvK48+vkZOJCHC03EdR9
BLs1YmxCyfIottqQJAx18sy5k+87G+CQT4+G3ma8lhlRmtV85l0aGUscfmiJur0v
1XkvIUpn/Iuy8pA7IZ/9tyhflpFf9GZSSPZuBgaklQAYZopd/eWOMd1ISHLz1CHe
SdqWKgQF/ZXvrtaKJPp/+i9kJKpLlhM6HNf3VZzO+XsILihBZG/UXyhRI5nH0VdG
LbFc1wtc8BN1t7nqSBEd089dWk7h7ravl2BrHU8Us7VtCj4da+2hetky4fsujkne
XULWK1Na7brvApDgV12ZO9b0zPiFHLKL4clKWGPbc3aeS9fvToo=
=j+6e
-----END PGP SIGNATURE-----