All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] autoscript?
@ 2002-11-29 10:32 Steven Scholz
  2002-11-29 11:14 ` Wolfgang Denk
  2002-12-02 13:27 ` Kyle Harris
  0 siblings, 2 replies; 8+ messages in thread
From: Steven Scholz @ 2002-11-29 10:32 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 10:32 [U-Boot-Users] autoscript? Steven Scholz
@ 2002-11-29 11:14 ` Wolfgang Denk
  2002-11-29 11:24   ` Steven Scholz
  2002-11-29 12:24   ` Steven Scholz
  2002-12-02 13:27 ` Kyle Harris
  1 sibling, 2 replies; 8+ messages in thread
From: Wolfgang Denk @ 2002-11-29 11:14 UTC (permalink / raw)
  To: u-boot

Hi Steven,

in message <3DE74228.89AF6ED3@imc-berlin.de> 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.

> 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

-- 
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 11:14 ` Wolfgang Denk
@ 2002-11-29 11:24   ` Steven Scholz
  2002-11-29 11:34     ` Wolfgang Denk
  2002-11-29 12:24   ` Steven Scholz
  1 sibling, 1 reply; 8+ messages in thread
From: Steven Scholz @ 2002-11-29 11:24 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

thanks for your fast reply.

> 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...

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 11:24   ` Steven Scholz
@ 2002-11-29 11:34     ` Wolfgang Denk
  2002-11-29 11:41       ` Steven Scholz
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2002-11-29 11:34 UTC (permalink / raw)
  To: u-boot

In message <3DE74E8B.B8B12592@imc-berlin.de> you wrote:
> 
> > 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.

> 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.

> 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 ;-)

> 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

-- 
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 11:34     ` Wolfgang Denk
@ 2002-11-29 11:41       ` Steven Scholz
  0 siblings, 0 replies; 8+ messages in thread
From: Steven Scholz @ 2002-11-29 11:41 UTC (permalink / raw)
  To: u-boot


Wolfgang Denk wrote:
> 
> In message <3DE74E8B.B8B12592@imc-berlin.de> you wrote:
> >
> > > 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.
> 
> > 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.

Oh! I can see clearly now ... :o) Thanks!

> 
> > 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 ;-)
> 
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 11:14 ` Wolfgang Denk
  2002-11-29 11:24   ` Steven Scholz
@ 2002-11-29 12:24   ` Steven Scholz
  2002-11-29 16:41     ` Wolfgang Denk
  1 sibling, 1 reply; 8+ messages in thread
From: Steven Scholz @ 2002-11-29 12:24 UTC (permalink / raw)
  To: u-boot

Wolfgang,

> 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.
> 
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 12:24   ` Steven Scholz
@ 2002-11-29 16:41     ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2002-11-29 16:41 UTC (permalink / raw)
  To: u-boot

Dear Steven,

in message <3DE75C6F.AB6CF6DF@imc-berlin.de> you wrote:
> 
> 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?

Yes. It has always been an excellent idea NOT to destroy any data you
want to access later ;-)

Best regards,

Wolfgang Denk

-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] autoscript?
  2002-11-29 10:32 [U-Boot-Users] autoscript? Steven Scholz
  2002-11-29 11:14 ` Wolfgang Denk
@ 2002-12-02 13:27 ` Kyle Harris
  1 sibling, 0 replies; 8+ messages in thread
From: Kyle Harris @ 2002-12-02 13:27 UTC (permalink / raw)
  To: u-boot

On Friday 29 November 2002 05:32 am, Steven Scholz wrote:

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-12-02 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-29 10:32 [U-Boot-Users] autoscript? Steven Scholz
2002-11-29 11:14 ` Wolfgang Denk
2002-11-29 11:24   ` Steven Scholz
2002-11-29 11:34     ` Wolfgang Denk
2002-11-29 11:41       ` Steven Scholz
2002-11-29 12:24   ` Steven Scholz
2002-11-29 16:41     ` Wolfgang Denk
2002-12-02 13:27 ` Kyle Harris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.