I am using genisoimage
and the dmg
util from hfsplus-tools
on RH 9.3 to produce dmg files on Linux. Specifically, a common java program is jpackage
on 2 different platforms (intel mac and newer apple silicon M2). Each output DMG is opened with hdiutil mount -nobrowse file.dmg
and the tree of contents scp’d to Linux in separate architecture-specific directories. This allows us to create a Linux-based “template”. New versions of jar
files can be compiled and dropped into the template directly on Linux and the DMG created independent of the Mac. The key differentiator in the two templates is the architecture-specific launcher program i.e.
11.10/arm64/MyApp.app/Contents/MacOS/MyApp: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE>
11.10/i386/MyApp.app/Contents/MacOS/MyApp: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE>
The commands are:
genisoimage -V MyApp -D -R -apple -no-pad -o proto.img path_to_template
dmg dmg proto.img final.dmg
This works for the arm64
build in that final.dmg
can be downloaded to an apple silicon mac and opened and the DMG behaves properly. On the x64
build however, downloading and launching final.dmg
yields an error dialogue reading “The following disk images couldn’t be opened: final.dmg: invalid checksum”. What is puzzling is most of the genisoimage
/dmg
answers here on SO predate apple silicon so this must have worked in the past. Any clues?