Repository navigation
iso9660: write images that strict readers accept - #460
Conversation
|
This is some good work, thank you for this. I ran CI, it is all clean.
The most recent 6th edition of ecma-119 section 9.3 describes volume set terminator. Did you mean a different section? Section 7.8 is directory structure, and 7.9 is path table, specifically 7.9.2 is path table ordering. 7.9.2 has this fun tidbit: In any case, yes, the order is prescribed, and not just according to the walk. It would be cool if you could tell the walk func "order it this way", but it doesn't work like that. I assume this is addressed in |
right, my reference to 9.3 was from older numbering. Funny enough the annex C.4.8.1 of the 6th edition still uses that number. |
Finalize wrote three structures that a strict reader such as pycdlib rejects. Tolerant readers such as xorriso and isoinfo accept them. The Rock Ridge PX entry stored the file serial number as one 64-bit little-endian value. RRIP 1.12 section 4.1.1 defines a 32-bit value in both byte orders. The writer now stores the two halves, and the reader reads the little-endian half. Finalize appended a second directory record for the boot catalog when the workspace already contained a file with the same name. Finalize now uses the existing record for the generated catalog. With HideBootCatalog, Finalize removes the existing file from the image. Finalize wrote directory records in the order of the workspace walk. ECMA-119 section 9.3 requires the order of the file identifiers. Finalize now sorts the records of each directory. The Joliet tree sorts its records by the UCS-2 bytes of the names. The boot catalog path has these new rules: - If a different file has the same ISO 9660 identifier as the catalog, the catalog gets a free identifier (BOOT0.CAT for BOOT.CAT). - If the path of a visible catalog is a directory or a symlink, Finalize returns an error. - If the path of the catalog is also the path of a boot image, Finalize returns an error. Co-Authored-By: Claude <noreply@anthropic.com>
e63ba59 to
f1b1bd1
Compare
This change makes
Finalizewrite ISO 9660 images that strict readers accept.pycdlib 1.22.0 rejects a bootable Rock Ridge image from go-diskfs when the workspace contains the boot catalog file, for example
isolinux/boot.cat. Tolerant readers such as xorriso and isoinfo accept the image.Defects
PX file serial number. The Rock Ridge PX entry stored the file serial number as one 64-bit little-endian value. RRIP 1.12 section 4.1.1 defines a 32-bit value in both byte orders. pycdlib reports
PX record big and little-endian file serial number do not agree.Second boot catalog record.
Finalizeappended a directory record for the boot catalog when the workspace already contained a file with the same name. The directory then had two records with the identifierBOOT.CAT;1. pycdlib reportsFailed adding duplicate name to parent.Order of directory records.
Finalizewrote directory records in the order of the workspace walk. ECMA-119 section 9.3 requires the order of the file identifiers. A workspace withEFI,coreos,imagesandisolinuxgave the orderEFI, COREOS, IMAGES, ISOLINUX.Changes
uint32.Finalizeuses the existing directory record for the generated catalog. WithHideBootCatalog,Finalizeremoves the existing file from the image.Finalizesorts the records of each directory by file identifier. The Joliet tree sorts its records by the UCS-2 bytes of the names.New rules for the boot catalog path
BOOT0.CATforBOOT.CAT).Finalizereturns an error.Finalizereturns an error.Tests
The unit tests are in
finalize_catalog_internal_test.goandrockridge_internal_test.go.I also built one image from
masterand one image from this branch. The workspace was the content of a bootable ISO withisolinux/boot.cat, Rock Ridge, a BIOS boot entry and an EFI boot entry. Each reader extracted all files, and I compared the sha256 of each file with the source.masterboot.catrecordsgolangci-lintv2.14.0 reports no issues.