AW: [PATCH 4/4] X86: pxeboot: bugfix: Set variable for size of initrd

Mittelstaedt Thomas (XC-CT/EBV3) Thomas.Mittelstaedt at de.bosch.com
Tue May 2 15:02:04 CEST 2023


> -----Ursprüngliche Nachricht-----
> Von: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Gesendet: Dienstag, 2. Mai 2023 12:15
> An: Mittelstaedt Thomas (XC-CT/EBV3) <thomas.mittelstaedt at bosch.com>; u-
> boot at lists.denx.de
> Cc: Simon Glass <sjg at chromium.org>; Niel Armstrong
> <neil.armstrong at linaro.org>; Patrick Delaunay <patrick.delaunay at foss.st.com>;
> Ramon Fried <rfried.dev at gmail.com>; Marek Vasut <marex at denx.de>; Manuel
> Traut <manuel.traut at mt.com>; Bin Meng <bmeng.cn at gmail.com>
> Betreff: Re: [PATCH 4/4] X86: pxeboot: bugfix: Set variable for size of initrd
> 
> On 5/2/23 11:49, thomas.mittelstaedt at bosch.com wrote:
> > From: mtt2hi <thomas.mittelstaedt at 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.mittelstaedt at 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);



More information about the U-Boot mailing list