General Mac OS X Discussion General Apple and Mac OS X Discussion

Thread Tools Display Modes
  (#1) Old
bkero bkero is offline
Junior Member
Posts: 14
Join Date: Oct 2008
Default Alternate method for package injection - 10-20-2008, 02:47 AM

I should preface this first post by putting into context my need to do this. I've been in the market for a new MacBook since they came out on Tuesday. The model I had before came out after Leopard(Nov '07 refresh), and I've been disappointed with the plastics, and the Intel X3100 graphics.

I wanted to sell this laptop with a fresh install of Leopard. However, as I've lost my restore discs, I was in a bit of a pickle. I had a retail Leopard DVD from some other Hackintosh attempts, but upon booting it, Installer told me that my machine was unsupported! I've attributed this to having been released after Leopard went retail. What's an earnest hacker to do but force it on there somehow?

I've done some installs on unsupported Macs before, but they've usually boiled down to modifying DVD images, and burning new ones. I didn't have another Mac to do that with with, nor the desire to burn a new Leopard DVD. Since there's no command-line text editor on the Install DVD, I was out of luck there too.

I eventually came up with booting the DVD, ignoring the 'unsupported machine' error message, then going to Utilities->Disk Utility, partitioning/formatting the drive, then opening Utilities-> and using the following code:
device=`hdid -nomount ram://64000`
newfs_hfs $device
mkdir /private/var/tmp/temp
mount -t hfs $device /private/var/tmp/temp/
cp /System/Installation/Packages/OSInstall.mpkg /private/var/tmp/temp/
cd /private/var/tmp/temp
xar -x -f OSInstall.mpkg
sed -i "s/var badMachines/\/\/var badMachines/" Distribution
xar -c -f OSInstall.mpkg *
for i in `ls /System/Installation/Packages/`; do ln -s /System/Installation/Packages/$i $i; done/System/Library/CoreServices/ /private/var/tmp/temp/OSInstall.mpkg
TLDR, What this does is:
1) Make a RamFS
2) Copy the OS Install metapackage to it
3) Unarchive it
4) Modify the file that checks if a machine is supported
5) Archive it back up
6) Make symbolic links back to the actual packages
7) Run the OS Installer(with the OS Install metapackage as an argument)

It's easy to see how this small script can be modified to support package injections. The best part about this is that it uses an unmodified retail Leopard DVD, and is able to install packages from an external source, such as a USB thumbdrive.
Reply With Quote

« Dual booting? | Running XP in Leopard »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Copyright © 2008-2016