Skip to contentSkip to conversation

mktree fix

PATCH In review Andre' Draszik 2 participants 4 messages Feb 7, 2005 – Feb 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mktree fix

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)

arch/ppc/boot/utils/mktree.c +3 -2
diff -urN linuxppc-2.5.orig/arch/ppc/boot/utils/mktree.c linuxppc-2.5/arch/ppc/boot/utils/mktree.c
@@ -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);
#1 lore raw
Quoted 5 lines · Andre' Draszik

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)

With this wrong, what breaks? Thanks.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw
Quoted 10 lines · Tom Rini
Quoted 4 lines · Andre' Draszik

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)

With this wrong, what breaks? Thanks.

I don't think anything breaks but if somebody relies on the image size stored in the header, up to almost 64k bytes of flash could be wasted.

a.

#3 lore raw
Quoted 8 lines · Andre' Draszik
Quoted 7 lines · Tom Rini
Quoted 4 lines · Andre' Draszik

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)

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

With this wrong, what breaks? Thanks.

I don't think anything breaks but if somebody relies on the image size stored in the header, up to almost 64k bytes of flash could be wasted.

OK. I'll push this up once 2.6.12-rc1 opens up.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/