autoscript?
Hi there,
how can a make an u-boot image that contains a kernel _and_ a script?
How is the syntax within the script?
Thanks,
Steven
Hi Steven,
Quoted 2 lines · in message <[email protected]> you wrote:
how can a make an u-boot image that contains a kernel _and_ a script?
Well, _making_ the image is easy. the mkimage tool will happily combine any files you pass to it into one multifile image (MFI).
But _using_ such a MFI is a different issue. So far, PPCBoot understands only one format of MFIs, which consist of a Linux kernel image as the first part and a ramdisk image as the second part. This is being handled buy the "bootm" command.
So far, there is no other support for MFIs.
Quoted 1 line
How is the syntax within the script?
A script is a text file containing commands. The syntax is the same as on the command line interface. Actually this is what happens: the script will be passed to the command line interpreter, line by line.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de The easiest way to figure the cost of living is to take your income and add ten percent.
Hi Wolfgang,
thanks for your fast reply.
Quoted 2 lines
Well, _making_ the image is easy. the mkimage tool will happily combine any files you pass to it into one multifile image (MFI).
I thought I've seen a command line option for "mkimage" saying something about scripts...
Quoted 6 lines
But _using_ such a MFI is a different issue. So far, PPCBoot understands only one format of MFIs, which consist of a Linux kernel image as the first part and a ramdisk image as the second part. This is being handled buy the "bootm" command.
So far, there is no other support for MFIs.
Than how should I understand the following lines from ppcboot/common/cmd_autoscript.c
/*
* autoscript allows a remote host to download a command file and,
* optionally, binary data for automatically updating the target. For
* example, you create a new kernel image and want the user to be
* able to simply download the image and the machine does the rest.
* The kernel image is postprocessed with mkimage, which creates an
* image with a script file prepended. If enabled, autoscript will
* verify the script and contents of the download and execute the
* script portion. This would be responsible for erasing flash,
* copying the new image, and rebooting the machine.
*/
Is this actually a multi step solution?
First download the script, then download the binary data (e.g. kernel image) and then execute the script?
I would like to do something like this:
Normally the board boots from flash (in detail: pImage is stored on a JFFS2 partition, which serves as the root fs as well).
But in the case that no (valid) pImage is found, I would like ppcboot (sorry, still using this) to automagically download a whole pFlashdisk image and burn that to the flash. So I thougth about using an MFI (containing the data and the update script) that gets downloaded...
Steven
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Well, _making_ the image is easy. the mkimage tool will happily combine any files you pass to it into one multifile image (MFI).
I thought I've seen a command line option for "mkimage" saying something about scripts...
Sure. You can build a script image.
But your original question was how to "make an u-boot image that contains a kernel _and_ a script". That would be a MFI, and there is no script support for MFIs.
Quoted 2 lines
Than how should I understand the following lines from
ppcboot/common/cmd_autoscript.c
You can run a script image. This is an image that contains ONLY the script.
Quoted 3 lines
Is this actually a multi step solution?
First download the script, then download the binary data (e.g. kernel image) and then execute the script?
No. But you cannot combine a Linux kernel and a script in a single MFI (yet). Or actually you can, but you canot make any use of such an image ;-)
Quoted 6 lines
Normally the board boots from flash (in detail: pImage is stored on a JFFS2 partition, which serves as the root fs as well).
But in the case that no (valid) pImage is found, I would like ppcboot (sorry, still using this) to automagically download a whole pFlashdisk image and burn that to the flash. So I thougth about using an MFI (containing the data and the update script) that gets downloaded...
Use the update script to download and install the kernel image, then.
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de Old programmers never die, they just branch to a new address.
Quoted 15 lines · Wolfgang Denk
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Well, _making_ the image is easy. the mkimage tool will happily combine any files you pass to it into one multifile image (MFI).
I thought I've seen a command line option for "mkimage" saying something about scripts...
Sure. You can build a script image.
But your original question was how to "make an u-boot image that contains a kernel _and_ a script". That would be a MFI, and there is no script support for MFIs.
Quoted 5 lines
Quoted 2 lines
Than how should I understand the following lines from
ppcboot/common/cmd_autoscript.cYou can run a script image. This is an image that contains ONLY the script.
Oh! I can see clearly now ... :o) Thanks!
Quoted 9 lines
Quoted 4 lines
Is this actually a multi step solution?
First download the script, then download the binary data (e.g. kernel image) and then execute the script?No. But you cannot combine a Linux kernel and a script in a single MFI (yet). Or actually you can, but you canot make any use of such an image ;-)
Quoted 8 lines
Quoted 6 lines
Normally the board boots from flash (in detail: pImage is stored on a JFFS2 partition, which serves as the root fs as well).
But in the case that no (valid) pImage is found, I would like ppcboot (sorry, still using this) to automagically download a whole pFlashdisk image and burn that to the flash. So I thougth about using an MFI (containing the data and the update script) that gets downloaded...Use the update script to download and install the kernel image, then.
That's great! Thanks again!
Steven
Wolfgang,
Quoted 5 lines
But _using_ such a MFI is a different issue. So far, PPCBoot understands only one format of MFIs, which consist of a Linux kernel image as the first part and a ramdisk image as the second part. This is being handled buy the "bootm" command.
Quoted 7 lines
So far, there is no other support for MFIs.
Quoted 1 line
How is the syntax within the script?
A script is a text file containing commands. The syntax is the same as on the command line interface. Actually this is what happens: the script will be passed to the command line interpreter, line by line.
So when I tftpbooted the script to 0x100000 I shouldn't download the data to the same address since this would overwrite the srcipt so ppcboot fails to pass the next line to the command line interpreter!
Is that right?
Steven
Dear Steven,
Quoted 6 lines · in message <[email protected]> you wrote:
So when I tftpbooted the script to
0x100000I shouldn't download the data to the same address since this would overwrite the srcipt so ppcboot fails to pass the next line to the command line interpreter!Is that right?
Yes. It has always been an excellent idea NOT to destroy any data you want to access later ;-)
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de "Data is a lot like humans: It is born. Matures. Gets married to other data, divorced. Gets old. One thing that it doesn't do is die. It has to be killed." - Arthur Miller
Quoted 3 lines · Steven Scholz
Hi there,
how can a make an u-boot image that contains a kernel _and_ a script?
Yes. But, you have to run a 2 pass process to fixup addresses within the autoscript output generated from mkimage. For example, this is a simple autoscript that could be used to update a root fs.
setenv stdout serial
erase 40040000 400fffff
cp 00100134 40040000 24500
The mkimage command would be.
mkimage -T script -n label -C none -d autoscript:rootfs root.auto
When this is combined with the root image with mkimage, the source address (100134) may change, depending on length of autoscript. So, the script has to be updated accordingly and a 2nd and final pass of mkimage must be run. I have bash scripts for doing this automatically for multiple images, if anyone is interested.
HTH, Kyle.