Tiny Core Linux

General TC => Tiny Core Netbooks => Topic started by: roystonlodge on October 18, 2009, 06:27:04 PM

Title: OLPC XO
Post by: roystonlodge on October 18, 2009, 06:27:04 PM
I was just wondering if anyone has tried tinkering with TinyCore on the OLPC XO.

I just got an XO offa eBay, and I'm trying to decide how to run it.  The easiest option is to stick with the preinstalled Fedora (since it's customized for the XO's hardware) and just change the desktop environment.  There's also a Debian for XO, and a couple of other options.

With only 256MB of RAM and only 1GB of storage, TinyCore could be a nice fit.
Title: Re: OLPC XO
Post by: bmarkus on February 21, 2010, 10:35:03 PM
There is Now ;D
Builds and sources are [removed: remaster]

BTW I'm trying to get a battery monitor for the XO and since apci is not working the available extension (watcher, flitk) do not work.
I was wondering if there is something similar to xfce GenMon made with fltk where the output of a command or script is shown. Battery scripts from other builds work fine under TinyCore but there is no way to display them.
I do not want to install XFCE, trying to keep it as simple as possible.
So if anyone knows of one or can build one would be nice.

You may try LXDE. Smaller than Xfce4 and there is a built-in battery monitor panel plugin.
Title: Re: OLPC XO
Post by: mavrothal on February 22, 2010, 01:30:42 AM
You may try LXDE. Smaller than Xfce4 and there is a built-in battery monitor panel plugin.

Yes I could, but my point is that having such a simple thing you can have all kind of info from time. to network, to battery. to available disk space, to ram, to what ever you want, by an array of these things independent of any WM/panel/tray/desktop and with limited resource consumption.

Is such a simple basic and versatile infrastructure, I'm surprised is not available in TC ???

