File with dmg extension usually is Apple Disk Image file and mainly used for installation of other packages image commonly by Mac OSX operating system. Acronym of DMG according to acronymfinder.com is Disk iMaGe. Recently at my workplace it was required to make changes in DMG file: background image and volume name. I found one link which explains this procedure, However it did not work for me. So I did in my own way. . Now I want to record all steps as a short manual for myself and anyone who needs to do the same.
As an example Firefox DMG file has been used. After download and opening it looks in Finder as:
The first step is to create read/write version of this file:
hdiutil convert -format UDRW "Firefox 62.0.dmg" -o "Firefox 62.0RW.dmg" -ov
Mount in terminal:
hdiutil mount "Firefox 62.0RW.dmg"
or double click on Firefox 62.0RW.dmg in Finder. The appropriate Firefox DMG icon appears on Desktop, double click on this icon.
|Write click and select “Show View Options” menu item, replace background picture with colored background and change size of icons, then press “Use as Defaults” button.|
Write click and select “Get Info” menu item, unlock it and change “Name & Extension” from Firefox to “Firefox Modified”. Check in terminal that currently volume name is “Firefox Modified”. Also it is possible to do small cleanup of new “Firefox Modified” volume removing unused background image. From terminal window delete invisible .background folder with background.png file:
Unmount “Firefox Modified” volume from terminal:
or Eject it from Desktop.
Overwrite downloaded read only version of “Firefox 62.0.dmg” with new one.
hdiutil convert -format UDCO "Firefox 62.0RW.dmg" -o "Firefox 62.0.dmg" -ov
Now the updated version of Firefox DMF file looks in Finder like this:
About problem with installation of dmg2img and/or genisoimage read Yum Repositories Control or “No package … available“.