I am proud to announce that we now have a fully functioning, catch-free OSX live dvd that is painless to produce, and incredibly functional!
I attach images and a script that are relevant to this success, and I post here the method by which such a live dvd will be produced. I hope that now that this is functional and simple enough, we should be able to move on and put some nice features on the dvd.
Picture_5.png 915.73KB 8876 downloads
Picture_1.png 699.92KB 4976 downloads
Picture_4.png 679.42KB 3798 downloads
How it works:
This method works because OSX has a disk image boot system in place to support its network boot system. IOHDIXController and kernel can take a path to disk image supplied to them, and mount it as /, via "imageboot", which recognizes a disk image as an attachable filesystem.
Further, Apple has setup a system to take a read-only disk image and attach a shadowfile to it, so that it is writeable. Intended to support a network boot system by making the user's session local and non-persistent, it is implemented in /etc/rc.netboot. Basically, vndevice (/usr/libexec/vndevice) attaches a shadow file to the dmg, and enables a copy-on-write strategy on that device--writes to the dmg are diverted to the temporary shadow file. This is much like what happens on a linux live dvd, albeit with Unionfs.
Normally the shadowfile is created on a local disk or network share, on either nfs or hfs. Under my method, the shadowfile is created on ramdisk formatted with hfs, and the system behaves exactly as if it were booted with netboot. The difference is that I specify that the dmg to boot from is local(file:///), and then manually start a customized rc script. The script behaves like rc.netboot, except i create a ramdisk and setup the shadowfile there instead of on a local disk. After that / is R/W and OS X boots normally into finder...and beyond.
rc.liveboot.txt 4.93KB 8143 downloads
This method provides a way to boot from media that are read-only by diverting all writes to a ramdisk. This means it can be used to boot from a dvd(described here), USB drive, or pretty much any other media. It uses BOOT-132/Darwin as a boot loader and then exploits Apple's netboot and imageboot systems to boot from a disk image.
Install OSX fresh, boot into it and login/customize your user a bit. It's set in stone from here on out.
We need to be able to boot from a dmg, by giving Apple's netboot/image boot the pieces it needs:
0. You'll need to hack IOHDIXController.kext abit. Show its package contents, find Info.plist and change "Network-Root" to "Root". Do that for all its plugins as well. Regenerate Extensions.mkext.
1. Prepare the target media with boot-132. There are plenty of tuts in the genius bar for this...
2. Now following Rammjet's instructions, we plant some files on the root of the media:
3. That done, we need to plant the new rc script: download rc.liveboot.txt, remove the txt extension and put it under /etc. make sure its perms are the same as rc.netboot. Note that if you want to set the ramdisk size, it's in that script under RAMDisk(). Just keep it >= 2000000 512 blocks...
4. Alright we're done hacking. Using disk utility, create a compressed dmg of that installation.
5. Place that in the root of your media... live.dmg is a good name for it.
7. Now, boot from that media. at the darwin prompt, provide the params:
-v -f -s rp=file:///live.dmg
These can also be provided under com.apple.Boot.plist
8. At the single user prompt, run the liveboot script:
sh /etc/rc.liveboot init
9. When that finishes, exit the shell.
The system should come up and be alive!!
Big thanks to entire OSX86 community & esp those who helped make this! Hagar, modbin, ~pcwiz, Rammjet, socalswimmer ...