Ian,Hi,
I think what Persian Prince has done is exactly what we needed. It is some code and some results that we can see, explore and react to. As can be seen, some appropriate reaction and discussion has begun. The results of these discussion can be used to improve or amend the proposal or highlight that a different approach may be needed.
My initial reaction is to ask if we can please not use spaces in the proc file names. These tend to be mishandled by many coders. Then I would like to suggest that each of the file names have a standardised name, like an API entry point name. This name should be common and agreed upon by all images. This is along the lines of the textural API descriptions that XRayhTec and I tried to inject into the discussions earlier. The files can then contain the results of the API call as appropriate. If the file is read only then the content is immutable otherwise the content can be updated as required.
The file content can then be text or binary as required by the nature of the data. The coder simply needs to open the file and read the content and use it as appropriate (hopefully documented).
So, using Persian Prince's example above, there could be a "/proc/distro/imagetype" file that, when read, will return content in the form of a string from one of the documented options "develop", "rc", "beta", "private" or "stable". Given this is information about the build running this file would be read only and the content immutable.
I think there should also be consideration given to the way the data is captured. In this example the data is a word in lower case. I would like to propose that the data may be better stored in a case sensitive way so that the string retrieved can be immediately used for display to a user without further processing. For example I can see that the "imagetype" data may well be used on an About screen so having the string saved as "Develop" or "Stable" etc may be more visually pleasant. If required for processing the case can be changed for programmatic use. This will become more significant for values like the image name where images have preferred case presentations like "openATV", "OpenPLi", "OpenVision" and "OpenViX" etc. Similarly the hardware names, model names and other information for which the case can improve presentation can be stored appropriately. These can be saved and presented in their display ready form but easily converted to lower or upper case for computational purposes. Trying to use code to make these strings display ready will take more processing power to perform the transmutations and the formatting rules will be so complex it will not be worth the effort. A little care an attention to the data when it is initially created can make the quality of this system significantly better and more efficient later.
What do people think?
Regards,
Ian.
I'm against spaces in proc files like in model names but what about ubi parameters or similars?
Also using mixed case isn't good in my opinion especially when it comes to distro detection something that if you lose it you went to oblivion.
But we can have
/proc/distro/specific/friendlydistroname
/proc/distro/specific/friendlymodelname
As I said endless possibilities
At last I'm glad you're better and glad you like what I propose.
Regards,
Persian Prince