Wednesday, February 9, 2011

Phctool patch for 2.6.36 kernels

Here comes a bug solution for Phctool, committed in gentoo package 0.5.2-2-r1 and developed by me :]

Phctool python-based graphic interface seems to not work due to the way CPUs id is defined. Looks like it's based still on /proc/acpi/processor/CPU./info which is no more present in my system. It looks like that kernel 2.6.36 and later doesn't support those deprecated /proc/acpi directories even with CONFIG_ACPI_PROCFS enabled.

No window opens, if run in terminal you get:

Traceback (most recent call last):
File "./", line 468, in <module>
File "./", line 81, in __init__
self.cpuinfo=cpuinfo.cpuinfo() ##functions to gather CPU informations
File "inc/libs/", line 12, in __init__
self._get_acpi_cpus() ##get ACPI-supported CPUs
File "inc/libs/", line 43, in _get_acpi_cpus[cpunr]['acpi']['exist']=False
UnboundLocalError: local variable 'cpunr' referenced before assignment

Expected Results:
Open UI GUI. Looks like that functionality is still available, just the GUI is

The solution stands just in replacing a lib with a newer one, which I committed to gentoo bugzilla.

So download the file from here (right click, save as)

backup the old file:

sudo mv /usr/share/phctool/inc/libs/ /usr/share/phctool/inc/libs/

copy the new

sudo cp #*path to download*#/ /usr/share/phctool/inc/libs/

if experience wrong behaviour write a comment!


1 comment: