Ticket #11437 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

power icon missing from Sugar My Settings

Reported by: Quozl Owned by: erikos
Priority: high Milestone: 1.75-software
Component: sugar Version: Development build as of this date
Keywords: Cc: tabitha
Action Needed: test in build Verified: no
Deployments affected: Blocked By:
Blocking:

Description

Reported by Kevin Gordon, the power icon is not present in My Settings on os10 on XO-1.75.

Change History

Changed 2 years ago by greenfeld

It looks like there is a check for '/ofw' to be present in jarabe/controlpanel/gui.py on line 132 in os883 (sugar-0.94.1-1).

If this path is not found, the power control panel appears to be removed from the list of available options.

Changed 2 years ago by Quozl

  • next_action changed from diagnose to code

Thanks. Related to incomplete task ticket #11116.

Changed 2 years ago by tabitha

  • cc tabitha added

Changed 2 years ago by martin.langhoff

Can we get a good old grep across sugar + sugar toolkit to ensure we got all references to /ofw under control?

Changed 2 years ago by Quozl

Yes, I did an [ apparently wasted ;-) ] recursive grep three months ago and listed the results in a comment on #11116. There's even activities that use /ofw.

Changed 2 years ago by erikos

So in the control panel we displayed the power icon if the machine is an XO (we asumed that if '/ofw' is present that would be the case), with the 1.75 this fails. We have several options:

* make another check based on '/ofw' and '/proc/device-tree' (maybe if 'mfg-data/SN' is present we can say it is an XO)

* do get the xo version ('/proc/device-tree/banner-name','/sys/class/dmi/id/product_version', '/ofw/banner-name' ) and determine that way it is an XO

probably more long term:

* maybe the power extension should be an olpc package and the upstream code should be removed

* make the section more generic (whatever that exactly looks like)

Changed 2 years ago by pgf

all of the version info is encapsulated in /usr/bin/olpc-hwinfo. please use that if possible.

Changed 2 years ago by erikos

  • next_action changed from code to review

Sent a patch to sugar-devel that checks if powerd is available to determine if the power section is displayed or not (we have the same check in the control panel section). As far as I have seen all of our hardware (1-1.75) is using powerd today.

diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 2f55951..46810aa 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -30,6 +30,7 @@ from jarabe.controlpanel.toolbar import MainToolbar
 from jarabe.controlpanel.toolbar import SectionToolbar
 from jarabe import config
 
+POWERD_FLAG_DIR = '/etc/powerd/flags'
 
 _logger = logging.getLogger('ControlPanel')
 
@@ -129,7 +130,7 @@ class ControlPanel(gtk.Window):
                                    self.__search_changed_cb)
 
     def _setup_options(self):
-        if not os.path.exists('/ofw'):
+        if not os.access(POWERD_FLAG_DIR, os.W_OK):
             del self._options['power']
 
         try:

Changed 2 years ago by erikos

Finally, the mail appeared as well. I had something wrong in my git config :/

patch under review: http://lists.sugarlabs.org/archive/sugar-devel/2011-November/034523.html

Changed 2 years ago by erikos

  • next_action changed from review to package

Changed 2 years ago by erikos

  • next_action changed from package to add to build

I have uploaded a patched rpm, only containing the fix layed out in this ticket.

sugar-0.94.1-2.fc14.olpc.noarch.rpm sugar-0.94.1-2.fc14.olpc.src.rpm

Has been tested on the xo-1 and xo-1.75.

Changed 2 years ago by martin.langhoff

  • next_action changed from add to build to test in build

Test in build OS16 and onwards.

Changed 2 years ago by tabitha

  • status changed from new to closed
  • resolution set to fixed

Tested on OS16 and the power icon is back.

Note: See TracTickets for help on using tickets.