• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems with hdiutil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with hdiutil


  • Subject: Problems with hdiutil
  • From: "David Litwin" <email@hidden>
  • Date: Tue, 1 Aug 2006 12:01:58 -0700
  • Thread-topic: Problems with hdiutil

I can’t find any good list for questions about hdiutil, so this is going to xcode-users because my use is related to project building.


I use hdiutil to create a disk image of my installer package.  Because I want to set the icon of the image, I create it writable (UDRW) so I can call SetFile –a C on it.

After this, I use hdiutil to convert it to a compressed read only image.


Before the conversion to read only compressed, everything in the image is fine.  After the conversion, I wind up in the odd situation that my Welcome.txt file has been wiped out and replaced with 16 bytes of zeros.  No other file is touched.


I have now reproduced this problem with an image containing nothing but the Welcome.txt file, on both a PPC and Intel machine.  The source image (UDRW) is fine, the dest image (UDZO, zlib-level=9) is corrupted.


Has anyone seen anything like this?  It’s completely baffling.  If I can’t trust my disk image making tool, how can I put my code out with any confidence?

 

David Litwin

BigFix, Inc.

 

P.S.  If anyone is curious, here is a script (included in my radar report #4662414) that demonstrates the bug on my PPC and Intel machine.  I’m curious if anyone else sees it:

 

#!/bin/sh

 

echo "Create the source ImageDir"

mkdir ImageDir

echo "This welcome text will get wiped out" > ImageDir/Welcome.txt

echo

 

echo "Create the writable image"

echo hdiutil create -srcfolder "ImageDir" -volname "hdiutil-bug" -format UDRW -layout NONE -fs 'HFS+' -ov "Writable.dmg"

hdiutil create -srcfolder "ImageDir" -volname "hdiutil-bug" -format UDRW -layout NONE -fs 'HFS+' -ov "Writable.dmg"

echo

 

echo "Create the compressed read only image from the writable image"

echo hdiutil convert "Writable.dmg" -format UDZO -o "Compressed.dmg" -ov -imagekey zlib-level=9

hdiutil convert "Writable.dmg" -format UDZO -o "Compressed.dmg" -ov -imagekey zlib-level=9

echo

 

echo "Mount and check the contents of the Writable image"

mountLine=`hdiutil attach "Writable.dmg" | tail -n 1`

disk=`expr "$mountLine" : '\([^ ]*\).*$'`

volLoc=`expr "$mountLine" : '[^ ]*[^\/]*\(.*\)$'`

hexdump -C "$volLoc/Welcome.txt"

hdiutil detach -force "$disk"

echo

 

echo "Mount and check the contents of the compressed read only image"

mountLine=`hdiutil attach "Compressed.dmg" | tail -n 1`

disk=`expr "$mountLine" : '\([^ ]*\).*$'`

volLoc=`expr "$mountLine" : '[^ ]*[^\/]*\(.*\)$'`

hexdump -C "$volLoc/Welcome.txt"

hdiutil detach -force "$disk"

echo

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problems with hdiutil
      • From: Michael Nickerson <email@hidden>
  • Prev by Date: Re: Shark and Sampler problems
  • Next by Date: DWARF debugging issue: DW_FORM_strp pointing outside of .debug_str section
  • Previous by thread: Re: Shark and Sampler problems
  • Next by thread: Re: Problems with hdiutil
  • Index(es):
    • Date
    • Thread