|hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg|
|hdiutil convert /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o /tmp/RWBase|
|hdiutil convert -format UDSP -o /tmp/sparseRWBase RWBase.dmg|
|hdiutil resize -size 6g /tmp/sparseRWBase.sparseimage|
|hdiutil attach -owners on /tmp/sparseRWBase.sparseimage -shadow|
|sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages|
|sudo ditto /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages|
|hdiutil eject /Volumes/OS\ X\ Install\ ESD/|
|hdiutil eject /Volumes/OS\ X\ Base\ System/|
|hdiutil makehybrid -iso -hfs /tmp/sparseRWBase.sparseimage -shadow /tmp/sparseRWBase.sparseimage.shadow -o ~/Desktop/OSX-10.9.iso|
UPDATE for anybody with authentic Mac hardware and a license for Mavericks, there is a much simpler method for upgrading the hard drive:
Ultimately, I ended-up waiting until I had Internet access and using the much simpler method of booting from Internet-based recovery, as described in https://discussions.apple.com/thread/5507912?tstart=0 (which references https://support.apple.com/en-us/HT201314 ).
This enabled me to restore the OS on the new hard drive from a Time Machine backup that I captured before upgrading the hard drive.
For the back-story:
I had the need to upgrade the hard disk in a friend's Macbook Pro (mid-2012), which is still running Mavericks, and I wasn't going to have an Internet connection, so I trawled the Internet for hours trying to find this information and finally stumbled upon https://apple.stackexchange.com/a/132613/183884 which in turn lead me to the comment at https://www.marekbell.com/how-to-create-a-bootable-installation-for-os-x-mavericks-10-9-and-above/#comment-1488722562 .
My plan was to backup to a portable disk using Time Machine from within the existing OS installation, physically install the new (bare) drive, and
I was amazed to find that this procedure still "works" on an up-to-date Mavericks installation (and by "works", I mean to say, produces a bootable ISO image).
Unfortunately, even though I'm able to boot from the burned ISO, I can't install Mac OS once booted into the GUI. Perhaps I have a "bad burn". I receive an error once the UI loads, conveyed by way of a dialog (the only choice is
A couple of notes from my experience (in case anybody from some "Mac Museum" has interest in the future):
Even though it didn't bail me out, thank you for posting this!