support for hfs(+)-fs on a CD

Kay Sievers kay.sievers at vrfy.org
Thu Jul 29 13:00:23 PDT 2004


On Thu, 2004-07-29 at 21:49 +0200, David Zeuthen wrote:
> On Thu, 2004-07-29 at 21:25 +0200, Kay Sievers wrote:
> > On Thu, 2004-07-29 at 20:00 +0200, David Zeuthen wrote:
> > > On Thu, 2004-07-29 at 05:26 +0200, Kay Sievers wrote:
> > > > Here is support for recognition of hfs and hfsplus filesystems on a main
> > > > block device, like a CD. Only the first partition is returned with the
> > > > probe.
> > > > 
> > > 
> > > Nice, this works for one of my CD-ROM with a hfsplus filesystem, but it
> > > doesn't work on my recovery DVD for my Powerbook (mounting it with -t
> > > hfsplus works). Hmm.. I don't think it's worth looking into support
> > > multi partition and/or multi session discs until the kernel actually
> > > give us a special device file for each of them.
> > 
> > It would be nice, if we can get it into the kernel. If it's not possible
> > for some reason, I still can add a partiton table parser to volume_id
> > and we can create child devices in HAL with 'block.session=<number>' and
> > add these to fstab.
> > 
> 
> I'm all for getting the kernel to export /dev/cdrom/session%d and
> partitions within sessions etc, anything else would be absurd in my
> opinion (I've not given it much thought though). On a related topic, I
> wonder what the appropriate forum, short of linux-kernel, to raise this
> would be? Some kind of desktop-kernel list would be useful.

Yeah, would be nice.

> Until that happens, just thinking out loud, a property
> volume.disc.session_number might be handy. Here's one use: we install a
> callout (running before update-fstab.sh) to create the
> symlinks /dev/cdrom/session%d pointing at /dev/cdrom and changes
> block.device to the symlink. 
> 
> Now, the update-fstab.sh is called and this adds the following entries
> 
>  /dev/cdrom/session1	/media/cdrom	iso9660 ro,user,noauto,session=1    0   0
>  /dev/cdrom/session2	/media/cdrom2	iso9660 ro,user,noauto,session=2    0   0
> 
> to /etc/fstab and g-v-m or whatever can easily just mount the device
> pointed to by block.device, e.g. mount /dev/cdrom/session1
> 
> However, let's try to see if this can be added to the kernel before
> introducing this hack. And multi-session / multi-partition CD's are rare
> anyway.

Yes, I feel the same. It should be in the kernel, the kernel has all the
stuff needed already in and we rely on the code there anyway if we want
to mount it. So it doesn't make much sense to do the same in userspace.

> > Back to your DVD. What's in the first sessions partition table? Mine
> > looks like this:
> > 
> 
> OK, I've pasted it below and the 10 first sectors are attached.
> 
> [david at laptop spec]$ dd if=/dev/hdd count=10 |hexdump -C
> 10+0 records in
> 10+0 records out
> 00000000  45 52 08 00 00 1c 84 00  00 01 00 01 00 00 00 00  |ER..............|
> 00000010  00 04 00 00 00 10 00 05  00 01 00 00 00 1e 00 19  |................|
> 00000020  ff ff 00 00 00 41 00 05  07 01 00 00 00 4f 00 1f  |.....A.......O..|
> 00000030  f8 ff 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000200  50 4d 00 00 00 00 00 0a  00 00 00 01 00 00 00 3f  |PM.............?|
> 00000210  41 70 70 6c 65 00 00 00  00 00 00 00 00 00 00 00  |Apple...........|
> 00000220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000230  41 70 70 6c 65 5f 70 61  72 74 69 74 69 6f 6e 5f  |Apple_partition_|
> 00000240  6d 61 70 00 00 00 00 00  00 00 00 00 00 00 00 00  |map.............|
> 00000250  00 00 00 00 00 00 00 3f  00 00 00 17 00 00 00 00  |.......?........|
> 00000260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000003d0  00 00 00 00 00 0b ff ff  00 00 00 00 00 00 00 00  |................|
> 000003e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 000003f0  00 00 00 00 00 00 00 00  00 00 00 00 4d 52 4b 53  |............MRKS|
> 00000400  50 4d 00 00 00 00 00 0a  00 00 00 40 00 00 00 38  |PM......... at ...8|
> 00000410  4d 61 63 69 6e 74 6f 73  68 00 00 00 00 00 00 00  |Macintosh.......|
> 00000420  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000430  41 70 70 6c 65 5f 44 72  69 76 65 72 34 33 00 00  |Apple_Driver43..|
> 00000440  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000450  00 00 00 00 00 00 00 38  00 00 03 7f 00 00 00 00  |.......8........|
> 00000460  00 00 24 00 00 00 00 00  00 00 00 00 00 00 00 00  |..$.............|
> 00000470  00 00 00 00 00 00 77 08  00 00 00 00 00 00 00 00  |......w.........|
> 00000480  00 00 00 00 00 00 00 00  70 74 44 52 00 00 00 00  |........ptDR....|
> 00000490  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000005d0  00 00 00 00 00 0f ff ff  00 00 00 00 00 00 00 00  |................|
> 000005e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000600  50 4d 00 00 00 00 00 0a  00 00 00 78 00 00 00 8c  |PM.........x....|
> 00000610  4d 61 63 69 6e 74 6f 73  68 00 00 00 00 00 00 00  |Macintosh.......|
> 00000620  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000630  41 70 70 6c 65 5f 44 72  69 76 65 72 34 33 5f 43  |Apple_Driver43_C|
> 00000640  44 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |D...............|
> 00000650  00 00 00 00 00 00 00 8c  00 00 03 7f 00 00 00 00  |................|
> 00000660  00 00 c4 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000670  00 00 00 00 00 00 ea 3d  00 00 00 00 00 00 00 00  |.......=........|
> 00000680  00 00 00 00 00 00 00 00  43 44 72 76 00 00 00 00  |........CDrv....|
> 00000690  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000007d0  00 00 00 00 00 13 ff ff  00 00 00 00 00 00 00 00  |................|
> 000007e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000800  50 4d 00 00 00 00 00 0a  00 00 00 00 00 00 00 00  |PM..............|
> 00000810  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000830  41 70 70 6c 65 5f 56 6f  69 64 00 00 00 00 00 00  |Apple_Void......|
> 00000840  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000a00  50 4d 00 00 00 00 00 0a  00 00 01 04 00 00 00 38  |PM.............8|
> 00000a10  4d 61 63 69 6e 74 6f 73  68 00 00 00 00 00 00 00  |Macintosh.......|
> 00000a20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000a30  41 70 70 6c 65 5f 44 72  69 76 65 72 5f 41 54 41  |Apple_Driver_ATA|
> 00000a40  50 49 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |PI..............|
> 00000a50  00 00 00 00 00 00 00 38  00 00 03 7f 00 00 00 00  |.......8........|
> 00000a60  00 00 26 00 00 00 00 00  00 00 00 00 00 00 00 00  |..&.............|
> 00000a70  00 00 00 00 00 00 67 40  00 00 00 00 00 00 00 00  |......g at ........|
> 00000a80  00 00 00 00 00 00 00 00  70 74 44 52 00 00 00 00  |........ptDR....|
> 00000a90  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000bd0  00 00 00 00 00 17 ff ff  00 00 00 00 00 00 00 00  |................|
> 00000be0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000c00  50 4d 00 00 00 00 00 0a  00 00 01 3c 00 00 00 8c  |PM.........<....|
> 00000c10  4d 61 63 69 6e 74 6f 73  68 00 00 00 00 00 00 00  |Macintosh.......|
> 00000c20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000c30  41 70 70 6c 65 5f 44 72  69 76 65 72 5f 41 54 41  |Apple_Driver_ATA|
> 00000c40  50 49 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |PI..............|
> 00000c50  00 00 00 00 00 00 00 8c  00 00 03 7f 00 00 00 00  |................|
> 00000c60  00 00 f2 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000c70  00 00 00 00 00 00 c1 6c  00 00 00 00 00 00 00 00  |.......l........|
> 00000c80  00 00 00 00 00 00 00 00  41 54 50 49 00 00 00 00  |........ATPI....|
> 00000c90  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000dd0  00 00 00 00 00 1b ff ff  00 00 00 00 00 00 00 00  |................|
> 00000de0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000e00  50 4d 00 00 00 00 00 0a  00 00 01 c8 00 00 02 00  |PM..............|
> 00000e10  50 61 74 63 68 20 50 61  72 74 69 74 69 6f 6e 00  |Patch Partition.|
> 00000e20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000e30  41 70 70 6c 65 5f 50 61  74 63 68 65 73 00 00 00  |Apple_Patches...|
> 00000e40  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000e50  00 00 00 00 00 00 02 00  00 00 00 01 00 00 00 00  |................|
> 00000e60  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 04  |................|
> 00000e70  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000fd0  00 00 00 00 00 1f ff ff  00 00 00 00 00 00 00 00  |................|
> 00000fe0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00001000  50 4d 00 00 00 00 00 0a  00 00 00 00 00 00 00 00  |PM..............|
> 00001010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00001030  41 70 70 6c 65 5f 56 6f  69 64 00 00 00 00 00 00  |Apple_Void......|
> 00001040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00001200  50 4d 00 00 00 00 00 0a  00 00 03 c8 00 72 0c 30  |PM...........r.0|
> 00001210  4d 61 63 5f 4f 53 5f 58  00 00 00 00 00 00 00 00  |Mac_OS_X........|
> 00001220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00001230  41 70 70 6c 65 5f 48 46  53 00 00 00 00 00 00 00  |Apple_HFS.......|
> 00001240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00001250  00 00 00 00 00 72 0c 30  40 00 00 7f 00 00 3a f0  |.....r.0 at .....:.|
> 00001260  00 0c 10 00 01 c0 00 00  00 00 00 00 01 c0 0c b0  |................|
> 00001270  00 00 00 00 00 00 00 00  70 6f 77 65 72 70 63 00  |........powerpc.|
> 00001280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00001320  00 00 00 00 00 00 00 00  67 6f 6f 6e 00 00 00 00  |........goon....|
> 00001330  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000013d0  00 00 00 00 00 23 ff ff  00 00 00 00 00 00 00 00  |.....#..........|
> 000013e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00001400

Oh, bad. This is a single session with actually the 9th of the partition
as the data we are looking for. Don't know, what the guys at Apple are
smoking :) I will change it to look for the first valid partition, not
assuming that it's the first after the partiton table.

Kay

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list