0

Hello I have a script that creates a MacOSX image and then copies stuff to it. The script was tested and worked fine until I tried to implement it in a Travis build. This is where things get interesting. The bit of code that is of interest is as follows:

    hdiutil create "$dmg" -srcfolder tmp -fs HFS+ -format UDRW -volname Fiji -attach
    cp resources/install-fiji.jpg /Volumes/Fiji/.background.jpg

This fails because I am working in a VM and the /Volumes directory is not shared by the VM. If I try listing the directory I get:

    ls -la /Volumes
    ls: VMware Shared Folders: Input/output error

Even though the hdiutil command did not fail and in fact happily reported:

    /dev/disk1              GUID_partition_scheme           
    /dev/disk1s1            Apple_HFS                       /Volumes/Fiji

How can I get around this problem? Maybe mount on a different mount point?

1 Answers1

0

OK, I've figured out that I can just mount to something else after the creation command

    hdiutil create "$dmg" -srcfolder tmp -fs HFS+ -format UDRW -volname Fiji
    mkdir /tmp/Fiji
    hdiutil attach "$dmg" -mountpoint /tmp/Fiji