Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Make a universal 10.6.7 Snow Leopard installer' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Make a universal 10.6.7 Snow Leopard installer
Authored by: joelbruner on Feb 16, '12 02:12:33PM
Like all good hints, with a lot of eyeballs they just get better. Thanks for figuring out the logic was in OSInstall.mpkg, I had wondered that for a while but put it on the back burner... but this spurred me on to get to the core logic of it. So now, it's an automated affair, and it retains the original OSInstall.mpkg and print drivers.

Paste the code into TextWrangler name it "makeUniversalDisc.command" or whatever name with .command and Textwrangler will automagically add the execute bit too. (App store version may not do this?) Then simply double click and follow the prompts.

#!/bin/bash
clear

destination=~/Desktop/Mac\ OS\ X\ Install\ DVD

#make destination folder
[ ! -d "$destination" ] && mkdir "$destination"

#make sure disc is in drive
while [ ! -d /Volumes/Mac\ OS\ X\ Install\ DVD ] ; do
echo Please insert Mac OS X Install DVD and press Enter
read
done

#get device node for block copy
device=$(diskutil info /Volumes/Mac\ OS\ X\ Install\ DVD/ | grep Node | cut -f2 -d:)

#create disk image from device (retains Finder window custom background)
echo "Creating Disc image at $destination, please wait..."
/usr/bin/hdiutil create -srcdevice $device -format UDRW "$destination"/Mac\ OS\ X\ Install\ DVD.dmg

#disk image using source folder (loses custom Finder background)
#/usr/bin/hdiutil create -srcfolder /Volumes/Mac\ OS\ X\ Install\ DVD/ -format UDRW "$destination"/Mac\ OS\ X\ Install\ DVD.dmg

#eject media
/usr/bin/drutil eject

#tell user to take out disc
echo -e $'\a'$'\a'$'\a'$'\n'"Please Remove the disc and press Enter"$'\n'
read

echo "Modifying Image"

#mount r/w image
hdiutil attach "$destination"/Mac\ OS\ X\ Install\ DVD.dmg

#expand OSINstall.mpkg
/usr/sbin/pkgutil --expand /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.expanded

#modify Distribution script in place with no backup
/usr/bin/sed -i '' "s/modelProp\ \=\=\ hwbeSupportedMachines\[i\]/1/g" /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.expanded/Distribution

#modify Distribution script in place with backup (for sissies)
#/usr/bin/sed -i '.original' "s/modelProp\ \=\=\ hwbeSupportedMachines\[i\]/1/g" /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.expanded/Distribution

#remove original OSInstall.mpkg package
/bin/rm -rf /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg

#flatten new package
/usr/sbin/pkgutil --flatten /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.expanded /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg

#remove expanded folder 
/bin/rm -rf /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.expanded

### image is now ready to be burned ###

#eject disk image
hdiutil eject /Volumes/Mac\ OS\ X\ Install\ DVD/

#burn disc image
/usr/bin/drutil burn "$destination"/Mac\ OS\ X\ Install\ DVD.dmg

echo -e $'\a'$'\a'$'\a'$'\n'"Disc Complete, Please Remove the disc"$'\n'


[ Reply to This | # ]
10.6: Make a universal 10.6.7 Snow Leopard installer
Authored by: Fofer on Feb 22, '12 04:38:00AM

Thanks for this. I am trying your .command file but it's not executing properly. I am starting with a mounted .DMG of 10.6.7 on my desktop and it's appearing as "Mac OS X Install DVD."

This is the error I get, when I try your .command file, in Terminal:

"exit;
destination=~/Desktop/Mac\: bad interpreter: No such file or directory
logout"

Any help?

I also don't see any mention of the print drivers in your script. They're handled?

Thanks again.

Edited on Feb 22, '12 04:38:58AM by Fofer



[ Reply to This | # ]
10.6: Make a universal 10.6.7 Snow Leopard installer
Authored by: KRivers on Jun 11, '12 05:12:32PM

all was going good and i thought i cracked it, until i tried to restore the modified image with SuperDuper. i also tried with disk utility and that didnt work neither. it return an error
"Retore Failed"
Could not find any scan information. The source image needs to be imagescanned before it can be restored.
so i tried to scan the image for restore and that failed also.
super duper log reports a segment fail
| 01:04:39 AM | Error | sh: line 1: 9052 Segmentation fault asr -source '/Users/Rivers/Installers/Mac Installers/Mac OSX/Mac OS X Install DVD.dmg' -target '/Volumes/Mac OS X Install DVD' -erase -noprompt -noverify

just for clarification i was trying to restore to an external usb HD. i tried multiples aswell to rule out that.
any ideas?



[ Reply to This | # ]
10.6: Make a universal 10.6.7 Snow Leopard installer
Authored by: KRivers on Jun 11, '12 05:19:43PM

All went well un until the point where i came to restore the image on to a partition. both superduper and disk utility didnt work.
superduper return this in the log.
| 01:04:39 AM | Error | sh: line 1: 9052 Segmentation fault asr -source '/Users/Rivers/Installers/Mac Installers/Mac OSX/Mac OS X Install DVD.dmg' -target '/Volumes/Mac OS X Install DVD' -erase -noprompt -noverify
disk utility said that the image needed to be scanned for restore, which i did, but this didnt work as it returned a null error.

any ideas? need help fixing this bad.



[ Reply to This | # ]