Multiplex said:
What features does the PND format as it stands provide for this usage that would make it beneficial to extend it rather than creating something more suited from scratch or from other established package formats? I don't see any technical relation to the original purpose.
The reason to do this is that the PND format always has to stay "portable"; if I remove a PND at any time or remove any disk at any time, the PND system should not fail (by making a package database corrupt, as would happen with APT or RPM, etc). Sure, programs that are using the PND's files may fail, but that's impossible to prevent. The goal is to keep the "drop PND in folder to install, delete PND to uninstall" principle while still having the same featues as conventional packaging systems.
Multiplex said:
Slight point, but I don't think the exact size of the file matters much up until you hit the block size.
True, but the write is still small compared to the multi-megabytes that would be required if you'd want to distribute whatever you want to distribute using IPKG instead (because IPKG can only install stuff to the NAND for obvious reasons). Also, NAND won't be a holy place of core files; writes will happen to it whether you like it or not. Your /home and /var/log resides there, for instance.
Multiplex said:
What happens when two different PND files both include the same library version? (The files could still be different, depending on compiler options, etc.) It just randomly chooses one? Or I can't run GIMP and Firefox at once? (memory jokes aside.)
Is each application actually getting its own /lib/ in some way I'm not quite grasping? Because otherwise you could also do the injection simply by including a newer version of a library and hoping some other application jumps on it, right?
Remember that the Pandora distribution will have a set of libraries that already are present in the core distribution, so the need to include your own libraries should be minimial. Also, the preferred modus operandi is to statically link your application with whatever library you're using, further reducing the need for dynamic library inclusion. Those two facts should leave only application-specific libraries (for your game or similar) or libraries that are obviously provided by the package you hav. For example, if you distribute KDE as a PND, it's kinda obvious that it'll include libkdeui.so and no other package should provide that library unless there are multiple PNDs with KDE inside of them, in which case you won't use them simultaneously anyways. So, the rule will be that when a file already exists for a PND (either as a sane symlink or actual file), the PND may not be mounted at all.
Multiplex said:
At that point, aren't you using more resident memory than you'd do by just keeping everything in RAM, especially if that's your only ext2 mount? Or was the main purpose the caching? The symlinks are useless before the relevant PND has been mounted, as I understand them.
I'm talking about the situation where the overlay is being stored on an SD-card, and that card uses a FAT32 system. I really don't know why you would do that in the first place; I was just answering the question
Yes, keeping it all in RAM using a RAMdisk with some lightweight FS on it would be preferred, because symlink creation is cheap and only needs to be done when a PND is moutned, as you say.
@Cairne Oh, I never thought about using the PND overlays as the "bottom" of the UnionFS! Things would indeed be very easy if we did it that way. However, I cannot agree with you on your FS stack. This is my alternative (non-final, objectionable) solution to the problem:
1. Have a folder either in a RAMdisk or on an SD card in which you dump all the symlinks from /overlay in all PNDs (resolving the symlinks to point to the correct paths, of course)
2. Make an UnionFS with that folder as the *base* and the root file system as the *overlay*. When you write to the root FS, writes will go to NAND, but when you try to read a file that doesn't exist on NAND but does exist in the symlink folder, the symlinked file will be read.
3. SD cards are mounted in /media without modification; they are unaffected by the whole system.