Plan 9 from Bell Labs’s /usr/web/sources/contrib/yk/dist/9legacy/applied/flashfs-port.diff

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/sys/src/9/port/devflash.c (used on SheevaPlug)

-> on /dev/flash/partctl, the second word of the
   second line is the size of the partition

/sys/src/9/bitsy/devflash.c (iPaq)

-> on /dev/flash/partctl, the second word of the
   second line is the end offset of the partition

Default aux/flashfs handles iPaq, but not port (SheevaPlug).

--- /n/sources/plan9/sys/src/cmd/aux/flashfs/devfs.c	Fri May 9 18:23:15 2008
+++ /sys/src/cmd/aux/flashfs/devfs.c	Sat Apr  9 00:00:00 2011
@@ -61,8 +61,8 @@
 		n = tokenize(buf, fld, nelem(fld));
 		if(n < 7)
 			sysfatal("bad flash geometry");
-		nsects = atoi(fld[5]);
 		sectsize = atoi(fld[6]);
+		nsects = (atoi(fld[5])-atoi(fld[4]))/sectsize;
 		if(nsects < 8)
 			sysfatal("unreasonable value for nsects: %lud", nsects);
 		if(sectsize < 512)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].