Nice tutorial, p'titSeb!
Some comments: you're working a lot with explicit absolute paths like /mnt/utmp/Arka/icon.png. That will work, but I think it's better to work with relative paths like ./icon.png, that way you don't need to create a fake /mnt/utmp/Arka directory and so on, but you can just run stuff from whatever directory you put your stuff in. Your method has the advantage that it works on everything that needs a "make install" and a way to set the prefix (even stuff that hard-bakes absolute paths into its binaries), but in most cases it is not needed to do the "make install" and the compiled binary will find its data files if they are in the normal spot in the source tree.
The reason why I don't like those absolute paths is that it makes it harder to unpack a PND and run it directly from whatever directory you put it in. Also if some day the PND execution mechanism changes slightly such that the mount point is different, it will stop working if you put those absolute paths everywhere.
Also you don't need to manually export HOME and those other environment variables, they are set already automatically (except LD_LIBRARY_PATH of course).
Finally, how smart is that copy_libs.sh script? Does it always just copy all libs, or does it try to actually track the dependencies? I would avoid adding any library that is not strictly needed, and I would only include libraries that are already available in the firmware if you really need that specific version to make it work. If the firmware version also works, it's better not to include another version of the library, for three reasons: 1) avoid PND size bloat, 2) avoid redundant RAM usage because of potentially having different copies/versions of the same library in memory simultaneously, and 3) if the firmware some day upgrades to a newer and better version of the library, you'll want your PND to benefit from that.
Hi _wb_. Thank you for your kind comments.
About the absolute path, I do agree that this is heavy artillerie, and clearly not needed here. But, I had so many problem in the past with that, I now do the same process every time, without checking if it's needed or not. I have a few scripts to automatized the "fake pnd" creation and so on, so it doesn't bother me much. But you're right, if the PND system is changed, my PNDs probably won't survive it, and at least the run_script will have to be adapted.
For the HOME and so on, again, it's probably not needed all the time, but many time I redirect HOME inside a home/ subfolder of the appdata. So I do define HOME, PATH, LD_LIBRARY_PATH and other on a systematic way, to limit as much as I can the "oups... PND won't launch, I repackage" incident. I'm a bit paranoid, so I have a tendancies to define as mush things as I can by myself, so I now precisely what is going on. But yes, that also can by optionnal.
The copy_libs.sh is a very very dumb script. I hesitate a lot before puting it in the tutorial. It's just an "ldd" of the file you give it in parameter (it doesn't handled wildcard or --help, very dumb...), and copy all libs that are not from /lib or /usr/lib. So it copy many many libs, with the dependencies. So it can copy useless libs... Well, it's a bit more complicated (about useless). For example, there is a copy of SDL inside code::blocks, with the hack to not freeze when using GLES+WrapMouse. This SDL has been compiled with codeblocks. So it's linked with a more up-to-date version of X11 than the one in the Firmware. So, when you "copy_libs" Arka, you get the SDL from code::blocks (because codeblocks libs come first). With this SDL, you also get X11 from codeblocks, and many libX associates... If you just remove the libX11 (ar the other libX) from the PND but let SDL, you will have some error at run. But if you remove the SDL, the libX11 is safe to remove.
So to have some minimal "copy_libs", I should modify the script to:
1. do "sudo ldconfig" so unmount the codeblocks libs...
2. do the ldd, and try to copy only libs that are "not found", from the lib folder of codeblocks
3. remount the codeblocks, with "sudo ldconfig -f $CDEVROOT/init/ld.so.cfg"
That would probably be a much better way, but I haven't done that yet.
But yes, the copy_libs is dumb, and will bloated the PND with a bit too much lib. I choose to be on the safe side, better too much than not enough. The downside is you don't get benifit from newer release in the Firmware. It's a "console" phylosophie, more than a computer phyolosophie.