> -----Ursprüngliche Nachricht-----
> Von: Heinrich Schuchardt <xypron.g...@gmx.de>
> Gesendet: Dienstag, 2. Mai 2023 12:15
> An: Mittelstaedt Thomas (XC-CT/EBV3) <thomas.mittelsta...@bosch.com>; u-
> b...@lists.denx.de
> Cc: Simon Glass <s...@chromium.org>; Niel Armstrong
> <neil.armstr...@linaro.org>; Patrick Delaunay <patrick.delau...@foss.st.com>;
> Ramon Fried <rfried....@gmail.com>; Marek Vasut <ma...@denx.de>; Manuel
> Traut <manuel.tr...@mt.com>; Bin Meng <bmeng...@gmail.com>
> Betreff: Re: [PATCH 4/4] X86: pxeboot: bugfix: Set variable for size of initrd
> 
> On 5/2/23 11:49, thomas.mittelsta...@bosch.com wrote:
> > From: mtt2hi <thomas.mittelsta...@de.bosch.com>
> >
> > The problem was, that zboot() didn't work because of missing ramdisc
> > size.
> 
> Can we create a test for this?

We could test it, if all would be fine. 
Atm this function seems only to be called by distroboot implementation. And 
this is not activated yet.

But for the first time a code walk trough seems to be more appropriate.

At line 551/552 the initrd is loaded to memory and the size is saved to 
variable size.
My correction at 557 stores a string representing the size to variable 
initrd_filesize
At line 725 initrd_filesize is set to parameters of function zboot().
So it must fail without the correction.

> 
> Best regards
> 
> Heirnich
> 
> >
> > Signed-off-by: mtt2hi <thomas.mittelsta...@de.bosch.com>
> > ---
> >   boot/pxe_utils.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index
> > 3a1e50f2b1..87c32b6e62 100644
> > --- a/boot/pxe_utils.c
> > +++ b/boot/pxe_utils.c
> > @@ -554,7 +554,7 @@ static int label_boot(struct pxe_context *ctx, struct
> pxe_label *label)
> >                            label->name);
> >                     goto cleanup;
> >             }
> > -
> > +           strcpy(initrd_filesize, simple_xtoa(size));
> >             initrd_addr_str = env_get("ramdisk_addr_r");
> >             size = snprintf(initrd_str, sizeof(initrd_str), "%s:%lx",
> >                             initrd_addr_str, size);

Reply via email to