[openfirmware] [commit] r1738 - in ofw: disklabel fs/cdfs

repository service svn at openfirmware.info
Sat Feb 13 06:50:43 CET 2010


Author: wmb
Date: Sat Feb 13 06:50:43 2010
New Revision: 1738
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1738

Log:
disk-label package - support unpartitioned disk layout where an ext2/3 filesystem occupies the entire device.

Modified:
   ofw/disklabel/common.fth
   ofw/disklabel/methods.fth
   ofw/fs/cdfs/partition.fth

Modified: ofw/disklabel/common.fth
==============================================================================
--- ofw/disklabel/common.fth	Sat Feb 13 06:48:48 2010	(r1737)
+++ ofw/disklabel/common.fth	Sat Feb 13 06:50:43 2010	(r1738)
@@ -17,10 +17,17 @@
 
 0 instance value sector-offset
 
-: read-sector  ( sector# -- )
+\ For ISO-9660 CD-ROMs
+: read-hw-sector  ( sector# -- )
    sector-offset +  /sector um*  " seek" $call-parent  abort" Seek failed"
    sector-buf /sector  " read" $call-parent  /sector <> abort" Read failed"
 ;
+\ For everything else
+: read-sector  ( sector# -- )
+   sector-offset +  h# 200 um*  " seek" $call-parent  abort" Seek failed"
+   sector-buf h# 200  " read" $call-parent  h# 200 <> abort" Read failed"
+;
+
 \ LICENSE_BEGIN
 \ Copyright (c) 2006 FirmWorks
 \ 

Modified: ofw/disklabel/methods.fth
==============================================================================
--- ofw/disklabel/methods.fth	Sat Feb 13 06:48:48 2010	(r1737)
+++ ofw/disklabel/methods.fth	Sat Feb 13 06:50:43 2010	(r1738)
@@ -98,6 +98,11 @@
    then
 [then]
 
+   2 read-sector  ext2?  if
+      ext2fs-type to partition-type
+      get-disk-size exit
+   then
+
    \ Nothing we tried worked.
    abort
 ;

Modified: ofw/fs/cdfs/partition.fth
==============================================================================
--- ofw/fs/cdfs/partition.fth	Sat Feb 13 06:48:48 2010	(r1737)
+++ ofw/fs/cdfs/partition.fth	Sat Feb 13 06:50:43 2010	(r1738)
@@ -4,7 +4,7 @@
 \ Returns true if the disk or partition is an ISO 9660 file
 \ system volume, as determined by reading the primary volume descriptor.
 : iso-9660?  ( -- flag )
-   d# 16  ['] read-sector catch  if  drop false exit  then
+   d# 16  ['] read-hw-sector catch  if  drop false exit  then
    sector-buf c@ 1 =  sector-buf 1+ 5 " CD001"  $=  and  dup  if   ( flag )
       iso-type to partition-type
 



More information about the openfirmware mailing list