A common use of mkelfImage has been to put a bootable ELF image in /tftpboot. In that scenario someone may be downloading the image when you are updating it. Therefore to correctly update the file, you must first write to a new filename and then move it to the new filename. Which gives you atomic update permissions.
Ah... Thanks for the clarification.
The goal was to catch issues where people did not do that.
That is exactly what was caught here.
Not quite. This was just for a normal fallback build for the in-flash kernel using a payload directive in the config file.
If the problem was one where what you are updating needs to be writable I would agree that it is not a build script issue. However since you don't need write permissions and are just stomping on the file we are doing the wrong thing in the build.
Stefan. I think Eric's right and the build script needs the tweak regardless of the output of mkelfimage. If the users umask is set restrictive then the same problem would occur. I noticed in the makefile that there are a few other cp's that probably need to be cp -f as well.
Ok to commit?