[U-Boot] Linking script image into u-boot

Is it possible to create a script, convert it to an image, and then link that image into u-boot? The goal of which would be to have a script that could be executed without having to download it. I have searched the manual and the mailing list and the source code, but don't see an obvious way to do this.
As an alternative, I could convert the bytes in the image file to an initialized char array in a .c file. That .c file could then be compiled and linked with u-boot. I assume that at runtime I could use the source command with the address of the char array as an argument to run the script.
Suggestions?

On Fri, Jun 4, 2010 at 10:32 AM, Mark Fanara mark.fanara@gmail.com wrote:
Is it possible to create a script, convert it to an image, and then link that image into u-boot? The goal of which would be to have a script that could be executed without having to download it. I have searched the manual and the mailing list and the source code, but don't see an obvious way to do this.
As an alternative, I could convert the bytes in the image file to an initialized char array in a .c file. That .c file could then be compiled and linked with u-boot. I assume that at runtime I could use the source command with the address of the char array as an argument to run the script.
Suggestions?
If you're willing to change the build by introducing a new C file maybe using the CONFIG_EXTRA_ENV_SETTINGS define in your *_config.h works for you? Does it have to be a script that isn't in an environment variable?

CONFIG_EXTRA_ENV_SETTINGS would work fine for me. Thanks
On Fri, Jun 4, 2010 at 9:58 AM, Ben Gardiner bengardiner@nanometrics.ca wrote:
On Fri, Jun 4, 2010 at 10:32 AM, Mark Fanara mark.fanara@gmail.com wrote:
Is it possible to create a script, convert it to an image, and then link that image into u-boot? The goal of which would be to have a script that could be executed without having to download it. I have searched the manual and the mailing list and the source code, but don't see an obvious way to do this.
As an alternative, I could convert the bytes in the image file to an initialized char array in a .c file. That .c file could then be compiled and linked with u-boot. I assume that at runtime I could use the source command with the address of the char array as an argument to run the script.
Suggestions?
If you're willing to change the build by introducing a new C file maybe using the CONFIG_EXTRA_ENV_SETTINGS define in your *_config.h works for you? Does it have to be a script that isn't in an environment variable?
-- Ben Gardiner Nanometrics Inc. +1 (613) 592-6776 x239 http://www.nanometrics.ca

Dear Mark Fanara,
In message AANLkTinoltaKvYMrmEcgTlPSSizwYnuTTnPWfs7NUD2O@mail.gmail.com you wrote:
Is it possible to create a script, convert it to an image, and then link that image into u-boot? The goal of which would be to have a script that could be executed without having to download it. I have searched the manual and the mailing list and the source code, but don't see an obvious way to do this.
This is possible.
As an alternative, I could convert the bytes in the image file to an initialized char array in a .c file. That .c file could then be compiled and linked with u-boot. I assume that at runtime I could use the source command with the address of the char array as an argument to run the script.
This is possible, too.
But why do you consider such complicated approaches when you can simply concatenate the images (eventually with a little padding so they remain aligned to sector boundaries)? Standard tools like "cat" and "dd" are your friends...
Best regards,
Wolfgang Denk
participants (3)
-
Ben Gardiner
-
Mark Fanara
-
Wolfgang Denk