Release C/C++ Development Tools


ptitSeb: That's not completely right.

A PND itself is read-only. That's true. But it's loop-mounted with an overlay (unfortunately I can't recall the name of that mechanism right now) so any changes you do to the mounted-pnd will be saved to the appdata-folder. So as far as I can tell what F_slim is trying to do SHOULD work.

 For example if you use "touch /mnt/utmp/<dir>/<filename>", then that file will be created in the mounted umnt-directory. It will not be stored in the pnd though, but in the appdata-folder. Or if you change rights or ownerships then these changes are not in the pnd, but I THINK will result in copying all changed files to the appdata-folder with their changed parameters. Last example: If you delete a file in /mnt/utmp/<dir>/ then the file will not be deleted in the pnd, but an entry will be stored in the appdata-folder that the next time the pnd will be mounted, this deleted file will not appear in "/mnt/utmp/<dir>".

F_slim: You could try to "cd  /mnt/utmp/cdevtools1000/" and do a "touch f_slim-test.txt" and see if it works. Probably it will not for the same reason that prevents you from installing. also try and show the output of  "ls -ld /mnt/utmp/cdevtools1000/" and "ls -ld /mnt/utmp/cdevtools1000/*".

For me it looks like this, since "lmx" is my username:


$ ls -ld /mnt/utmp/cdevtools1000/
drwxrwxrwx 9 lmx lmx 4096 Dec 24 15:32 /mnt/utmp/cdevtools1000/


Code:
$ ls -ld /mnt/utmp/cdevtools1000/*
-rwxr-xr-x 1 lmx lmx  2341 Sep 28 23:43 /mnt/utmp/cdevtools1000/PXML.xml
-rw-r--r-- 1 lmx lmx   538 Oct 28 13:56 /mnt/utmp/cdevtools1000/Trolltech.conf
-rw-r--r-- 1 lmx lmx 47661 Sep 13 07:16 /mnt/utmp/cdevtools1000/cdevtools.jpg
-rw-r--r-- 1 lmx lmx  4156 Sep 13 07:17 /mnt/utmp/cdevtools1000/cdevtools.png
drwxr-xr-x 3 lmx lmx    55 Sep  6 12:17 /mnt/utmp/cdevtools1000/etc
drwxr-xr-x 2 lmx lmx  4096 Sep 30 18:47 /mnt/utmp/cdevtools1000/init
drwxr-xr-x 2 lmx lmx    26 Sep  5 08:46 /mnt/utmp/cdevtools1000/lib
-rw-r--r-- 1 lmx lmx  7777 Sep 28 23:30 /mnt/utmp/cdevtools1000/readme.txt
-rwxr-xr-x 1 lmx lmx    50 Sep 11 07:23 /mnt/utmp/cdevtools1000/start.sh
drwxr-xr-x 8 lmx lmx  4096 Sep 10 16:39 /mnt/utmp/cdevtools1000/usr


If all these file are owned by "root" instead of your user, then indeed try to copy the pnd to an "linux-native" filesystem and see what it changes.
 
Last edited by a moderator:
Ah. "Union Overlay" is the name of that software-mechanism. Hence the name "umnt".

http://en.wikipedia.org/wiki/UnionFS

Edit: Little correction of myself: I think on the Pandora "aufs" is used, which is also mentioned in the above link. At least "mount" shows "aufs" when you execute it while a pnd is mounted.
 
Last edited by a moderator:
@Lomaxx:

Hum, ok, I'll try some experimentations. I was under the impression that the union thingy was working only on new file, created on nfolder that are not in the PND.

I had some problem, for example, with "winemaker", the component of wine that convert windows project to linux ones. During my testing, it worked ok. I created the PND, and when trying it, winmaker won't start because it cannot write to itself. That can't be a problem of user because I have only one. For it to work, I had to create of folder in appdata (in "runscript.sh" that launch the command line)  and put "winemaker" there. And then it work.

So maybe there is a bug or something in the Union created with PND, but I found that PND are R/O. But I'd love to be proved wrong, as this complexify the creation of PND.
 
Last edited by a moderator:
Interesting reading, the wikipeadia link.

So yes, I agree, it should work as you describe, but I have found it don't.
 
Seems like there's hardly anything out there which doesn't require to install additional packages :wacko:

I want to add SDL_Image, so I got it from the web and untared it on my ext2 formated partition on my SD card.

I change to the directory and do


./configure --prefix=$CDEVROOT/usr
sudo make
which works fine, but


sudo make install
fails with


/usr/bin/install: cannot create regular file `/mnt/utmp/cdevtools1000/usr/lib/libSDL_image-1.2.so.0.8.4': Operation not permitted
So what am I doing wrong?

Does the cdevtools.pnd have to be on an ext2 partition in order for this to work?
Yep - the PND needs to be an ext2 formatted partition for this to work.

Incidentally, it's just 'make' and 'make install', not 'sudo make' and 'sudo make install'.  Please don't type 'sudo' to over-come file-permission errors, as it means you lose essential environment variables, put the PND on a ext2-formated partition instead.

Also, libSDL_image is already included - you don't need to compile it.  If what you were originally trying to compile couldn't find it, it may be because you were using 'sudo' or it may need some help finding it.

if you let me know what project you're working on, I'll see if I can compile it myself and give you more specific help if you need it.
 
I don't know if that the reason why, but yes - full writing into a PND requires the PND to be on a ext2 file system.  With ext2, starting the PND and typing "touch usr/bin/gcc" will work (it will create usr/bin/gcc in appdata), but it will fail if it's on a FAT partition.  This is the reason for the 'init' directory - libc.so is a symlink to init/libc.so because I can write to init/libc6.so but I can't always write to usr/lib/libc6.so 

The PND system is a bit strange when it's on a FAT - you can write to the root directory when the PND is first started, but I've found you can't write to it subsequently.  This is why I create a 'home' directory for my PNDs when they are first run - so I have a directory I can write on subsequent runs.
 
Last edited by a moderator:
Makes sense. I have done the home and init folder trick on all my PND. I tried without but quickly gave up. It is clearer now, thanks for the explanations.
 
You guys got it.. Its an AUFS bug thats always been there.. Work around with a 'home' type subdir you mkdir on first run.. Or another fs type


Jeffphone
 
Last edited by a moderator:
hmmm ... I wonder if some problems I had with other PNDs might be solved if I would put them on an ext2 partition ...

Not sure I understand where (how) you guys create the home directory by the way? Just "mkdir -p /mnt/utmp/home" in the .sh file?

The game I currently try to compile is freesynd, a port for Syndicate. (Im pretty sure if it does compile I'll run into other problems which I can not solve, like touchscreen-issue or screen-resolution ...)

http://sourceforge.net/projects/freesynd/

It uses cmake. Not sure how to tell it where to look for things, CMakeList.txt seems to be what cmake is using, and that seems to have only two options: found it? -> good; didn't find it? -> give error.

I guess it then writes things into CMakeCache.txt?

Interestingly there I find a line which points to libSDL_image.so, but it sais SDLIMAGE_INCLUDE_DIR-NOTFOUND and SDLMAIN_LIBRARY-NOTFOUND ...

For me this is just a great learning experience at the moment. So it doesn't matter that much to me if I really get a working PND out this now. (Eventually I will with something). I already learned quite a lot of things about user rights, file systems, where Linux puts stuff ...  I do my best not to bother you with stupid questions Google can answer for me ;)
 
For cmake, you can try to launch ccmake (with 2 "c"), and it launchs an interactive configure tool... Try to mess with parameters here ;)

For the "home" and things like that, it's all defined in the launch script. Try a genpxml, it will create a default one IIRC.
 
Last edited by a moderator:
YAY, I got it working! Thanks!! :lol:

Working is relative though, I managed to compile it and it runs (achievement unlocked :p ). Can't get it to use fullscreen (it ignores the setting in the .ini file) and it crashes during the first mission ... "std::bad_alloc". I won't try any further, the project is still in Alpha stage anyway. And I'm not ready to get into actual coding/debugging yet ... for now I'll keep looking for something easier and am happy that I already made it this far ^_^
 
hmmm ... I wonder if some problems I had with other PNDs might be solved if I would put them on an ext2 partition ...

Not sure I understand where (how) you guys create the home directory by the way? Just "mkdir -p /mnt/utmp/home" in the .sh file?
Yeah.  A typical start up file would have something like:

pwd=$(pwd)

 

if [ ! -e home ]

then

mkdir home

fi

 

export HOME=$pwd/home

 

The game I currently try to compile is freesynd, a port for Syndicate. (Im pretty sure if it does compile I'll run into other problems which I can not solve, like touchscreen-issue or screen-resolution ...)

http://sourceforge.net/projects/freesynd/

It uses cmake. Not sure how to tell it where to look for things, CMakeList.txt seems to be what cmake is using, and that seems to have only two options: found it? -> good; didn't find it? -> give error.

I guess it then writes things into CMakeCache.txt?

Interestingly there I find a line which points to libSDL_image.so, but it sais SDLIMAGE_INCLUDE_DIR-NOTFOUND and SDLMAIN_LIBRARY-NOTFOUND ...

For me this is just a great learning experience at the moment. So it doesn't matter that much to me if I really get a working PND out this now. (Eventually I will with something). I already learned quite a lot of things about user rights, file systems, where Linux puts stuff ...  I do my best not to bother you with stupid questions Google can answer for me ;)

I see you've already got this sorted, so I'll just leave this here for reference:

Cmake needs some help finding SDL headers and libs, so you need to do:


export SDLDIR=/mnt/utmp/cdevtools1000/usr/include/SDL


before running cmake.  It compiles easily enough after that.  If you're intending to make a PND, you may want to do


cmake -DCMAKE_INSTALL_PREFIX=/mnt/utmp/freesynd .


(-DCMAKE_INSTALL_PREFIX is the cmake equivilant of ./configure --prefix).
 
Last edited by a moderator:
For "automatic" fullscreen, you can also try to switch to Notaz's optimised driver.

On your launch script, do


export SDL_VIDEODRIVER="omapdss"

you can activate VSynch with


export SDL_OMAP_VSYNCH="1"


I prefer speed myself, so I usualy put "0" here.

You can also set the size of the display if it's different from 800x480, but I assume freesynd can handle non 4/3 display... (with export SDL_OMAP_LAYER_SIZE="640x480" for example).

And good work, syndicate is a nice game in my memory...
 
Last edited by a moderator:
It magically worked fullscreen after I tried again now, but the touchscreen loses focus when you move off-screen. Using Notaz's optimized driver as you described works and it also fixes the touchscreen-issue!

Still the problem remains that it crashes when you enounter the first enemy, so this needs a real expert :(
 
it crashes to terminal, where its sais "std::bad_alloc".

I had some warnings during building which I ignored, might be related to it. Don't remember what exactly they were about though.
 
Last edited by a moderator:
Hi, me again :unsure:

What is the best way to get the dependencies right for the PND? I can compile things, but unless I run the cdevtools first (so the libraries are mounted in /mnt/utmp/cdevtools1000/) it is missing several libraries. No surprise there really, because that's how it was compiled ... I guess manually getting the dependencies from the Makefile, then copying them to /mnt/utmp/my-program/lib and changing the paths in the Makefile might work, but I also guess that this would make any experienced Dev laugh or facepalm :p
 
Do a "ldd path/to/your/binary", from within cdevtool command line, and you will have the list of all libs linked. You can see which are from the firmware and which from cdevtool easily...
 
Last edited by a moderator:
Do a "ldd path/to/your/binary", from within cdevtool command line, and you will have the list of all libs linked. You can see which are from the firmware and which from cdevtool easily...
I have a dumb one-liner to do that, to be run from the PND target directory, with cdevtools mounted (or codeblocks, just change the grep string):


for a in `find . -type f -executable | xargs -n 1 ldd | awk -F' ' '/=>/ { print $3 }' | grep cdevtools | sort -u`; do cp $a lib/; done
I guess there are several ways this can easily break or fail to work correctly - use on your own risk.
 
Last edited by a moderator:
Back
Top