"""Inspect the flat seed in both plain ISO9660 and Joliet namespaces. Linux can mount the plain namespace, which lowercases names and allows only one dot. macOS prefers Joliet and performs case-insensitive lookups, so a Mac mount alone cannot verify that Linux will find a referenced filename. """ import hashlib import struct def validate_seed(image, expected): namespaces = [] with image.open('rb') as stream: for sector in range(16, 48): stream.seek(sector*2048) descriptor = stream.read(2048) assert descriptor[1:6] == b'CD001' kind = descriptor[0] if kind == 255: break if kind not in (1, 2): continue assert struct.unpack_from('