Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deployment script for dual-boot computers



On Jul 9, 2009, at 10:30 AM, Allen Creech wrote:

Sure - my cut 'n' paste skills aren't what they used to be and my script is now below. Ideally, the script would examine disk0 to verify there was enough space available before partitioning. This is assuming a 20G partition for Windows and, let's say, 30G additional free space for additional/updated applications.


If you are scripting things I would be really careful about using 'disk0' and 'disk1', these assignments are non-deterministic. So during one boot the drive in 'bay 1' can be 'disk0', and the next boot it might be the disk in 'bay 2'. It seems that whichever disk comes up first (internal ones seem to always come up first) is 'disk0', and this pays no attention to what drive is booted from.

My solution for this was to code everything in C, and then to match the IOKit path of the drives against a list I built telling me what was 'bay 1' and 'bay 2' to see if I could figure this out. The code works well for systems that I had access to, but has the down-side that the table of models needs to be kept up-to-date.

There is a private framework that DiskUtility uses to get this string, but it has a couple of problems for my purposes: It is private, and so can move and change without warning. And it returns completely different strings for PowerMacs than it does for MacPro's, and it does not return anything for iMacs, meaning that I needed to have complex logic to figure this out anyways (what I already had was simpler).

I have plans to do a re-write of that code so that I can open-source it, but in the mean time I can definitely provide the data for the models I have, and pointers about how to do what I did if someone wants them.

--
	Karl Kuehn
	email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
System-imaging mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/system-imaging/email@hidden

This email sent to email@hidden
References: 
 >Deployment script for dual-boot computers (From: Allen Creech <email@hidden>)
 >Re: Deployment script for dual-boot computers (From: Dave Robbins <email@hidden>)
 >Re: Deployment script for dual-boot computers (From: Allen Creech <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.