[Sugar-devel] [Dextrose] activities on SD card, XO 1.0

Bernie Innocenti bernie at sugarlabs.org
Mon May 14 20:49:53 EDT 2012


[cc += sugar-devel]

On Mon, 2012-05-14 at 12:47 +0200, Dominik Granada wrote:
> 
> Our problem is that this feature does not work with Dex2. SD card is
> not being mounted on startup. Once the system is on it is enough to
> take it out/in and it starts to work. Yet for kids at school we would
> need that automatic at start up.
>  
> I would appreciate any hints...

If all you need the SD for is adding extra activities, there might be an
easier way: modify Sugar to add an extra lookup path for activities.

The system directory for activities is hard-coded by configure into the
variable "activities_path" of src/jarabe/config.py. In the rpm package
of Sugar, this ends up in

 /usr/lib/python2.7/site-packages/jarabe/config.py

If you're feeling a little braver, you could change bundleregistry.py to
support a colon-separated list of paths:

--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -61,7 +61,7 @@ class BundleRegistry(gobject.GObject):
         self._gio_monitors = []
 
         user_path = env.get_user_activities_path()
-        for activity_dir in [user_path, config.activities_path]:
+        for activity_dir in [user_path, config.activities_path.split(':')]:
             self._scan_directory(activity_dir)
             directory = gio.File(activity_dir)
             monitor = directory.monitor_directory()

Proper support for activities on removable media would involve finding
the callback where Sugar handles hotplug events for storage media and,
if the filesystem contains a directory called Activities, add it
dynamically to BundleRegistry.

-- 
Bernie Innocenti
Sugar Labs Infrastructure Team
http://wiki.sugarlabs.org/go/Infrastructure_Team





More information about the Sugar-devel mailing list