hdiutil and creation of more then one partition in a dmg and sparse image?
My main question,
after reading the man page and googling, I can't find any way to create a DMG file with more then one partition. Is this even possible?
-
My finaly goal is to attach those with -mountRandom and - nobrowse from inside a cocoa.app.
I need the return value to get the random path to those partitions.
hdiutil attach test.dmg -mountrandom /Users/dev/Desktop/testdmg
/dev/disk7 GUIDpartitionscheme
/dev/disk7s1 Apple_HFS /Users/dev/Desktop/testdmg/dmg.A43MrA
But I see that when I use a mutli partition dmg ( here simulated ) I will have to look for one or more random paths, something like this.
hdiutil attach test.dmg -mountrandom /Users/dev/Desktop/testdmg
/dev/disk7 Applepartitionscheme
/dev/disk7s1 Applepartitionmap
/dev/disk7s2 Apple_HFS /Users/dev/Desktop/testdmg/dmg.A43MrA
/dev/disk7s3 Apple_HFS /Users/dev/Desktop/testdmg/dmg.7IaUpK
What is the best way?
to grep a line wich contains '/dmg./ and then awk print $3 ?
path=/Users/dev/Desktop
hdiutil attach $path/test.dmg -mountrandom $path/testdmg | grep '/dmg.' | awk '{ print $3 }'
but what when I attach f.e a sparse image not using the -mountRandom, then I have no '/dmg.' just volumes?
Is that doable in one universal piece of code?
