Attached patch is my take on this.
Looks good, I guess.
So, the things that are missing:
- build system change (a script?) to generate bin_compat.h from stubs_entry.S, camera_list.csv
My thought was
sig finder outputs the PID address, version string address and version string for the "current" cameras. These are mostly there already, could just output comments in a format suitable for pasting into bin_compat.h
The default bin_compat.h just uses these default entries.
Any cross compatible cameras are added to bin_compat.h manually. For future ports, this shouldn't be a big deal, when you add the "as copy" to the camera list, you need to add it to bin_compat.h
- identify equivalent P-IDs if needed (btw. does ps.fi2 of the 'other' camera even work on these 'equivalent' models?)
No, they don't, that's one of the main reason we have builds for e.g. both sx240 and sx260.
In fact, I'm not sure cross- PID compatibility is something we really need to support in builds with the check enabled. Since we don't know in advance which are compatible, people who want to try would need a special build with the check disabled anyway. Once we know, it works, the platform will become a separate build.
For which models should this check be introduced? All DryOS cams, or only for selected models?
Good question. If we follow the scheme above, adding all the ones that don't have copied firmwares should be safe and fairly easy to automate. For the rest, it's more complicated because we don't necessarily have dumps of the compatible firmwares. Is it possible the version string could move if all the functions were compatible?