Chromium Code Reviews
DescriptionIntroduce crossystem wrapper for SAFT.
There has been an effort under way to abstract platform
specific information through the 'crossystem' utility, which
is capable of discovering information in platform specific
fashion and representing it in a unified way on all
platforms.
The BIOS ACPI on some platforms has been modified to support
this, which of course broke SAFT completely.
This CL introduces a wrapper for crossystem to derive all
necessary information in a target independent way and
emulate information previously read directly from ACPI.
The actual SAFT fix will come in the next CL.
The 'crossystem' wrapper is a class which runs the
crossystem utility to retrieve or set the crossystem
parameters..
The __getattr__() method override is used to get the
value of an arbitrary crossystem parameter, so that
crossystem.name causes the shell command
'crossystem name'
invocation to retrieve the value of parameter 'name'.
The __setattr__() method override is used to set the
crossystem parameters, such that assigning
crossystem.name = value
causes a shell command
'crossystem "name=value"'
to be invoked. The only name not passed to the shell
command, but set directly is 'cros_if', which is a
member of the crossystem wrapper class.
Change-Id: I59b547d899598501185a443cf2cffcc00330b37c
BUG=chrome-os-partner:2617
TEST=on the workstation:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
es^o: home/vbendeb/projects/1repo/src/platform/saft 119 > ./runtests.sh
....
----------------------------------------------------------------------
Ran 4 tests in 0.032s
OK
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=c034073
Patch Set 1 : Adapt to using crossystem. #Patch Set 2 : Do not cache crossystem output. #
Total comments: 1
Messages
Total messages: 4 (0 generated)
|
|||||||||||||||||||||||||||||||||||||