Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot Read OS Version" from Composer captured OS.dmg's #22

Closed
macmule opened this issue Mar 3, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@macmule
Copy link
Owner

commented Mar 3, 2015

Take an AutoDMG OS.dmg > Restore > Mount > Capute OS via Composer > unmount > try & open in AutoCasperNBI. Errors "Cannot Read OS Version"

@macmule macmule added the bug label Mar 3, 2015

@macmule macmule self-assigned this Mar 3, 2015

@macmule macmule added this to the 1.1.5 milestone Mar 3, 2015

@macmule

This comment has been minimized.

Copy link
Owner Author

commented Mar 4, 2015

Ok.. so the issue seems to be the grep before awk, & bad assumptions I had made in that: https://github.com/macmule/AutoCasperNBI/blob/master/AutoCasperNBI/AutoCasperNBIAppDelegate.applescript#L513

Basically, a Composer captured OS.dmg contains JUST the OS partition. So hdiutil attach output looks like:

/usr/bin/hdiutil attach ~/Desktop/ComposerHD.dmg expected CRC32 $A02AE580 /dev/disk2 /Volumes/Macintosh HD 1

Whereas an AutoDMG OS.dmg outputs:

/usr/bin/hdiutil attach /Volumes/QuickStick/osx-10.10.1-14B25.hfs.dmg expected CRC32 $32279B63 /dev/disk3 GUID_partition_scheme /dev/disk3s1 EFI /dev/disk3s2 Apple_HFS /Volumes/Macintosh HD 2 /dev/disk3s3 Apple_Boot

As horrible as the below looks, it returns the correct mount path for both of the above DMGs:

/usr/bin/hdiutil attach /Volumes/QuickStick/osx-10.10.1-14B25.hfs.dmg | awk -F\"[<>]\" 'a{print $3; exit}$2==\"key\"&&$3==\"mount-point\"{a=1}'

Now we're parsing as a plist & awking out what we need, granted not anywhere near "best practice" but seems to resolve this issue.

Other attempts involved writing a plist & reading from that, but the nested dicts within the arrays gave me some grief (gist below) & with the above working.. i'll put the above into 1.1.5.

https://gist.github.com/macmule/827f8ddb8a65ddc007b2

Better/more elegant solutions welcome, as long as they can be ran within an AppleScript Objective-C app.

@macmule

This comment has been minimized.

Copy link
Owner Author

commented Mar 4, 2015

Summarised as:

alt text

@macmule macmule closed this Mar 5, 2015

@macmule

This comment has been minimized.

Copy link
Owner Author

commented Mar 5, 2015

fixed in 1.1.5

@TGBX

This comment has been minimized.

Copy link

commented Mar 30, 2015

When will 1.1.5 be released?

@macmule

This comment has been minimized.

Copy link
Owner Author

commented Apr 29, 2015

Also, to add that Composer 9.7 can now capture the Recovery HD, which would have resolved this issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.