When installing new linux headers pkg it shows error for the tp_smapi module

Asked by chris pollock

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

uname -a
Linux localhost 4.15.0-30-generic #32~16.04.1-Ubuntu SMP Thu Jul 26 20:25:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

This happened again today when installing linux-headers-4.15.0-32-generic. The error at the end of the install is:

Error! Bad return status for module build on kernel: 4.15.0-32-generic (x86_64)
Consult /var/lib/dkms/tp_smapi/0.42/build/make.log for more information.

The /var/lib/dkms/tp_smapi/0.42/build/make.log shows:

DKMS make.log for tp_smapi-0.42 for kernel 4.15.0-32-generic (x86_64)
Tue Aug 14 16:37:35 CDT 2018
make: Entering directory '/usr/src/linux-headers-4.15.0-32-generic'
  CC [M] /var/lib/dkms/tp_smapi/0.42/build/thinkpad_ec.o
/var/lib/dkms/tp_smapi/0.42/build/thinkpad_ec.c: In function ‘check_dmi_for_ec’:
/var/lib/dkms/tp_smapi/0.42/build/thinkpad_ec.c:469:1: warning: the frame size of 1728 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
  CC [M] /var/lib/dkms/tp_smapi/0.42/build/tp_smapi.o
  CC [M] /var/lib/dkms/tp_smapi/0.42/build/hdaps.o
/var/lib/dkms/tp_smapi/0.42/build/hdaps.c: In function ‘hdaps_init’:
/var/lib/dkms/tp_smapi/0.42/build/hdaps.c:781:2: error: implicit declaration of function ‘init_timer’ [-Werror=implicit-function-declaration]
  init_timer(&hdaps_timer);
  ^
/var/lib/dkms/tp_smapi/0.42/build/hdaps.c:782:23: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  hdaps_timer.function = hdaps_mousedev_poll;
                       ^
cc1: some warnings being treated as errors
scripts/Makefile.build:339: recipe for target '/var/lib/dkms/tp_smapi/0.42/build/hdaps.o' failed
make[1]: *** [/var/lib/dkms/tp_smapi/0.42/build/hdaps.o] Error 1
Makefile:1552: recipe for target '_module_/var/lib/dkms/tp_smapi/0.42/build' failed
make: *** [_module_/var/lib/dkms/tp_smapi/0.42/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.15.0-32-generic'

I don't have a Think Pad so I'm wondering if there's a reason this keeps showing up when I install the kernel headers. I see no problems anywhere.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
chris pollock
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the command

apt-cache policy tp-smapi-dkms

As far as I know, tp-smapi is a package containing software for IBM/Lenovo ThinkPad laptops. If you have different hardware, then the question is: Why do you have this software installed at all, and how did you install it?

I assume, that the version which you have installed, would need some additional patches to work with the 4.15 kernel series. (I assume that the problem started with the kernel upgrade from the 4.13 to the 4.15 series, about a month ago.

Revision history for this message
chris pollock (cpollock) said :
#2

apt-cache policy tp-smapi-dkms
tp-smapi-dkms:
  Installed: 0.42-1
  Candidate: 0.42-1
  Version table:
 *** 0.42-1 100
        100 /var/lib/dpkg/status
     0.41-1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 Packages

apt show -a tp-smapi-dkms
Package: tp-smapi-dkms
Version: 0.42-1
Status: install ok installed
Priority: optional
Section: kernel
Source: tp-smapi
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Evgeni Golov <email address hidden>
Installed-Size: 124 kB
Depends: dkms (>= 2.1.0.0)
Homepage: https://github.com/evgeni/tp_smapi/
Download-Size: unknown
APT-Manual-Installed: no
APT-Sources: /var/lib/dpkg/status
Description: ThinkPad hardware/firmware access modules source - dkms version
 The tp_smapi kernel module exposes some features of the ThinkPad
 hardware/firmware via a sysfs interface. Currently, the main implemented
 functionality is control of battery charging and extended battery status.
 The underlying hardware interfaces are SMAPI and direct access to the
 embedded controller.
 .
 This package also brings the source for an improved version of HDAPS
 which should work on newer ThinkPads too (the stock kernel version does
 not).
 .
 This package contains the source to be built with dkms.

Package: tp-smapi-dkms
Version: 0.41-1
Priority: optional
Section: universe/kernel
Source: tp-smapi
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Evgeni Golov <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 193 kB
Depends: dkms (>= 1.95)
Homepage: http://tpctl.sourceforge.net/
Supported: 9m
Download-Size: 35.8 kB
APT-Sources: http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Description: ThinkPad hardware/firmware access modules source - dkms version
 The tp_smapi kernel module exposes some features of the ThinkPad
 hardware/firmware via a sysfs interface. Currently, the main implemented
 functionality is control of battery charging and extended battery status.
 The underlying hardware interfaces are SMAPI and direct access to the
 embedded controller.
 .
 This package also brings the source for an improved version of HDAPS
 which should work on newer ThinkPads too (the stock kernel version does
 not).
 .
 This package contains the source to be built with dkms.

I don't have a ThinkPad, and yes, this seemed to have started when the update from 4.13 to 4.15 kernel began. To me it's an annoyance when installing the kernel headers and doens't present an issue since I use a desktop.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Where did you get version 0.42-1?
The Ubuntu sources have version 0.41-1.

You could try removing that sofwtare with the command
sudo apt-get purge tp-smapi-dkms

(Remark: The error is triggered not when a new version of the kernel headers is installed, but with a new kernel image.)

Revision history for this message
chris pollock (cpollock) said :
#4

sudo apt-get purge tp-smapi-dkms
[sudo] password for chris:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  tp-smapi-dkms*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 124 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 981150 files and directories currently installed.)
Removing tp-smapi-dkms (0.42-1) ...

-------- Uninstall Beginning --------
Module: tp_smapi
Version: 0.42
Kernel: 4.10.0-38-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

thinkpad_ec.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.10.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

tp_smapi.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.10.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

hdaps.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.10.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

-------- Uninstall Beginning --------
Module: tp_smapi
Version: 0.42
Kernel: 4.4.0-133-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

thinkpad_ec.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-133-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

tp_smapi.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-133-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

hdaps.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-133-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod.........

DKMS: uninstall completed.

------------------------------
Deleting module version: 0.42
completely from the DKMS tree.
------------------------------
Done.

I see where this module was deleted from the 4.10 and 4.4 kernels however not from the 4.15 that I'm running

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

It cannot (and need not) be removed from the 4.15 version of the kernel, because it was not possible to build it for that version!

Does package install or update work now?

Revision history for this message
chris pollock (cpollock) said :
#6

Yes, reinstalling the kernel headers now shows no errors.

sudo apt install --reinstall linux-headers-4.15.0-32-generic
[sudo] password for chris:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 1,081 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.15.0-32-generic amd64 4.15.0-32.35~16.04.1 [1,081 kB]
Fetched 1,081 kB in 1s (913 kB/s)
(Reading database ... 981138 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-32-generic_4.15.0-32.35~16.04.1_amd64.deb ...
Unpacking linux-headers-4.15.0-32-generic (4.15.0-32.35~16.04.1) over (4.15.0-32.35~16.04.1) ...
Setting up linux-headers-4.15.0-32-generic (4.15.0-32.35~16.04.1) ...

Thank you problem solved.