'bootz' command fails to load the zImage's header
PATCH 1/1 'bootz' command fails to load the zImage's header
Running the 'bootz' command always fails with
could not read <some file>
due to it loads only a size of a pointer, instead of the size of the expected header structure.
arch/arm/lib/bootz.c +1 -1
@@ -53,7 +53,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])if (!usemap) { header = &__header; - ret =read (fd, header,sizeof (header)); + ret =read (fd, header,sizeof (*header));if (ret <sizeof (*header)) {printf ("could not read %s\n" , argv[1 ]); goto err_out;
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 6 lines · Juergen Beisert
Running the 'bootz' command always fails with
could not read <some file>
due to it loads only a size of a pointer, instead of the size of the expected header structure.
Applied to master instead which also has this bug. Unfortunately this bug is also in the october release.
Sascha
Quoted 26 lines
Signed-off-by Juergen Beisert <[email protected]>arch/arm/lib/bootz.c +1
-1@@ -53,7 +53,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])if (!usemap) { header = &__header; - ret =read (fd, header,sizeof (header)); + ret =read (fd, header,sizeof (*header));if (ret <sizeof (*header)) {printf ("could not read %s\n" , argv[1 ]); goto err_out;Signature · 8 lines
-- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 Really fix the 'bootz' command
Running the 'bootz' command always fails with
could not read <some file>
due to wrong usage of pointers and structures. This is the second try to fix the 'bootz' command. At least on my target it is now be able again to load a kernel without any error.
arch/arm/lib/bootz.c +3 -3
@@ -89,10 +89,10 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) } } -memcpy (zimage, &header,sizeof (header)); +memcpy (zimage, header,sizeof (*header)); - ret =read (fd, zimage +sizeof (header), end -sizeof (header)); -if (ret < end -sizeof (header)) { + ret =read (fd, zimage +sizeof (*header), end -sizeof (*header)); +if (ret < end -sizeof (*header)) {printf ("could not read %s\n" , argv[1 ]); goto err_out1; }
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox