
In message 4769258D.6090709@semihalf.com you wrote:
The hooks idea sounds reasonable but, the problem is that there isn't really any such thing like "main fromat processing code".
The 'bootm' command code does a lot of image related manipulation but it's not generic or main format processing code. It is rather a specialized
But it's *the* generic command for booting a Linux kernel.
command that handles one thing, starting executables, like kernels or standalone applications. And it's a command, it will not do anything unless directly called.
Correct.
So, having hooks in bootm, you would need to call bootm and then your 'qe fw' command which is sort of wired.
MY current understandign is, that when running "bootm", the bootm command would detect if there are registred hook routines for any of the contained sub-images, and run that code automagically.
There are also other commands that deal with the images, these are other boot commands like scsiboot, usbboot, etc, and also imls, imxtract.
scsiboot, usbboot etc. are just means to load an image into RAM, similar to tftpboot or dhcpboot. If they also boot the loaded image (because autostart is set to yes), then they do so by calling bootm internally. So everything is fine.
imls would probably have it's ownset of image type hooks - while you would register some "boot me" type of handlers with bootm, you would register some "display me" type of handlers with imls.
imxtract will have to be changed completely in any case.
And all of them process images directly, finding necessary information on their own.
This is no argument for not creating some more centralized image processing code, or is it?
Best regards,
Wolfgang Denk