How to create a custom OSX DVD (Tiger & Leo & Snow Leo).

Anything from How to burn a dvd correctly, to fixing your bathroom sink

How to create a custom OSX DVD (Tiger & Leo & Snow Leo).

Postby blackchungo1 on Mon Aug 20, 2007 9:28 am

I posted this in one of the others forums a while ago. I saw someone asking about this here so I guess I repost it just for the archives. Im adding some details by memory, so it might be not so accurate. Oviously the best way to figure out how to do it is diggin' into some of the x86 relases..... All the files you might have to replace can be found also in this relases. I used a jas 10.4.8 DVD and some of his advices as a guideline, so credits goes to him.

This first part is how it works on Tiger Install DVD, for leo see the end of the #2 post. But you should read all #1, and #2 because the method is basically the same; except for two things: First, Leopard installer packages are not the same as Tiger's (but the distribution script works in the same way). And second for patching the necesary files in leo GM DVD you can use brazilmac patch, although is good that you become aware of what this patch actually do; which files are replaced, etc, in a way that you can trow updated kernels and kexts 'by hand' in the future.

I used:
-An already working OSX istallation.
-An original apple install DVD image ( I used a macbook 10.4.8 disk). Go to any Apple Store and buy it!. People at Apple's make exellent software and this is the way to support them. Its cheaper than Windows and far much better. And since you're not buying their hardware I guess is fear....
-Any of the X86 DVD hackintosh relases image.
-a re-writable DVD to try out the image

So if U have a double layer DVD that holds more than 4.7 gb you can skip this first step. Otherways you have fit the dvd content in a 4.7 gb disk. to do so mount the apple image as readwrithe and rip out files that are not essential to the installation. Xcode folder is the best option, printer drivers and lenguage translations are good to be erased too, but then you have to delete any reference to them inside the OSInstall.dist file located in /sysytem/library/installation/packages/OSInstall.mpkg/contents/.
Once you're shure that the content will fit, mount the hackintosh image in the same way as before (readwrite) and erase all inside it, we need only the boot sector of it. You might need something like Onyx to see the invisible files inside the DVD's.
Now copy (from within the terminal something like: cp /volumes/image1/ /volumes/image2 ) the content from the apple image (already stripped down) to the empty hackintosh DVD image. that's that.
note: you have to unselect 'ignore ownerships on this volume' option in both images.....

Theres also the alternative of building your distro in a HD partition first and then generate a ISO image out of it. This is really cool because you can boot the installer (from the HD) very fast and you burn no DVDs until the installer is ready. For this you need to copy the content of the dvd to a HD partition (not bigger than 4.7gb) ("sudo cp -R /volumes/DVD/ /volumes/partition/" from the terminal, or with 'ditto' command), then make the partition bootable (viewtopic.php?f=16&t=209)... Then you can work on your custom installer and boot as many times as you want without burn any disks; and much faster booting.
once you're finished you need to generate an iso image out of that. Use the script from this post: http://www.hackint0sh.org/forum/showpos ... stcount=35


Now work on the hackintosh installer:

-replace /mach_kernel (I used a 10.4.8 apple dvd as base so I put the 8.8.1 b9 kernel by semtex)

