Creating Apple Disk Images (*.dmg) on Linux. Super-Simplified

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
841 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 17, 2010

This is merely a demonstration of a BASH script written by Jon Cowie to use the 'hfsplus' package to create HFS+ Disk Images on Linux. There are currently two limitations on this method:
1) The directory name cannot contain spaces. `$ dd of=${OUTPUT}` with spaces can't handle it.
2) The directory cannot have directories inside it. I don't know how to stat directories recursively, only the top level. In such a case, it won't stat the file size correctly. If anyone has any ideas as to how I can fix these problems, please let me know.

The original files and instructions can be found at http://www.trampolinesystems.com/blog/machines/2008/05/19/creating-dmg-files-...

The original gave you the option to specify the name, volume label, size in bytes, and content directory. I've tweaked it to automatically read the size of the files in the directory and set the size of the image, set the name and volume label as the directory and chown + chgrp + chmod the file for the owner.

A second script called 'makedmg' reads the username so that it can be used for chown and chgrp and then sudo's the mkdmg script where all the juicy stuff happens.

Since it involves mounting the image, only root can execute it. I used gksudo so that it prompts you all pretty-like. . . =P

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more