This page is meant to describe how to compile the Coretemp patches to get the Core 2 Duo CPU temperature sensors work under edgy and probably other ubuntu versions (mainly with lm-sensors). These patches were written by Rudolf Marek; you may view his post
First, let me say that any comments will be welcome. It's after all quite easy to get this to compile on the edgy 2.6.17 kernel :
Start by installing required dev packages :
sudo apt-get install build-essential gcc linux-headers-`uname -r`
Create a woking directory :
mkdir coretemp cd coretemp
Then: download the modified coretemp file OR download the 1st attachement when following the link given above and extract from the patch the coretemp.c file (this may not be easy) or apply the patch to some kernel source...
If you downloaded the modified coretemp.c file, skip to the makefile, otherwise, you'll have to prevent some code compilation, because it seems that some optionnal kernel functions are not present in the 2.6.17 kernel that were available when the patch was developped (but disabling those is very easy) : on line 41, just after the << #define DRVNAME >>, add this line :
(I personally don't need "CPU hotplug"... do you ??)
OK. So now, it's time to create the makefile and compile the kernel module (copy/paste the whole selection):
cat << EOF > Makefile obj-m += coretemp.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean EOF #compilation... make
This should compile without errors... hopefully
If you do get errors, try using this instead:
cat << EOF > Makefile obj-m += coretemp.o all: make -C /lib/modules/$(uname -r)/build M=$(pwd) modules clean: make -C /lib/modules/$(uname -r)/build M=$(pwd) clean EOF #compilation... make
Now it's time for a warning : BACKUP all your data and close any running application ! Reason for this warning : inserting a standard module in the kernel is OK, but here we're going to insert a custom and non official module : this could at best crash your running kernel, but it could mess everything on your computer...
Now that you're warned, it's time to test the module :
sudo insmod coretemp.ko
If this works, then use your favorite lm-sensors and run 'sensors' : you'll see your CPU temperatures appear
If you want to permanently install this module for this kernel, copy it into the kernel modules :
sudo cp coretemp.ko /lib/modules/`uname -r`/kernel/drivers/hwmon/ ldconfig
(I'm not sure about the ldconfig)
And add in /etc/modules if it's not already there :
... and that's it !