linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][PPC32] mktree fix
@ 2005-02-07  4:34 Andre' Draszik
  2005-02-08 22:33 ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Andre' Draszik @ 2005-02-07  4:34 UTC (permalink / raw)
  To: linuxppc-embedded

This one fixes mktree. The image size stored in the header is pretty off without
this patch. (yes, it can make a difference of upto almost 64k)

Signed-off-by: Andre' Draszik <andid@gmx.net>

diff -urN linuxppc-2.5.orig/arch/ppc/boot/utils/mktree.c linuxppc-2.5/arch/ppc/boot/utils/mktree.c
--- linuxppc-2.5.orig/arch/ppc/boot/utils/mktree.c	2005-02-03 20:20:39.000000000 +0100
+++ linuxppc-2.5/arch/ppc/boot/utils/mktree.c	2005-02-06 03:13:27.000000000 +0100
@@ -113,7 +113,8 @@
  		exit(4);
  	}

-	nblks -= (64 * 1024) / IMGBLK;
+	nblks -= (64 * 1024 - sizeof (bt)) / IMGBLK;
+	bt.bb_num_512blocks = htonl(nblks + 1);

  	/* And away we go......
  	*/
@@ -122,7 +123,7 @@
  		exit(5);
  	}

-	while (nblks-- > 0) {
+	while (--nblks > 0) {
  		if (read(in_fd, tmpbuf, IMGBLK) < 0) {
  			perror("zImage read");
  			exit(5);

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

end of thread, other threads:[~2005-02-11 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-07  4:34 [PATCH][PPC32] mktree fix Andre' Draszik
2005-02-08 22:33 ` Tom Rini
2005-02-11  8:37   ` Andre' Draszik
2005-02-11 15:20     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).