[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Collaborating on the HFS code



Hi,

John Paul Adrian Glaubitz wrote:
> > There is currently one limitation with the HFS patch as it doesn't allow setting
> > a custom volume name and hard-wires it to "untitled" [4]. This is because
> > the original code uses an Apple-specifc function to convert UTF-8 into Mac
> > encoding [5], if someone has a suggestion how to implement this encoding
> > conversion on Linux,

> I would have hoped that there is already a simple solution for that on
> Linux.

I'm not sure whether this is what you look for, but libisofs maps the
ISO 9660 volume id to a HFS+ filename and attributes it to the first node
in its array of emerging HFS+ nodes.
This might correspond with a comment in
  https://sources.debian.org/src/hfsprogs/540.1.linux3-5/newfs_hfs.tproj/makehfs.c/#L629
  /* defaults->volumeName is used later for the root dir key */

(Verification proposal:
If you inspect the HFS+ filesystem of a grub-mkrescue ISO for x86 EFI
or GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275 then it should bear the name
"ISOIMAGE", adjustable by grub-mkrescue/xorrisofs option -V.)

-----------------------------------------------------------------------

The .name definition of the HFS+ node struct in libisofs bears the comment
  /* Name in UTF-16BE, decomposed. */

Conversion from the libisofs input charset (usually UTF-8) is done by
function iso_get_hfsplus_name().
  https://sources.debian.org/src/libisofs/1.5.4-1/libisofs/hfsplus.c/#L118
After a conversion to iconv charset "UTF-16BE" there happens
post-processing which uses the tables hfsplus_decompose_pages and
hfsplus_class_pages.

The table hfsplus_decompose_pages gets created from another table in
source file
  https://sources.debian.org/src/libisofs/1.5.4-1/libisofs/hfsplus_decompose.c
with a comment "Based on tn1150 (HFS+ format specification)".
Regrettably this link is dead:
  http://developer.apple.com/legacy/mac/library/#technotes/tn/tn1150.html
and the Wayback Machine is not delivering results to me today.

The table hfsplus_class_pages gets created by
  https://sources.debian.org/src/libisofs/1.5.4-1/libisofs/hfsplus_classes.c
which refers to "Unicode 3.2.0".

(I dimly remember that Vladimir Serbinko first submitted code which was
copied from Apple example programs with potential copyright problems.
So we decided to derive equivalent code from published Apple specs. Thus
the table generator functions.)


Have a nice day :)

Thomas


Reply to: