Page 1 of 5

PHC on Ubuntu 9.04

Posted: Wed 25. Mar 2009, 18:34
by the-fallen
With the release of Ubuntu 9.04 the modules powernow-k8, speedstep-centrino and acpi-cpufreq are not longer available as module but compiled into the kernel.

This takes away the possibility of the easy way to get in touch with PHC: patching and recompiling the module only.

You have to compile the whole kernel now.
Here you get the short-manual how to do that.

Users can offer their compiled kernels in this forum (as a link to another storage place) if they want to.


This howto is derived from:
https://help.ubuntu.com/community/Kernel/Compile


Step 1 - Download needed packages

sudo apt-get install build-dep linux fakeroot build-essential makedumpfile linux-source

Step 2 - Unpack and prepare the source
cd /usr/src
sudo -s
tar -xjf linux-source-<version>
copy /boot/config-<version> /usr/src/linux-source-<version>/.config


Step 3 - Configure your new Kernel

make menuconfig

Now you get the configuration GUI.
Go to

Code: Select all

Power management and ACPI options  --->
CPU Frequency scaling  --->
and change the section *** CPUFreq processor drivers *** to look like that:

FOR INTEL PROCESSORS:

Code: Select all

<M>  ACPI Processor P-States driver
< >   AMD Opteron/Athlon64 PowerNow!
< >   Intel Enhanced SpeedStep (deprecated)
< >   Intel Pentium 4 clock modulation

FOR AMD PROCESSORS:

Code: Select all

< >   ACPI Processor P-States driver
<M>  AMD Opteron/Athlon64 PowerNow!
< >   Intel Enhanced SpeedStep (deprecated)
< >   Intel Pentium 4 clock modulation
now quit the configuration GUI and do not forget to save it.

Step 4 - Kompile and install the Kernel

To speed things up you can set the following environment variable:

export CONCURRENCY_LEVEL=3

The Level should be set to "amount of cores"+1.
For Single-Core use "2", for a Dual-Core use "3" and so on.

Finally compile the Kernel:
fakeroot make-kpkg --initrd --append-to-version=-phc001 kernel-image kernel-headers


After everything is done there are two new deb-packages in /usr/src. Install them (apt-get -i *.deb).

Reboot with the new kernel and continue installing the phc-intel or phc-k8 package.

Re: PHC on Ubuntu 9.04

Posted: Sat 25. Apr 2009, 12:34
by n3Cre0
Man, I just tried that phc-intel-0.3.2-4 offtree package and it works beautifully! Way easier and faster than before (i.e. patching kernel and building module there). :D
And now we got Ubuntu 9.04 acting like a total jerk for building in acpi-cpufreq module :cry:

So now it's even worse? Do I (and with me every other Ubuntu user) need to recompile each new kernelversion (like when there is a security update) just to get acpi-cpufreq compiled as module? And then we can use the offtree package?
Just asking because maybe there is an easier way? Compiling the whole ubuntu kernel with all its modules takes many hours on this laptop (I think around 4hrs).

Re: PHC on Ubuntu 9.04

Posted: Sun 26. Apr 2009, 08:52
by the-fallen
We are trying to open a PPA for a patched version of the ubuntu kernel but we have some minor troubles.
If there is somebody around here who have experiences with PPAs we would need your help :)

For everything else, you are right, it is a pain in the ass.

You do not need to recompile your kernel every time. If you compile it once and do not name it exactly like the ubuntu Kernel your kernel won't be replaced every time. If you can live with not to get all the new things Ubuntu puts into their backport Kernels (or backport Kernel modules) this may be your way.

Re: PHC on Ubuntu 9.04

Posted: Sun 26. Apr 2009, 09:11
by n3Cre0
the-fallen wrote:We are trying to open a PPA for a patched version of the ubuntu kernel
That would be ideal in this situation.
For everything else, you are right, it is a pain in the ass.
It was, wasted 6 hours on it. Ubuntu's kernel is way too big :|

