Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176457 - sys-power/acpitool-0.4.7 does not work w/ kernel 2.6.21
Summary: sys-power/acpitool-0.4.7 does not work w/ kernel 2.6.21
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: kernel-2.6.21
  Show dependency tree
 
Reported: 2007-04-29 12:51 UTC by Phillip Berndt
Modified: 2007-05-09 19:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Updated patch to work with 2.6.21 (acpitool-0.4.7-proc_acpi_info_move.patch,1.88 KB, patch)
2007-04-29 12:52 UTC, Phillip Berndt
Details | Diff
Test (foo.cpp,435 bytes, text/plain)
2007-05-09 18:04 UTC, Phillip Berndt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phillip Berndt 2007-04-29 12:51:10 UTC
The patch supplied with acpitool-0.4.7 does not work for me. (x86, 2.6.21)

At least on my PC, ifstreams can't be used for file existance checking by doing
 foo.open(file);
 if(foo)
instead, you have to use the correct class method
 foo.open(file)
 if(foo.is_open())

As a result of that, acpitool refuses to start, reporting that it needed ACPI to run, even if the files it searches for exist.

I prepared a new patch, which corrects this. I also replaced the gotos of the old patch with if-statements.

(Sorry for this new bug report, but I couldn't find the one containing the old patch, so I assumed there is none :))

Reproducible: Always

Steps to Reproduce:
Compile and start acpitool on a 2.6.21; it will refuse to start.
Comment 1 Phillip Berndt 2007-04-29 12:52:01 UTC
Created attachment 117639 [details, diff]
Updated patch to work with 2.6.21
Comment 2 Phillip Berndt 2007-04-29 12:56:11 UTC
Eh, to avoid confusions: Checking if(foo) works exactly once. Which means

 foo.open("nonexistant")
 if(foo) { /* Won't execute this */ }
 foo.open("existant")
 if(foo) { /* Won't execute this */ }

Doing

 foo.open("existant")
 if(foo) { /* WILL execute this */ }

without the other check works.
Comment 3 Stefan Schweizer (RETIRED) gentoo-dev 2007-05-09 16:41:03 UTC
# acpitool -e
  Kernel version : 2.6.21-gentoo   -    ACPI version : 20070126
..all the info..


works perfectly here. Please give more info as to what is broken, the patch does not compile here either.
Comment 4 Phillip Berndt 2007-05-09 18:04:55 UTC
Created attachment 118672 [details]
Test

Weird. I used the attached code for testing. It works on one of my boxes but not on the other one:

Result on my x86_64, gcc 4.1.1-r3:
test 2 succeed
test 2/2 succeed
done

Result on my x86, gcc 4.1.1-r3:
test 2/2 succeed
done

I don't know where to search for the difference between the two environments (the gcc package holds iostream) but anyway - according to [1], is_open is the  correct way to check if a file is opened.

For the compilation problem: Are you sure you tried this with 0.4.7 (which is NOT the stable version)? Because on my system, the patch works:
---------------
pberndt@sandbox(foo) ~/acpitool-0.4.7 $ patch -p1 < ../foo.patch 
patching file src/acpitool.cpp
pberndt@sandbox(foo) ~/acpitool-0.4.7 $ ./configure > /dev/null 
pberndt@sandbox(foo) ~/acpitool-0.4.7 $ make > /dev/null 
pberndt@sandbox(foo) ~/acpitool-0.4.7 $ ./src/acpitool 
... no error
---------------
However, error messages might help me resolving this :)

[1] http://www.cplusplus.com/reference/iostream/ifstream/
Comment 5 Phillip Berndt 2007-05-09 18:06:12 UTC
- Reopened, see comment above -
Comment 6 Stefan Schweizer (RETIRED) gentoo-dev 2007-05-09 18:17:57 UTC
well he patch just did not apply it for you. What error messages do you get with the usual acpitool?
Comment 7 Phillip Berndt 2007-05-09 18:29:10 UTC
> What error messages do you get with the usual acpitool?
The error message that ACPI was not compiled into the kernel. See my "test" attachment. (I'm VERY sure that is is the problem)

> well he patch just did not apply it for you.
Pardon, I don't understand that (I'm no native speaker). Do you mean my patch does not apply for you? The patch succeeds with the file referred to in the ebuild:

pberndt@nijil ~ $ md5sum acpitool-0.4.7.tar.bz2 
cba416a11229e896ec2639c59b6f59c5  acpitool-0.4.7.tar.bz2
Comment 8 Phillip Berndt 2007-05-09 18:30:01 UTC
ps. sry: "apply for you" -> "apply on your system".
Comment 9 Stefan Schweizer (RETIRED) gentoo-dev 2007-05-09 18:51:05 UTC
test just is a test app for me.

Please post the ouput of:

emerge acpitool
acpitool -e

I want the "acpitool -e" output please.

And the patch does not apply when I do:

emerge acpitool
[strg]+Z
patch -p1 < patch

on the unstable version of course.
Comment 10 Phillip Berndt 2007-05-09 18:57:37 UTC
> And the patch does not apply when I do:
My patch REPLACES the existing patch

> acpitool -e
 AcpiTool v0.4.7, released 06-Feb-2007
Seems like this system lacks ACPI support or else /proc/acpi is not the place to look for ?
Comment 11 Stefan Schweizer (RETIRED) gentoo-dev 2007-05-09 19:16:37 UTC
thank you fixed.

now it applies for me and does no harm - so if it fixes something for you ;)