-replace system/library/extensions.mkext (you can generate your own. It s also posible to unpack the one from the original dvd, add/replace the kexts needed and repack it again; I dont remember the exact sintaxis you have to type in the terminal but the commands are mkextunpack & kextcache.... If U repack the original one you showld replace AppleAPIC, AppleACPI, AppleSMBIOS, IOATAFamily, PS2Controller kexts . Maybe more kexts are needed to be replace so U might have to try a few times. I used the .mkext file from the jas 10.4.8 dvd. Be aware that this kexts are only used to get the DVD going. The files that are actually going to be installed are contained inside the Essentials.pkg package.
EDIT: You have to make shure that the system.kext (and all the kexts included within it) matches with the kernel version you are using. I was surprised when I figure out that the kernel included in the apple dvd (10.4.8) was actually 8.7.9...

-Replace the i386 folder (bin/standalone/i386) with the one from the hachintosh distro. This is needed to make the installation bootable. You will see that the original folder only contains efi.boot file.

-remove system/library/extensions folder.

-mod system/installation/packages/OSinstall.mpkg/contents/OSInstall.dist file. You could use BBedit, 'cos it wont change the ownership on the file. Basically, theres a couple of hardware checks at the begining. You have to remove the body of them so they look like:


Code: Select all
function checkSupportedMachine(machineType){

return true;
}

function checkSupportedBootRom(machineType){

return true;
}

function installCheckScript(){

return true;
}




This file contains also all the references to the pkg files needed for the installation (see post #2).
Later you have to add a package to install the modded files, so have a look how the thing are in this file.

-Replace /applications/diskutility.app. (this seems not to be necessary)

-Replace bless binary, and mediakit.framework.
EDIT: bless v24.0, mediakit.framework v8.5 seem to be the rightones. Most probably those are included in every x86 distro, but just to know; the framework comes from a 10.4.4 restore disk and bless from darwin8 up to 10.4.1 dtk. (thanx to zef!)

-At this point you could burn the image and see if it boots. Try to install and then move/replace mach_kernel, and the kexts listed above into the install HD (you need a second full operational osx install to do this).

Next step it will be to create a PKG with the files that have to be replaced in the installation HD and add it to the install sequence. For this is reccomended to use an old version (from 10.4.3 or so) of the packagemaker (included in xcode tools), later versions of xcode build packages that have version checking in them and wont install older kexts and files.

The package you build must contain the kernel and the kexts (IOAta, APIC, ACPI, AMBios, PSController, System, etc) and must be install after the Essentials package. Also you showld include a postflight script to be shure that everithing goes right. Something like:

Code: Select all
diskutil repairPermissions "$3/"

Bless -mount "$3/" -setBoot


You have to edit the system/installation/packages/OSinstall.mpkg/contents/OSInstall.dist. If you look carefully throught this file you will see how the things work and hopefully you will be able to add your package (I'll post more details about how to do this). When working with this file you can always launch the OSinstall.mpkg installer to check if everything is going fine (oviously you showldnt actually install but is good for checking if the mod script is still working).
With this method you could also include all the drivers you need for your hack, and any software you want (keep an eye on the size of the image).
JaS suggested to create your own Essential.pkg by ..."unpack the Essentials.pkg from the dvd and add your edited files directly to it, repack it with the proper permissions, then it is just a matter of replacing the Archive.pax.gz from your newly built package with the original Essentials.pkg's Archive.gz.pax."...


LAST NOTE: Last time I tryed using a 10.4.9 mac pro DVD as base. There were a couple of issues in the installer that I couldn solve:
1-Diskutility worked but was kind of boogy and crashing sometimes, no matter which version I used.
2-The keyboard (PS2) didnt work (the installer log file showed "TSMprocessRawKeyCode failed (-192)" error ).
But after installed OSx worked perfect (10.4.9). Also I manage to create a 10.4.9 DVD with VMWare support by using a 10.4.7 DVD as a base.
Last edited by blackchungo1 on Sat Dec 01, 2007 12:11 pm, edited 15 times in total.
Check the XxX_Install_Disc blog for upcoming releases and updates
http://xxx-install-disc.blogspot.com/
User avatar
blackchungo1
Jr. Member
 
Posts: 56
Joined: Mon Aug 20, 2007 7:55 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby blackchungo1 on Mon Aug 20, 2007 11:03 am

About adding pkg's:

If you open the OSInstall.dist file and scroll down a bit you will see this:


Code: Select all
       <line choice="EssentialSystemSoftware">
      <line choice="EssentialSystemSoftwareGroup"/>
      <line choice="AdditionalEssentials"/>
      <line choice="AdditionalSpeechVoices"/>
      <line choice="MediaFiles"/>
      <line choice="MigrationAssistant"/>
      <line choice=".....etc/>
      
   
    </line>
   


this is the way you make the entries for new items in the 'customize' menu of the installer. Notice that the names between '''' are only a reference and not the actual name of the package, nor the name that it will be shown in the menu.
So you could add something like this right below the last "</line>" code:

Code: Select all
<line choice="Patches">   
        <line choice="IOATAFamily.kext"/>
        <line choice="IOATAFamily.kext.b"/>
        <line choice="AppleACPIPlatform.kext"/>
        <line choice="kernel.... etc"/>

   </line>


The order you give to the menu items here will be the order in which packages will install!.

Now you have to match each menu entry with its corresponding package. We must set the name under each option will be shown, if it will be already selected or not, etc. Also we must tell the installer which an where is the right package and its size. So for the example above it will be something like:

Code: Select all
//EssentialPatches menu

<choice
id="Patches"
title="EssentialPatches"
description="all patches you need"
>

</choice>


<choice
id="IOATAFamily.kext"
title="IOATAFamily.kext"
description="IOATAFamily.kext"
start_enabled="upgrade_allowed()"
start_selected="true"
>
<pkg-ref id="com.pkg.IOATA"/>
</choice>

<choice
id="IOATAFamily.kext.b"
title="IOATAFamily.kext.Paulicat"
description="IOATAFamily.kext.b"
start_enabled="upgrade_allowed()"
start_selected="true"
>
<pkg-ref id="com.pkg.IOATAb"/>
</choice>


<choice
id="AppleACPIPlatform.kext"
title="AppleACPIPlatform.kext"
description="AppleACPIPlatform.kext"
start_enabled="upgrade_allowed()"
start_selected="true"
>
<pkg-ref id="com.pkg.AppleACPI"/>
</choice>

...etc



Now if you look at this that the id="name" must match exactly with the enrty you did in before. then title="name" is the actual name you will see in the menu when the installer is executed. Description="something" will show whatever description you want to add. Start_selected="true" or "false", thats pretty ovious. pkg-ref id="name" must contain the id you give to you pkg file when created (not the file name you save it as!).

If you scroll a bit more down you will see this:

Code: Select all
<pkg-ref id="com.apple.pkg.AdditionalFonts" auth="root">file:../AdditionalFonts.pkg</pkg-ref>
<pkg-ref id="com.apple.pkg.AdditionalSpeechVoices" auth="root">file:../AdditionalSpeechVoices.pkg</pkg-ref>
<pkg-ref id="com.apple.... etc


in the same way you must add:
Code: Select all
<pkg-ref id="com.pkg.IOATA" auth='root'>file:../IOATA.pkg</pkg-ref>
<pkg-ref id="com.pkg.IOATAb" auth='root'>file:../IOATAb.pkg</pkg-ref>
<pkg-ref id="com.pkg.AppleACPI" auth='root'>file:../AppleACPI.pkg</pkg-ref>

This works like: <pkg-ref id="id.of.the.pkg" auth='root'>file:../nameofthefile.pkg</pkg-ref>. The id and name of the package must match exactly!
Then you add the size information. This does not have to be exact and is just for the installer to make a aprox calculation of the space needed.
Code: Select all
<pkg-ref id="com.pkg.IOATA" installKBytes="1550" version="1.0"/>
<pkg-ref id="com.pkg.IOATAb" installKBytes="676" version="1.0"/>
<pkg-ref id="com.pkg.AppleACPI" installKBytes="45" version="1.0"/>


That will be it, more and less. You could also define all this references in one go, like this:

Code: Select all
<pkg-ref version="1.0" installKBytes="1550" id="com.pkg.IOATA">../IOATA.pkg</pkg-ref>

<choice
id="IOATAFamily.kext" 
title="IOATAFamily.kext"
description="IOATAFamily"
start_enabled="upgrade_allowed()"
start_visible="true"
start_selected="false"
>
<pkg-ref id="com.pkg.IOATA"/>
</choice>


Remember to use an old version of packagemaker to create your pakages, otherways they wont replace new kexts for older ones (most modded kexts are old versions). Its also good to add a script for fixing permissions, etc....


For Leo:

-You need the GM iso and the brazilmac patch. Follow his guide to apply the patch or replace the needed files by hand if you know how. But with the patch script you'll get a patched SL DVD size image in a few minutes.
-Once you have the resulting patched ISO, and you are shure you can boot to it , mount it as read-write.
(you need an already working Leo installation to unxar the files, so at least once you must install and then apply brazilmac postinstall patches)
-Copy the OSInstall.mpkg from the Leo iso to a folder in your desktop
-unxar it (see neo's post below)
Code: Select all
xar -x -v -f ~/desktop/folder/osinstall.mpkg

-modify the extracted distribution file (in the same way you would do with the OSInstall.dist) to add your packages onto the installation sequence. The only thing different is the path to the packages

Should be like this:
Code: Select all
<pkg-ref id="com.pkg.IOATA" auth='root'>file:./IOATA.pkg</pkg-ref>


and not like (notice theres one dot less in the path pointing to the pack!)

Code: Select all
<pkg-ref id="com.pkg.IOATA" auth='root'>file:../IOATA.pkg</pkg-ref>

You need to add a package with joblo's script (http://forum.osx86scene.com/viewtopic.php?f=16&t=1661&st=0&sk=t&sd=a&start=15#p16764) as a postflight in order to render the install partition bootable. Make shure you have the Startupfiletool inside the usr/standalone/i386 folder (inside Leo ISO).
...and if you are smart enough you could modify this script to use the new PC-EFI boot loader (viewtopic.php?f=16&t=2520).....
-Xar the file again
Code: Select all
cd ~/desktop/folder/
rm -R OSInstall.mpkg
xar -c ./ -v -f  ~/desktop/mod_osinstall.mpkg

-Replace the OSInstall from the leo ISO with the one you modded
-Add your custom packages in the /system/installation/packages/

Read through the whole thread to see more details.
Last edited by blackchungo1 on Sun Nov 11, 2007 1:09 am, edited 4 times in total.
Check the XxX_Install_Disc blog for upcoming releases and updates
http://xxx-install-disc.blogspot.com/
User avatar
blackchungo1
Jr. Member
 
Posts: 56
Joined: Mon Aug 20, 2007 7:55 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby BrumBrum74 on Mon Aug 20, 2007 12:03 pm

Very nice guide. Hope somebody will make a 10.4.10 dvd soon.
User avatar
BrumBrum74
Full Member
 
Posts: 205
Joined: Fri Aug 03, 2007 9:29 pm

Re: [GUIDE] How to create a custom OSX DVD.

Postby blackchungo1 on Mon Aug 20, 2007 1:58 pm

I tried to integrate apple combo updates in the installation sequence. They wont work as they are; you will have to modify the package scripts. I was looking throught a Myzar 10.4.9 DVD. As far as I remember he included 2 combo updates, but if you compare them with the originals you get from apple there are some differences in the pre and postflight scripts (and maybe more that scape to me). At the moment I dont have time to work on this but maybe someone else could.
Anyway theres a 10.4.10 AMD in the TPB that might work on intel too.
Check the XxX_Install_Disc blog for upcoming releases and updates
http://xxx-install-disc.blogspot.com/
User avatar
blackchungo1
Jr. Member
 
Posts: 56
Joined: Mon Aug 20, 2007 7:55 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby Lkr on Mon Aug 20, 2007 6:52 pm

i love you. if i was a mod in this area, this would be a definite sticky.
User avatar
Lkr
Moderator
Moderator
 
Posts: 104
Joined: Fri Aug 03, 2007 10:23 pm

Re: [GUIDE] How to create a custom OSX DVD.

Postby NeverLegal on Mon Aug 20, 2007 7:04 pm

On to creating my own dvd.
Do as you please but please as you do.

Dell Inspiron 1440
Intel - Core 2 Duo - Vid - 1366x768 Intel 8086:2a43 - Sound - Intel IDT HDA volume control and mic - Ethernet - Realtek (RT) 8101 - Wireless - BCM 4315 . 1397
User avatar
NeverLegal
Global Moderator
Global Moderator
 
Posts: 274
Joined: Fri Aug 03, 2007 10:58 pm
Location: Earth

Re: [GUIDE] How to create a custom OSX DVD.

Postby Ramm on Tue Aug 21, 2007 12:51 am

You realize this doesn't work for Leopard though ;)

Leopard doesn't use real .pkgs and .mpkgs as installation files, it uses XARed files with .pkg extensions - so it's almost a zip file.
User avatar
Ramm
Full Member
 
Posts: 204
Joined: Fri Aug 03, 2007 1:28 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby NeoPheus on Tue Aug 21, 2007 9:46 am

But you could "unxar" the OSInstall.mpkg and modify it and then "xar" it again! :D

€: Ok, more info on this:

Navigate to the folder where do you want to have the files Unxared...

Unxar it:
Code: Select all
xar -x -v -f *osinstall.mpkg*


Delete .ds_store!

Modify the file and then navigate to the folder where you Unxared it and then Xar it:
Code: Select all
xar -c ./ -v -f  *mod_osinstall.mpkg*



€2: This only works with Leo!! Or you install Xar on Tiger...

cYa ~Neo
Image

"Welcome to the Anus Invasion... Sum Fartie 1... E Ca Hai..." by Stevo32 :-D
User avatar
NeoPheus
Newbie
 
Posts: 15
Joined: Thu Aug 09, 2007 6:52 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby Ramm on Wed Aug 22, 2007 7:01 am

It's a bit more complicated than that, because you have to modify "Payload" (which contains the actual files). "Payload" is actually a TAR file, but you need to correct the permissions and then reXAR Scripts, BOM, Payload, then the other file there.
User avatar
Ramm
Full Member
 
Posts: 204
Joined: Fri Aug 03, 2007 1:28 am

Re: [GUIDE] How to create a custom OSX DVD.

Postby blackchungo1 on Wed Aug 22, 2007 7:11 am

Yes, this was meant for tiger. I havent look into leopard DVD but for what Ramm says wont be so easy.....

BTW someone has upload a iMac 10.4.10 disk to DMND; anybody interested could use this as a base for a x86 dvd.
Last edited by blackchungo1 on Wed Aug 22, 2007 4:43 pm, edited 1 time in total.
Check the XxX_Install_Disc blog for upcoming releases and updates
http://xxx-install-disc.blogspot.com/
User avatar
blackchungo1
Jr. Member
 
Posts: 56
Joined: Mon Aug 20, 2007 7:55 am

Re: [GUIDE] How to create a custom OSX DVD (Tiger).

Postby NeoPheus on Wed Aug 22, 2007 2:58 pm

Hm... ok!
I just modded a Leo DVD...
I will test it this night!

Ramm, do you mean that the new installer only can install xar-packages?


cYa ~Neo
Image

"Welcome to the Anus Invasion... Sum Fartie 1... E Ca Hai..." by Stevo32 :-D
User avatar
NeoPheus
Newbie
 
Posts: 15
Joined: Thu Aug 09, 2007 6:52 am

Re: [GUIDE] How to create a custom OSX DVD (Tiger).

Postby Ramm on Wed Aug 22, 2007 7:34 pm

Yes, exactly.

Here's a little thing I made to "break-down" the package structure:
Image
User avatar
Ramm
Full Member
 
Posts: 204
Joined: Fri Aug 03, 2007 1:28 am

Re: [GUIDE] How to create a custom OSX DVD (Tiger).

Postby NeoPheus on Thu Aug 23, 2007 5:28 am

Ok right now...
I tested my DVD yesterday:
It worked like a charm! :D
The package "patches" was installed correctly and it ran the scripts!

So: You DON'T need the new package format for Leo!

Maybe I will make a installable DVD with patches (if I have the time).

cYa ~Neo
Image

"Welcome to the Anus Invasion... Sum Fartie 1... E Ca Hai..." by Stevo32 :-D
User avatar
NeoPheus
Newbie
 
Posts: 15
Joined: Thu Aug 09, 2007 6:52 am

Re: [GUIDE] How to create a custom OSX DVD (Tiger).

Postby BrumBrum74 on Thu Aug 23, 2007 6:21 am

NeoPheus: Nice work. Hope you will release a dvd for us to test.
User avatar
BrumBrum74
Full Member
 
Posts: 205
Joined: Fri Aug 03, 2007 9:29 pm

Re: [GUIDE] How to create a custom OSX DVD (Tiger).

Postby NeoPheus on Thu Aug 23, 2007 6:57 am

Yeah sure! :)
But first I have to figure out how to do the part with startupfiletool... So you don't need the Tiger DVD anymore.
If some1 know how to do this then pm me or something!

cYa ~Neo
Image

"Welcome to the Anus Invasion... Sum Fartie 1... E Ca Hai..." by Stevo32 :-D
User avatar
NeoPheus
Newbie
 
Posts: 15
Joined: Thu Aug 09, 2007 6:52 am

Next

Return to OSX86 How-To's

Who is online

Users browsing this forum: No registered users and 4 guests