easiest way to automate install of a collection 12+ PDF's onto Sugar on XOs?

6 views
Skip to first unread message

Adam Holt

unread,
Apr 9, 2018, 10:08:22 PM4/9/18
to xsce-devel, Community Support Volunteers -- who help respond to help AT laptop.org, Unleash Kids!, server-devel
Is building an .xol bundle/collection/file (containing all the PDF's) the easiest way?  What's the easiest way to build up an .xol of PDF's if so?

Presumably by then installing the .xol in Sugar -> Terminal Activity as follows?

   sugar-install-bundle /run/media/olpc/<USB DEVICE LABEL>/<BUNDLE.xo>

Or is there much better ways to "permanently" install a large number of PDF's onto Sugar across a large number of XO laptops?  Or should we use Gnome instead of Sugar, if there's a much better way?  Sugar's Browse Activity is preferred (faster, lightweight) but Firefox 26.0 is also installed if absolutely necessary, in case either are needed instead of Sugar's Read Activity.

CLARIF: The job will be done using USB memory sticks, walking from one XO laptop to the next, to install all these PDF's.

CLARIF: We want the PDF's to remain on the XO laptops even after the teacher types in "rm -rf /home/olpc/.sugar" to clean out personal files from Sugar on each laptop, which typically happens at the beginning of each semester.

CLARIF: A Sugar icon within the Sugar wheel would be a bonus, but any other method of finding this content within 3-to-5 clicks from Sugar's Home View can work Ok!

CLARIF: these books need to be on the XO laptops themselves, as servers like IIAB are *not* always present.

Apologies there are serious electrical problems in Haiti where we're working, so it's very tough to fully research this online!

Adam Holt

unread,
Apr 9, 2018, 10:35:31 PM4/9/18
to xsce-devel, Community Support Volunteers -- who help respond to help AT laptop.org, Unleash Kids!, server-devel
On Mon, Apr 9, 2018 at 10:08 PM, Adam Holt <ho...@laptop.org> wrote:
Is building an .xol bundle/collection/file (containing all the PDF's) the easiest way?  What's the easiest way to build up an .xol of PDF's if so?
 
Thanks to Jerry Vonau who replied:

"​If you are looking to have ​the pdfs​​ show up in the ring of activities then creating a .xol is required
​.​
Think you would need to launch the browser to see the content
​...​
see http://wiki.sugarlabs.org/go/Content_bundles.
However the pdfs should be able to be viewable in the browser with file://some/path/test.pdf, check if that works first. You might just be able to have the .xol's index.html contain the file://path as a point to the pdf file.
 Hope that helps.​
"

Presumably by then installing the .xol in Sugar -> Terminal Activity as follows?

   sugar-install-bundle /run/media/olpc/<USB DEVICE LABEL>/<BUNDLE.xo>

Or is there much better ways to "permanently" install a large number of PDF's onto Sugar across a large number of XO laptops?  Or should we use Gnome instead of Sugar, if there's a much better way?  Sugar's Browse Activity is preferred (faster, lightweight) but Firefox 26.0 is also installed if absolutely necessary, in case either are needed instead of Sugar's Read Activity.

CLARIF: The job will be done using USB memory sticks, walking from one XO laptop to the next, to install all these PDF's.

CLARIF: We want the PDF's to remain on the XO laptops even after the teacher types in "rm -rf /home/olpc/.sugar" to clean out personal files from Sugar on each laptop, which typically happens at the beginning of each semester.

CLARIF: A Sugar icon within the Sugar wheel would be a bonus, but any other method of finding this content within 3-to-5 clicks from Sugar's Home View can work Ok!

CLARIF: these books need to be on the XO laptops themselves, as servers like IIAB are *not* always present.

Apologies there are serious electrical problems in Haiti where we're working, so it's very tough to fully research this online!

--
Unsung Heroes of OLPC, interviewed live @ http://unleashkids.org !

Thomas Gilliard

unread,
Apr 9, 2018, 11:00:55 PM4/9/18
to unlea...@googlegroups.com, sandyk...@gmail.com, satel...@gmail.com

%post --nochroot
# Mel's Example starts  (thanks to Mel Chua)
# pull and include sample content
WD=$PWD
CACHE_DIR=$WD/../cache/books
CONTENT_DIR=$INSTALL_ROOT/home/liveuser/Desktop/books
mkdir -p $CACHE_DIR
mkdir -p $CONTENT_DIR
cd $CONTENT_DIR
PDF="$PDF http://people.sugarlabs.org/Tgillard/ReadMeFirst-How-to-build-a-remix.pdf"
PDF="$PDF http://wiki.sugarlabs.org/go/Sugar_Creation_Kit"
PDF="$PDF http://people.sugarlabs.org/sdz/ForwardPages5-6.pdf"
PDF="$PDF http://people.sugarlabs.org/sdz/Sugar_on_a_Stick-3-Creation_Kit-en-US.pdf"
PDF="$PDF http://people.sugarlabs.org/sdz/Sugar_on_a_Stick-3-Customization_Guide-en-US.pdf"
PDF="$PDF http://en.flossmanuals.net/ActivitiesGuideSugar/FM_25Apr10.pdf"
PDF="$PDF http://en.flossmanuals.net/Sugar/FM_Sugar_28Oct08.pdf"
for pdf in $PDF ; do
 remote_file=$(basename $(curl -4 -s -L -w %{url_effective} -I $pdf | tail -1))
 file=$CACHE_DIR/$remote_file
 if [ ! -f $file ] ; then
   curl -s -4 -L $pdf > $file
 fi
 cp -p $file $CONTENT_DIR
done
%end

This is how we used to add .pdf files to sugar
satellit

ref http://wiki.sugarlabs.org/go/Build_Your_Own_Remix_with_Fedora#Examples
---
You received this message because you are subscribed to the Google Groups "Unleash Kids" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tony Anderson

unread,
Apr 9, 2018, 11:54:30 PM4/9/18
to unlea...@googlegroups.com
As Bryan Berry once said: Don't use .xol. It is not implemented and will never be supported.

The XO has very limited storage capacity. Last year, I implemented a 'roomserver'. Essentially this is a usb stick mounted on one XO in range of an ad hoc network. It uses SimpleHTTPServer to serve the content to XOs connected by an ad hoc network. This server works like an 'ls' command showing a list of files in the base directory -e.g. pdfs. If an index.html file is in the main folder, it is shown instead of the list. The url of an XO is shown in the frame. This can be used by other xo on that network using Browse. Enter: http://192.168.1.11:8008 where 8008 is the SimpleHTMLServer port.

Currently Sugar provides /home/olpc/Library as the place to store this kind of document. It would be simple to prepare an index.html page with links to the pdfs. This html would be accessible by the file protocol: file:///home/olpc/Library/index.html. Alternatively the standard homepage for Browse is at /home/olpc/.library-pages so the links could be added to that page.

Once a pdf is shown by Browse it can be downloaded to the Journal. From the Journal it can be resumed either by Read or by Browse. This assumes the pdf is downloaded from a server, not the XO. Otherwise, a second copy is made doubling the storage cost.

A teacher should never 'rm -rf /home/olpc/.sugar'. If the intent is to remove the Journal because of space considerations, 'rm -rf /home/olpc/sugar/datastore' is sufficient. After this command the XO needs to be rebooted to create a new empty datastore.

Note: the current 'Journal is full' message is triggered when the unused space is less than 50MB and has nothing to do with the size of the Journal.
Sadly, Sugar provides no way for the user to determine what should be removed (activities, content in folders such as Library, activity storage ('instance', 'data', 'tmp') or the datastore). Hence the standard technique of reflashing the XO. Another example of our developers with their terabyte Ubuntu machines who have no idea of the realities on the ground.

The easiest and most straightforward approach is to use a bash script: pdf.sh

cp first.pdf /home/olpc/Library
cp second.pdf /home/olpc/Library
cp index.html /home/olpc/Library
poweroff

with the Terminal activity:

cd /run/media/olpc/usbstick
bash pdf.sh

This approach works with a set of usb sticks in factory mode since each XO shuts down allowing the stick to be moved to a waiting XO already booted.

Some typing can be saved by using a bash function:

function cpy(title) {
   cp title /home/olpc/Library
}

with the script:

cpy first.pdf
cpy second.pdf
cpy index.html
poweroff


Tony

Adam Holt

unread,
Apr 10, 2018, 1:51:47 AM4/10/18
to Unleash Kids!, xsce-devel, server-devel, Community Support Volunteers -- who help respond to help AT laptop.org, Devel's in the Details
On Mon, Apr 9, 2018 at 11:54 PM, Tony Anderson <tony_a...@usa.net> wrote:
As Bryan Berry once said: Don't use .xol. It is not implemented and will never be supported.

The XO has very limited storage capacity. Last year, I implemented a 'roomserver'. Essentially this is a usb stick mounted on one XO in range of an ad hoc network. It uses SimpleHTTPServer to serve the content to XOs connected by an ad hoc network. This server works like an 'ls' command showing a list of files in the base directory -e.g. pdfs. If an index.html file is in the main folder, it is shown instead of the list. The url of an XO is shown in the frame. This can be used by other xo on that network using Browse. Enter: http://192.168.1.11:8008 where 8008 is the SimpleHTMLServer port.

Currently Sugar provides /home/olpc/Library as the place to store this kind of document. It would be simple to prepare an index.html page with links to the pdfs. This html would be accessible by the file protocol: file:///home/olpc/Library/index.html. Alternatively the standard homepage for Browse is at /home/olpc/.library-pages so the links could be added to that page.

Once a pdf is shown by Browse it can be downloaded to the Journal. From the Journal it can be resumed either by Read or by Browse. This assumes the pdf is downloaded from a server, not the XO. Otherwise, a second copy is made doubling the storage cost.

A teacher should never 'rm -rf /home/olpc/.sugar'. If the intent is to remove the Journal because of space considerations, 'rm -rf /home/olpc/sugar/datastore' is sufficient. After this command the XO needs to be rebooted to create a new empty datastore.

I assume you mean 'rm -rf /home/olpc/.sugar/default/datastore' ?
Compare http://wiki.laptop.org/go/Imaging/Side_effects mentioned by James Cameron's on Feb 19 @ http://lists.laptop.org/pipermail/devel/2018-February/038999.html

Thanks much Tony: this approach looks very promising.

We'll look at Tom Gilliard's approach too: https://groups.google.com/d/msg/unleashkids/22cKusokstU/UTa49BEiAgAJ

Note: the current 'Journal is full' message is triggered when the unused space is less than 50MB and has nothing to do with the size of the Journal.
Sadly, Sugar provides no way for the user to determine what should be removed (activities, content in folders such as Library, activity storage ('instance', 'data', 'tmp') or the datastore). Hence the standard technique of reflashing the XO. Another example of our developers with their terabyte Ubuntu machines who have no idea of the realities on the ground.

;)

To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Unsung Heroes of OLPC, interviewed live @ http://unleashkids.org !
---
You received this message because you are subscribed to the Google Groups "Unleash Kids" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tony Anderson

unread,
Apr 10, 2018, 2:40:08 AM4/10/18
to unlea...@googlegroups.com
Hi, Adam

Yes: rm -rf /home/olpc/.sugar/default/datastore

James is referring to cloning one XO to another. I have never tried that - always reflash from a released build. In Rwanda, builds must be signed and so
modifications after the first boot. Note: the nick on first boot along with the other items are useless First, at the time the laptop is flashed it has not been assigned to a user and, second, today deployments are sharing laptops between users.

Tony
To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids...@googlegroups.com.

natha...@charter.net

unread,
Apr 10, 2018, 2:53:15 AM4/10/18
to Community Support Volunteers -- who help respond to help AT laptop.org, Unleash Kids!
Just to point out that Tony's approach is used in RACHEL (Static 2016) for placing the xol's in module OLPC.

In my use, the index is in Home/Library/  and the module is OLPC.  Simple structure  -- simple copy from USB to module using Gnome (or cp *.pdf in Terminal/console).  Instance of Browse home set to file:///home/olpc/Library/index.html   .  You might dump the xol's in Library to free some space.

NCR

-----------------------------------------

To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Unsung Heroes of OLPC, interviewed live @ http://unleashkids.org !
---
You received this message because you are subscribed to the Google Groups "Unleash Kids" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unleashkids...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Holt

unread,
Apr 15, 2018, 6:58:14 PM4/15/18
to Unleash Kids!, Devel's in the Details, Community Support Volunteers -- who help respond to help AT laptop.org, server-devel
On Mon, Apr 9, 2018 at 11:54 PM, Tony Anderson <tony_a...@usa.net> wrote:
A teacher should never 'rm -rf /home/olpc/.sugar'. If the intent is to remove the Journal because of space considerations, 'rm -rf /home/olpc/sugar/datastore' is sufficient. After this command the XO needs to be rebooted to create a new empty datastore.

'rm -rf /home/olpc/sugar/datastore' is not sufficient to accomplish the required task (deleting the child's Sugar name).

'rm /home/olpc/.sugar' is the only way we know.  (Unless there's a better approach ?)

Adam Holt

unread,
Apr 15, 2018, 7:07:12 PM4/15/18
to Unleash Kids!, Devel's in the Details, Community Support Volunteers -- who help respond to help AT laptop.org, server-devel
There are many similar suggestions here:
Which of the above are truly important for a teacher to type in at the beginning of the semester, to clean out Sugar on an XO.

Teachers much prefer something very short like "rm -rf /home/olpc/.sugar" (unless there's a better way?)


PS Naturally Gnome is not as easy to clean out, if students have left MP3's and personal files lying around!

natha...@charter.net

unread,
Apr 16, 2018, 2:56:02 PM4/16/18
to Community Support Volunteers -- who help respond to help AT laptop.org, Unleash Kids!, Devels in the Details, server-devel
Adam,

Note that if student files are restricted to Documents directory, the files can be removed in Sugar or Gnome.

Also, if student keeps journal work in a Project, erasing Project erases the entries in Journal.  Project is just organization on journal entries, but erasing project erases underlying Journal entries (to my recollection).  So, keep all work in project John and erase project John. That extends to Documents ??

Is the student name in datastore or elsewhere?  I recollect that when I move an   XO(SD) SD card to a second computer, it picks up the name of the new computer.
Where could it be ?

Nathan Rddle


-----------------------------------------

From: "Adam Holt"
To: "Unleash Kids!", "Devel's in the Details", "Community Support Volunteers -- who help respond to help AT laptop.org", "server-devel"
Cc:
Sent: Sunday April 15 2018 6:07:35PM
Subject: Re: [support-gang] [UKids] easiest way to automate install of a collection 12+ PDF's onto Sugar on XOs?

Tony Anderson

unread,
Apr 16, 2018, 8:02:34 PM4/16/18
to unlea...@googlegroups.com
Hi, Adam

As pointed out previously, the command is 'rm -rf /home/olpc/.sugar/default/datastore'.

I am not sure what the goal is here. if it is to clean an XO for a new user, the easiest solution is to reflash (takes about 5 minutes per machine).
One advantage of reflash is that it makes each machine identical in its software base. Machines with different content can be confusing in a classroom when a student says 'I don't have that' or 'Why don't I get that screen?'.

If you only want to change the nick, that can be done through the control panel. In a bash script, it could be changed via gsetting. Typically our XOs have an external id such as gsm001 which is used for the nick. Since several students use the same XO in a lab setting, each can change the nick as needed for identification (e.g. for the chat activity).

Tony
Reply all
Reply to author
Forward
0 new messages