Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a compressed dmg file using Linux tools?

There are a lots of question teaching how to create a DMG file from Linux. But none of them is clear about how to add compression to it.

I usually create a DMG package to redistribute to MacOS, but I would like to add compression as Apple specifies.

Did anyone have a chance to try a tool that supports compression during DMG packing?

Similar questions without compression:

  • How can I generate a DMG file from a folder in Linux?
  • How to create dmg file in Centos through command line
like image 364
jcfaracco Avatar asked Aug 02 '18 14:08

jcfaracco


People also ask

Does .DMG work on Linux?

Windows and Linux share the ability to open ISO files, which are similar to DMG files. Though DMG files are commonly associated with Apple's operating system, Mac, they can be opened in Linux with a few simple steps.

What is a DMG file in Linux?

What are DMG image files? Simply put, it's a kind of image file. But not an image like a jpeg is an image. DMG is Apple's proprietary disk image format, native to Mac OS X. There are actually a whole bunch of different types, format and options within this format.

How do you extract .DMG file in Linux?

Just use 7z x . In the case of for example Sublime text, 7z x "Sublime Text 2.0. 2. dmg" will be enough to extract all the files.


1 Answers

It depends. Here is a good analysis of the .dmg format. From that document, the compression is specified for each block chunk:

Table: DMG blxx types
Type    Scheme  Meaning
0x00000000  --- Zero-Fill
0x00000001  UDRW/UDRO   RAW or NULL compression (uncompressed)
0x00000002  --- Ignored/unknown
0x80000004  UDCO    Apple Data Compression (ADC)
0x80000005  UDZO    zLib data compression
0x80000006  UDBZ    bz2lib data compression
0x7ffffffe  --- No blocks - Comment: +beg and +end
0xffffffff  --- No blocks - Identifies last blxx entry
like image 146
Mark Adler Avatar answered Oct 26 '22 18:10

Mark Adler