EDIT: So I installed this new kernel (acpi-cpufreq is a module now) and I tried to install the phc module. I'm executing every command but when I come to `make install` I get this:
# make install
install -m 644 -o root -g root phc-intel.modprobe /etc/modprobe.d/phc-intel.conf
mkdir -p /lib/modules/2.6.28.9-phc001/extra
install -m 644 -o root -g root phc-intel.ko /lib/modules/2.6.28.9-phc001/extra/
depmod 2.6.28.9-phc001 -a
make: *** [install] Bus error
Depmod took a very long time and then it crashed (?) with a bus error. Is this related to linux-phc?

Re: PHC on Ubuntu 9.04

Posted: Sun 26. Apr 2009, 10:55
by the-fallen
Hard to say if it is related to this package.
I never had this problem nor somebody else reported that before.

If you want to discuss this special problem please open a new thread so I can keep this one as clean as possible :)
I hope the module work for you even if you got this error message.

Re: PHC on Ubuntu 9.04

Posted: Sun 26. Apr 2009, 14:52
by n3Cre0
The module got installed all right:
root@Tunix:/# uname -a
Linux Tunix 2.6.28.9-phc001 #2 SMP Sun Apr 26 00:13:40 CEST 2009 i686 GNU/Linux
root@Tunix:/# file /lib/modules/2.6.28.9-phc001/extra/phc-intel.ko
/lib/modules/2.6.28.9-phc001/extra/phc-intel.ko: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
but..
root@Tunix:/# modprobe phc-intel
FATAL: Module phc_intel not found.
and
root@Tunix:/# depmod -a
Bus error
after 25 min of unresponsive system.

I won't open a new thread for this or mess up this thread any further, just wanted to answer your question. I think I'll just wait for the ppa repo.

EDIT: I think I'll try this one first: http://zweinull.lima-city.de/2009/03/28 ... 04-jaunty/
You know, the old way. Not off-tree, directly patch the acpi-cpufreq module.

Why the hell did they integrate the module in the kernel anyways T_T
What angers me mostly is that the devs never explained why they did it.

Re: PHC on Ubuntu 9.04

Posted: Mon 27. Apr 2009, 07:29
by the-fallen
Yeah, I would like to know the reason, too, but they did not answeared my question on launchpad.

The speedstep-k8 module for AMD is also compiled-in. So your Kernel always have one more module that is unneccessary. But I do not think they did it without a reason. Who knows....

For me (also ubuntu 9.04) depmod works ... tested it yesterday with 2.6.30-rc3.

I hope the "old way" is working for you.

Re: PHC on Ubuntu 9.04

Posted: Mon 27. Apr 2009, 16:15
by DavidG
I suspect the reason why they did it, is because someone had heard that you can boot Linux faster when the boot drivers are compiled in... However, that's only true for the modules you need to boot, such as sata drivers, filesystems and usb hci drivers. All compiled-in drivers are started at boot, so the ones you don't need slow everything down...

Re: PHC on Ubuntu 9.04

Posted: Tue 28. Apr 2009, 12:14
by n3Cre0
the-fallen wrote:I hope the "old way" is working for you.
Nope, it didn't. Whenever I try to insert acpi-cpufreq I get a FATAL ERROR "Device or resource is busy"
I'll recompile the kernel (again) but now with the (patched) module built-in. That should work, shouldn't it?
I certainly hope so or I'll spend even more time in windows.
DavidG wrote:I suspect the reason why they did it, is because someone had heard that you can boot Linux faster when the boot drivers are compiled in... However, that's only true for the modules you need to boot, such as sata drivers, filesystems and usb hci drivers. All compiled-in drivers are started at boot, so the ones you don't need slow everything down...
Yes, that will be it. It was one of 9.04 new "features": faster boottimes. A few milliseconds faster I expect.

EDIT: I hope they'll come to their senses soon and include it again as a module in the next kernel update.

Re: PHC on Ubuntu 9.04

Posted: Tue 28. Apr 2009, 23:10
by the-fallen
Should have had worked before.

Is there another cpu frequency manager module loaded? (speedstep-centrino?)
Did you compiled acpi-cpufreq as module?
Did you unload the unpatched one before loading the patched one?