Hi Heinrich, On Sat, 8 Mar 2025 at 05:11, Heinrich Schuchardt <[email protected]> wrote: > > On 3/6/25 01:25, Simon Glass wrote: > > The address of the bzImage is not recorded in the bootflow, so we cannot > > actually locate the version at present. Handle this case, to avoid > > showing invalid data. > > > > Signed-off-by: Simon Glass <[email protected]> > > --- > > > > (no changes since v1) > > > > arch/x86/lib/zimage.c | 13 ++++++++----- > > cmd/bootflow.c | 2 ++ > > 2 files changed, 10 insertions(+), 5 deletions(-) > > > > diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c > > index 7f4b117b403..d71285e71d9 100644 > > --- a/arch/x86/lib/zimage.c > > +++ b/arch/x86/lib/zimage.c > > @@ -558,7 +558,6 @@ void zimage_dump(struct bootm_info *bmi, struct > > boot_params *base_ptr, > > bool show_cmdline) > > { > > struct setup_header *hdr; > > - const char *version; > > int i; > > > > printf("Setup located at %p:\n\n", base_ptr); > > @@ -595,10 +594,14 @@ void zimage_dump(struct bootm_info *bmi, struct > > boot_params *base_ptr, > > print_num("Real mode switch", hdr->realmode_swtch); > > print_num("Start sys seg", hdr->start_sys_seg); > > print_num("Kernel version", hdr->kernel_version); > > - version = zimage_get_kernel_version(base_ptr, > > - (void *)bmi->bzimage_addr); > > - if (version) > > - printf(" @%p: %s\n", version, version); > > + if (bmi->bzimage_addr) { > > + const char *version; > > + > > + version = zimage_get_kernel_version(base_ptr, > > + (void > > *)bmi->bzimage_addr); > > + if (version) > > + printf(" @%p: %s\n", version, version); > > I cannot image that a user cares about the location of the version > string in memory. > > If this is an information is really needed by developers, please, put it > into a log_debug() message.
Sometimes the cmdline doesn't work properly, e.g. with ChromeOS images. So I want to show the address so that people can use 'md' to figure out what is going on. Regards, Simon