PS: Now that I realized your suggestion ( :D) No linux battery monitor will run with XO's battery that is going through the embedded controller. For the official Sugar build they are using a Python(!...) widget to present the output of /sys/devices/platform/olpc-battery.0/power_supply/olpc-battery/capacity which is actually % charged. So GenMon works grate with this.
Title: Re: OLPC XO
Post by: mavrothal on March 17, 2010, 05:58:15 AM
tc-xo v0.1 is [removed: remaster]
but still without a battery monitor  :(
Title: Re: OLPC XO
Post by: Lerc on March 25, 2010, 03:26:55 PM
but still without a battery monitor  :(

I've got TC up and running on my XO,  I have a battery monitor as part of Plops.  it uses a tiny script to do the actual battery reading so it's an easy mod to make it read the XO battery level.

All-in-all I'm quite pleased with how it's going.  The only downpoint is that there is a delay on launching python (mounting?) which is a pain for scripts that really should be instantaneous launching.

 
Title: Re: OLPC XO
Post by: mavrothal on March 26, 2010, 12:03:55 AM
I've got TC up and running on my XO,  I have a battery monitor as part of Plops.  it uses a tiny script to do the actual battery reading so it's an easy mod to make it read the XO battery level.

So is it actually working on the XO? Plops looks light enough and should be a good match for the XO, if an fltk widget does not come through.


All-in-all I'm quite pleased with how it's going.  The only downpoint is that there is a delay on launching python (mounting?) which is a pain for scripts that really should be instantaneous launching.

Python is a real hog (http://shootout.alioth.debian.org/u32q/performance.php?test=spectralnorm). Quite frankly I think that is the worse thing that happened to Sugar. Is used to implement an excellent idea in the worse possible way, based on FOSS politics and (misconceived) "ease" of development, wrapped in an "educational" cloak. But that's a different story...
Title: Re: OLPC XO
Post by: Juanito on March 26, 2010, 12:25:15 AM
I have a battery monitor as part of Plops.  it uses a tiny script to do the actual battery reading so it's an easy mod to make it read the XO battery level.

Can you use the flit extension for this?
Title: Re: OLPC XO
Post by: mavrothal on March 26, 2010, 12:38:19 AM
I have a battery monitor as part of Plops.  it uses a tiny script to do the actual battery reading so it's an easy mod to make it read the XO battery level.

Can you use the flit extension for this?

None of the TC available battery monitors work on the XO (see above). The worse thing is that even the XFCE extension does NOT include GenMon that could be easily used as battery monitor.

I guess someone could recode flit battery monitor module for the XO. I'm just too novice to do it.
But I would guess the simplest and most versatile thing would be a GenMon like widget that will display the output of a script or a command at predefined time intervals.
 Any fltk-expert willing for that?...
Title: Re: OLPC XO
Post by: Lerc on March 26, 2010, 03:03:36 AM
So is it actually working on the XO? Plops looks light enough and should be a good match for the XO, if an fltk widget does not come through.
Yup,  I wrote Plops with the XO in mind.  It could stand to be a whole lot lighter still, but it's a featherweight compared to the alternatives.  Most of the memory goes in rgba images which at least counts as usefully used memory in my book.

I've got a lot of things going as I had them under Fedora. Plops, PDF reading, Video playing, Doodle. I also got Chromium running which is nice (Remains to be seen if it's too memory hungry though)

Quote
Python is a real hog (http://shootout.alioth.debian.org/u32q/performance.php?test=spectralnorm). Quite frankly I think that is the worse thing that happened to Sugar. Is used to implement an excellent idea in the worse possible way, based on FOSS politics and (misconceived) "ease" of development, wrapped in an "educational" cloak. But that's a different story...
Indeed,  I'm not much of a fan of it either, but I think the delay on launching scripts can be addressed.  The main thing that I need python for is ZeroInstall.  on the Fedora XO, 0launch-ing a program was close enough to instantaneous. on my Tiny Core XO there's a pause of a couple of seconds, which isn't the best, especially for command line programs that you expect to just happen.



   
Title: Re: OLPC XO
Post by: mavrothal on March 26, 2010, 03:18:04 AM
Yup,  I wrote Plops with the XO in mind.  It could stand to be a whole lot lighter still, but it's a featherweight compared to the alternatives.  Most of the memory goes in rgba images which at least counts as usefully used memory in my book.

So is it publicly available? If not could you post it here (assuming that is small enough to fit the attachment limit)

Quote
I think the delay on launching scripts can be addressed.  The main thing that I need python for is ZeroInstall.  on the Fedora XO, 0launch-ing a program was close enough to instantaneous. on my Tiny Core XO there's a pause of a couple of seconds, which isn't the best, especially for command line programs that you expect to just happen.

Is debugging/logging enabled in python? This may take a couple of seconds in launch time.
Title: Re: OLPC XO
Post by: Lerc on March 26, 2010, 04:00:38 AM
So is it publicly available? If not could you post it here (assuming that is small enough to fit the attachment limit)
At http://code.google.com/p/plops/
I think svn is fairly up to date.  Bedtime now, but I'll update the download in the morning.

Quote
Is debugging/logging enabled in python? This may take a couple of seconds in launch time.
I have no idea,  I grabbed the package, it made python run. 
Title: Re: OLPC XO
Post by: mavrothal on March 26, 2010, 08:07:14 AM
So is it publicly available? If not could you post it here (assuming that is small enough to fit the attachment limit)
At http://code.google.com/p/plops/
I think svn is fairly up to date.  Bedtime now, but I'll update the download in the morning.

I edited the /plops/baterry/IM_NOT_A_BATTERY file to point to /sys/devices/platform/olpc-battery.0/power_supply/olpc-battery/capacity but running `./plops battery' it says
"An unhandled exception occured at $08048523 :
EInOutError : Invalid input
$08048523
$080485AB
$08048141 "
`cat /sys/devices/platform/olpc-battery.0/power_supply/olpc-battery/capacity' reports the correct battery full perentage.
What's the setting in your XO?
Title: Re: OLPC XO
Post by: Lerc on March 26, 2010, 03:54:54 PM
`cat /sys/devices/platform/olpc-battery.0/power_supply/olpc-battery/capacity' reports the correct battery full perentage.
What's the setting in your XO?

I just uploaded the more recent build.  http://plops.googlecode.com/files/Plops-0.0.2.tar.gz  It's as a Rox AppDir so just clicking on it in Rox-Filer should run it. Alternately running the AppRun script should do the same thing in other environments.

This version uses a readbattery script for the battery. All the script contains is

#!/bin/bash
cat ChargeLevel_Link

and on my XO I've symlinked ChargeLevel_Link to /sys/class/power-suply/olpc-battery/capacity

I have an EEE701 which doesn't seem to have the number represented in a sane format so on that I have a python script to read it via hal.

Also in this version is a little lua script in the graph directory which works as a cpu monitor.  Just a quickly knocked together thing, but you run
Plops/Widgets/graph/monitor >Plops/Widgets/graph/data and you have a cpu load graph.

This version also bundles wcalc with the calculator.
Title: Re: OLPC XO
Post by: mavrothal on March 26, 2010, 11:35:00 PM
No luck :(
All the widgets work but the battery monitor. Either by Rox-filer or by `./AppRun'
Actually `cat Plops/Widgets/battery/commands' suggests that the widget does not even run.
Running it from within the batery directory by `./battery' you can see the commands issued but no battery monitor and nothing in "results" or "events".
`./readbattery' reports the correct battery level when pointing to /sys/devices/platform/olpc-battery.0/power_supply/olpc-battery/capacity but not when pointing to /sys/class/power-suply/olpc-battery/capacity
There are no errors at any point.
 ???
Do you need any other extensions to run it in TC-XO? Which extensions do you have loaded when you can see that battery monitor on TC-XO desktop? Are you using flwm or an other WM?
Title: Re: OLPC XO
Post by: Lerc on March 27, 2010, 04:03:34 AM
No luck :(
All the widgets work but the battery monitor. Either by Rox-filer or by `./AppRun'
Actually `cat Plops/Widgets/battery/commands' suggests that the widget does not even run.
Ah right,  That'll be because I'm an idiot.

Have a look at the Plops/Launch/ directory
The symlinks in there are the widgets that actually get launched.
The default Launch directory has just the links

 calculator -> ../Widgets/calculator
 clock -> ../Widgets/clock
 graph -> ../Widgets/graph

Add one for the battery and it should launch.
The idea is that people can configure with drag and drop in a file manager,  but it doesn't work if I don't tell anyone about it.
Title: Re: OLPC XO
Post by: mavrothal on March 27, 2010, 05:39:09 AM
OK, I managed :)
One thing is not clear to me. Is the actual path to battery capacity should be in the  ChargeLavel_Link file or in the readbattery script?
Because if in the ChargeLavel_Link  it just reads the path and not the output of the link.
Adding the path in the `readbettery' works just fine.

What should I trim if I just need the battery monitor? 2MB is rather a lot

PS: I did try with with everyway I could imagine to make it autostart through /opt/bootlocal.sh. No luck.  How do you autostart it in TC-XO?
Title: Re: OLPC XO
Post by: jls on March 27, 2010, 10:32:23 AM
calculator doesn't work: click 1+1= and it reports 0
clock "says" 17:30 while date command "says" 18:30
I see am empty rectangular box, what is it?
plops 0.0.2 binary tested in mc 2.10 on a desktop pc
Title: Re: OLPC XO
Post by: jls on March 27, 2010, 10:44:31 AM
I think the box is the cpu graph, but is always empty
Title: Re: OLPC XO
Post by: jls on March 27, 2010, 10:59:21 AM
this is the screenshot
Title: Re: OLPC XO
Post by: Lerc on March 27, 2010, 11:23:16 AM
I think the box is the cpu graph, but is always empty
Actually it's an all purpose graphing widget. the monitor script can be used to make it a cpu graph.  It's empty because nothing is giving it data by default.

Any integers sent to the data pipe will be graphed.
I made a clip showing the widgets in action

This link jumps to the grapher bit. it starts off just by using seq but gets clever at the end.
 http://www.youtube.com/watch?v=0QJ9fTYZuwk&fmt=22#t=4m00s
Title: Re: OLPC XO
Post by: Lerc on March 27, 2010, 11:43:20 AM
calculator doesn't work: click 1+1= and it reports 0
The calculator calls the evaluate script in order to facilitate people plugging in their own evaluation engines.  ( for instance http://forum.tinycorelinux.net/index.php?topic=5561.0 appeals as a start for a lightweight solution)

At a guess I would say there's a dependency for wcalc. libmpfr perhaps?  go to the calculator directory and try ./evaluate 1+1 and see what it does. 

Quote
clock "says" 17:30 while date command "says" 18:30
That'll be a legitimate bug, there's some locale thing that escapes me apparently.  Curiously, it seems to be wrong on about half the computers I try it on.

The example widget in the wiki is the clock  it's a full 60 lines long http://code.google.com/p/plops/wiki/ExampleWidget

See if you can tell where I went wrong.
Title: Re: OLPC XO
Post by: Lerc on March 27, 2010, 12:07:40 PM
OK, I managed :)
One thing is not clear to me. Is the actual path to battery capacity should be in the  ChargeLavel_Link file or in the readbattery script?
Because if in the ChargeLavel_Link  it just reads the path and not the output of the link.
Adding the path in the `readbettery' works just fine.
the readbattery script is all that is required.  The ChargeLevel_Link_link is supposed just to be a convenience link, so you can change the path without editing the script.  If you are comfortable with editing scripts just change readbattery so it outputs the battery level directly. (which it sounds like you did anyway)
Quote

What should I trim if I just need the battery monitor? 2MB is rather a lot
Most of the bulk is in the calculator.  The most recent version includes wcalc because I had issues with readline versions so I just dumped wcalc with he readline it needs into the calculator directory. 

As I linked just before.  http://forum.tinycorelinux.net/index.php?topic=5561.0 is a good starting point for an evaluate script that would do a rough job with fewer dependencies.

Quote
PS: I did try with with everyway I could imagine to make it autostart through /opt/bootlocal.sh. No luck.  How do you autostart it in TC-XO?
I'm using OpenBox with a custom ~/.config/openbox/autostart.sh

The script launches any executables in ~/.config/autostart and /config/autostart/*/AppRun
So I just needed to drop the Plops icon in ~/.config/autostart and tell Rox-Filer to make it a symlink.

I actually call $HOME/.config/openbox/autostart.sh explicitly at the end of  .xsession so it's not really openbox specific anymore. 

I'm close to being able to put up an image of the SD card that I'm booting my XO from. It's feeling quite nice to use.
Title: Re: OLPC XO
Post by: mavrothal on March 28, 2010, 02:23:04 PM
This is driving me crazy...
After the first succeful launch of the battery monitor and reboot quite often I get
Code: [Select]
Launch/battery
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Atom id in failed request:  0x0
  Serial number of failed request:  23
  Current serial number in output stream:  28
Any idea???
Title: Re: OLPC XO
Post by: Lerc on March 28, 2010, 06:57:36 PM
This is driving me crazy...
After the first succeful launch of the battery monitor and reboot quite often I get
Code: [Select]
Launch/battery
X Error of failed request:  BadAtom (invalid Atom parameter)
Any idea???

I can reproduce this,  I put a sleep 5 in my .xsession  because I have a
a line xset +fp $HOME/usr/share/fonts that wasn't working from the script but was from the commandline.  Putting the sleep in there fixed the xset problem,  it seems to also fix the widgets problem.

From that I would guess that the waitforx command earlier in .xsession is perhaps not waiting properly,  The other possibility is that it needs a complimentary waitforwm.  The XO is just pushing the bounds of slowness :-)

So try a wee sleep ahead of the launching the widgets and see what happens.


 
Title: Re: OLPC XO
Post by: mavrothal on March 29, 2010, 02:28:37 AM
I can reproduce this,  I put a sleep 5 in my .xsession  because I have a
a line xset +fp $HOME/usr/share/fonts that wasn't working from the script but was from the commandline. 

The issue is that this is also happening from the command line at times...

I'm trying to make a tcz with just the battery monitor and is very frustrating when the performance is unpredictably spotty... Would be great if you just make one. ;D

An addition you may want to put in Plops is the ability to quit the widgets individually after launching, and not all or nothing.
Another addition you want to make is for the handler to quit if it fails because a) you may and up with a lot of ghost processes running, b) I _think_ that you can not launch 2 instances of the same widget.

Title: Re: OLPC XO
Post by: Lerc on March 31, 2010, 01:41:37 AM
The issue is that this is also happening from the command line at times...

I'm trying to make a tcz with just the battery monitor and is very frustrating when the performance is unpredictably spotty... Would be great if you just make one. ;D

Now the problem with that is I have yet to make a tcz. So I'll be as stuck as you :-)

I must say though, it's not really designed to be a system level installed thing.  It more properly resides in the users home directory.    Also It's a bit heavy for just the one widget.  I focused on keeping the per-widget resources low, the plan is to make plenty (I'm rather tempted to make a winamp-ish widget to drive mpd) of widgets. 

Quote
An addition you may want to put in Plops is the ability to quit the widgets individually after launching, and not all or nothing.
Another addition you want to make is for the handler to quit if it fails because a) you may and up with a lot of ghost processes running, b) I _think_ that you can not launch 2 instances of the same widget.
Yeah, it's a bit rough around the edges.   It works fine running once at boot, which is the usual case but killing and rerunning is prone to get it confused.  I do plan to get to these things, but I have a million and one things to do.

Running multiple instances is as simple as making a new copy of it.  To make a clone of another widget you could have a directory with, a set of Pipes and symlinks to the required files.  I figured, as is the nature of Widgets, people have a tendancy to want customise.  So I decided to have the widget directory hold the entire widget, allowing people to copy, symlink, or provide custom files as they see fit.  The easiest example of this would be a alternative clock widget that has a symlink to the same exe as the default clock, but a different png file for the clock face (plus it's own commands,events & results pipes). 

Title: Re: OLPC XO
Post by: mavrothal on March 31, 2010, 03:35:06 AM
must say though, it's not really designed to be a system level installed thing.  It more properly resides in the users home directory.    Also It's a bit heavy for just the one widget. 
If you remove the core the entire tcz is only 800k which is OK I guess for a battery monitor (if it was working properly ;))

Quote
Yeah, it's a bit rough around the edges.   It works fine running once at boot, which is the usual case but killing and rerunning is prone to get it confused.
The problem I have is, that if I run it "as is" is fine. If I make any modifications (deleting widgets, editing the plops.conf file etc), runs fine but on reboot does not run anymore ???

Quote
I do plan to get to these things, but I have a million and one things to do.
OK we'll have a race! Till I learn how to code a simple GenMon-like in FLTK  (don't worry you'll win easily  ;D)
Title: Re: OLPC XO
Post by: mavrothal on April 21, 2010, 12:52:43 AM
OK we'll have a race! Till I learn how to code a simple GenMon-like in FLTK  (don't worry you'll win easily  ;D)
I win  :P
But I cheated (http://forum.tinycorelinux.net/index.php?topic=2999.msg30956#msg30956)   ;D
Title: Re: OLPC XO
Post by: anika200 on May 20, 2010, 06:04:24 AM
Trying out the 02 build and have run into several problems.  A little back ground, the usb stick was created in Fedora12 and I am no linux expert but I know enough to get by.  Now the problems in order of appearance.

My wireless network could not be found even though I had the proper name in bootlocal.sh.  I am using an Apple airport extreme.  I solved this by adding "any" as the essid.

Next I get the Xauth: time out in locking authority file /home/tc/.Xauthority error.  Long story, turns out the whole /home dir was owned by "500" with group "500"?  Solved this (i quess) by chown -R tc:staff ~

Now on the next boot wireless is working ( i can ping google) and permissions seem fine.  I get to a screen that is suposed to set up xvesa? maybe.  It never accepts any input besides (q) for quit.  I am now at a command prompt.
This is all the further I ever get with this build.  I try startx and get an error 42.273418 hsetroot[1269]: segfault at 88 ip 08049cb4 sp bf9e12a0 error 4 in hsetroot.

I am running of a usb stick formated in ext2.  Hmmm,  what to try next.
Title: Re: OLPC XO
Post by: lucky13 on May 20, 2010, 06:47:15 AM
Trying out the 02 build and have run into several problems.  A little back ground, the usb stick was created in Fedora12 and I am no linux expert but I know enough to get by.  Now the problems in order of appearance.

My wireless network could not be found even though I had the proper name in bootlocal.sh.  I am using an Apple airport extreme.  I solved this by adding "any" as the essid.

Do you really consider that a solution since "any" means it will associate with the first/strongest SSID it can pick up? It's fine as long as you're sure you're connecting, and staying connected, to your own router. There are other ways to associate if your SSID name isn't working for some reason (you could elaborate on what you've named it, if you have spaces and didn't put the name in quotation marks, etc.). Also, using "any" basically precludes use of encryption like WEP (weak) or WPA (stronger, particularly is you use a strong passphrase). That's not "getting by," it's dangerous because it means all your data, cookies, etc., not sent to SSL/TSL-secured pages are in plain text.

Quote
Next I get the Xauth: time out in locking authority file /home/tc/.Xauthority error.  Long story, turns out the whole /home dir was owned by "500" with group "500"?  Solved this (i quess) by chown -R tc:staff ~

Default user numeric ownership in RHEL, Fedora, etc., typically starts at 500.500. If you do ls -aln ~/ in tinycore you'll see why there's a "problem" when mixing disparate permissions based on different distros' defaults; tc is 1000.1000 (or 1001.1001? I don't remember off-hand but I know Debian's starts at 1000.1000).  This can be changed on either side for the sake of consistency to reduce future issues if you're going to continue to use Fedora and TinyCore and if you're going to share data between them (such as using the same /home partition). When/if you do this, make sure you're not duplicating a number already in use on whichever you change.

Quote
Now on the next boot wireless is working ( i can ping google) and permissions seem fine.  I get to a screen that is suposed to set up xvesa? maybe.  It never accepts any input besides (q) for quit.  I am now at a command prompt.
This is all the further I ever get with this build.  I try startx and get an error 42.273418 hsetroot[1269]: segfault at 88 ip 08049cb4 sp bf9e12a0 error 4 in hsetroot.

I am running of a usb stick formated in ext2.  Hmmm,  what to try next.

Did you try setting your video as a bootcode?
Title: Re: OLPC XO
Post by: mavrothal on May 20, 2010, 10:15:52 AM
anika200
make sure that you expand the tarball (tar xvjf) as root.
I just did it again (in Ubuntu) from the posted file and what I get is
Code: [Select]
root@OLPC:/media/TC-XO# ls -l
drwxr-xr-x 2 root root   4096 Apr 21 18:35 boot
drwxr-xr-x 3 root root   4096 Apr 21 18:26 home
drwxrwsr-x 3 root staff  4096 Apr 21 20:56 opt
drwxrwxr-x 3 1001 staff  4096 Apr 21 18:52 tce
Files/folders with "tc" owner in TC show as "1001" in Fedora/Ubuntu

I do not know about the Apple Airport wireless. What is your encryption settings? Is it open or protected network? Only open/WEP is supported w/o WPA-supplicant

You are not suppose to setup VESA or anything. Should boot directly to Xorg desktop.
Have you checked that the download is OK? (md5sum?)

I would recommend to re-download and expand the file as su/sudo at the root of the "TC-XO"-labeled stick. etx2 is OK, but you can try ext3 just in case.

PS: do not use Xarchiver or another GUI utility to expand the .tar.bz2 file. Quite often (more in Fedora than Ubuntu, AFAICT) messes up the permissions
Title: Re: OLPC XO
Post by: ^thehatsrule^ on May 20, 2010, 11:09:30 AM
Please note that specific remaster support, and its related announcements should be directed to their sites (which is now listed under the remaster section).
Title: Re: OLPC XO
Post by: anika200 on May 20, 2010, 01:44:53 PM
I guess I will post something in the remaster section.  See you there