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

repository service svn at openfirmware.info
Wed Jul 18 04:56:18 CEST 2012


Author: quozl
Date: Wed Jul 18 04:56:18 2012
New Revision: 3068
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3068

Log:
disklabel - support ISO 9660 images on non-optical drives such as USB flash and hard drives, by using a logical sector offset to the primary volume descriptor that is consistent with the 512 byte sector size on these devices.  ISO 9660:1999 6.1.2 specifies minimum logical sector size, and an offset of 16 sectors to the primary volume descriptor, but does not specify arrangement of data on devices that are not a CD-ROM.  Common use is to place the image on other devices in the same way it appears on CD-ROM.  #12018

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

Modified: ofw/disklabel/common.fth
==============================================================================
--- ofw/disklabel/common.fth	Mon Jul 16 02:53:10 2012	(r3067)
+++ ofw/disklabel/common.fth	Wed Jul 18 04:56:18 2012	(r3068)
@@ -19,7 +19,7 @@
 
 0 instance value sector-offset
 
-\ For ISO-9660 CD-ROMs
+\ For ISO-9660 CD-ROMs, ISO-9660 flash or hard drives, and GPT
 : read-hw-sector  ( sector# -- )
    sector-offset +  /sector um*  " seek" $call-parent  abort" Seek failed"
    sector-buf /sector  " read" $call-parent  /sector <> abort" Read failed"

Modified: ofw/fs/cdfs/partition.fth
==============================================================================
--- ofw/fs/cdfs/partition.fth	Mon Jul 16 02:53:10 2012	(r3067)
+++ ofw/fs/cdfs/partition.fth	Wed Jul 18 04:56:18 2012	(r3068)
@@ -4,7 +4,8 @@
 \ 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-hw-sector catch  if  drop false exit  then
+   d# 16  /sector h# 200 =  if  4*  then
+   ['] 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