Create Yosemite Install and Recovery DVD
Hi there,
finally I managed to create the recovery partition with Apple's dmtest tool

So here is the (mostly) complete guide:
0. What you need:
- the Yosemite installer from the app store, it's version 10.10.3 on 20150409 or later, leave it in the /Application folder
- Lion Recovery Update v1.0 from the Apple website, leave it in the ~/Downloads folder
- the text file attached to this post, matching your version of the Yosemite installer, leave it in the ~/Downloads folder
1. Create an empty disk image:
hdiutil create -size 16674816b ~/Desktop/DVD
hdiutil attach -nomount ~/Desktop/DVD.dmg
Take note of the output, you will need it in the following commands, in my case '/dev/disk1'
Hi,
In step 6, when I enter the command:
~/Desktop/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition /Volumes/Install\ OS\ X\ Yosemite/ /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg 0 0 /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist
I get the error:
Could not find disk for /Volumes/Install OS X Yosemite/
Can you tell me what's wrong.
Thanks,
donjames
2. Partition disk image and create one volume for the installer:
diskutil partitionDisk /dev/diskX 2 GPT HFS+ INSTALL_YOSEMITE 6936723456B "Free Space" "Free Space" R
Replace '/dev/diskX' with the actual output from 1., in my case '/dev/disk1'
3. Create the installer partition:
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --applicationpath /Applications/Install\ OS\ X\ Yosemite.app/ --volume /Volumes/INSTALL_YOSEMITE/
4. Copy the missing text file to the installer partition:
cp ~/Downloads/IAProductInfo_10_10_3.txt /Volumes/Install\ OS\ X\ Yosemite/.IAProductInfo
If you don't use the latest installer for Yosemite, replace ..._10_10_3_... with the matching version
5. Unpack the Lion Recovery Update v1.0
hdiutil attach -nobrowse ~/Downloads/RecoveryHDUpdate.dmg
pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg ~/Desktop/RecoveryHDUpdate/
hdiutil detach /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/
6. Create a recovery partition on the disk image right behind the installer partition:
hdiutil attach -nobrowse /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg
~/Desktop/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition /Volumes/Install\ OS\ X\ Yosemite/ /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg 0 0 /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist
hdiutil detach /Volumes/OS\ X\ Install\ ESD/
7. Make recovery partition visible
diskutil list /Volumes/Install\ OS\ X\ Yosemite/
Look for the enumeration of the recovery partition 'Recovery HD', you will need it in the next command, in my case 3
asr adjust --target /dev/diskXsY -settype Apple_HFS
diskutil mount /dev/diskXsY
Look at 1. for the actual value of X, in my case '/dev/disk1'
Look at the previous command for the actual value of Y, in my case '3' so together its '/dev/disk1s3'
8. Finish work?
Actually we should burn the image at this point and we would be done. But there's one glitch: We had to use GPT for the dmtest tool. Unfortunately I've not been able to burn a DVD with GPT AND two partitions. The partitions are always missing on the DVD (not on the disk image, just on the physical DVD). So as a workaround we have to move stuff to a second disk image with MBR or APM...
9. Workaround the GPT DVD glitch.
hdiutil create -size 16674816b ~/Desktop/DVD-fix
hdiutil attach -nomount ~/Desktop/DVD-fix.dmg
Take note of the output, you will need it in the following commands, in my case '/dev/disk2'
diskutil partitionDisk /dev/diskZ 2 APM HFS+ fix_INSTALL_YOSEMITE 6936723456B HFS+ fix_RECOVERY_YOSEMITE R
Replace '/dev/diskZ' with the actual output from the previous command, in my case '/dev/disk2'
asr restore --source /Volumes/Install\ OS\ X\ Yosemite --target /Volumes/fix_INSTALL_YOSEMITE --erase
asr restore --source /Volumes/Recovery\ HD --target /Volumes/fix_RECOVERY_YOSEMITE --erase
hdiutil detach /dev/diskZ
Look above for the actual value of Z, in my case '/dev/disk2'
10. Finish work!
hdiutil detach /dev/diskX
Look at 1. for the actual value of X, in my case '/dev/disk1'
hdiutil burn ~/Desktop/DVD-fix.dmg
I hope this helps! In case you see some optimization, just let me know. I think it would be nice to minimize user interaction, but I'm not going into sed or awk now ... and of course would be much better without the workaround for GPT ... so if you know how to burn GPT with two partitions to DVD ...
Thanks go to a lot of people who helped me with bits and pieces of their knowledge:
Regards, Mike