[PATCH][PPC32] mktree fix

Andre' Draszik andid at gmx.net
Mon Feb 7 15:34:36 EST 2005


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 at 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);



More information about the Linuxppc-embedded mailing list