Skip to content

Kernel 7.2.x Compatibility #82

Open

Description

@dtl131

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

Activity

  1. evgeni commented on Aug 29, 2026

    @evgeni
    Member

    See #81

  2. dtl131 commented on Aug 29, 2026

    @dtl131
    Author

    Yes, I can confirm that #81 allows successful build.

    Thanks.

  3. evgeni commented on Aug 30, 2026

    @evgeni
    Member

    Do the string-returning battery attributes still work? I've not yet booted a machine that is compatible with smapi to try it out.

  4. linked a pull request that will close this issueuse strscpy instead of strncpy #81on Aug 30, 2026
  5. dtl131 commented on Aug 30, 2026

    @dtl131
    Author

    I don't have a Thinkpad. I was just reporting build failure because of the Ubuntu bug report.

  6. evgeni commented on Aug 30, 2026

    @evgeni
    Member

    Are you the Ubuntu maintainer of that package?

  7. dtl131 commented on Aug 30, 2026

    @dtl131
    Author

    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.

  8. ArtifyCZ commented on Sep 26, 2026

    @ArtifyCZ

    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.

  9. added a commit that references this issue on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions