Slipstream OSX

From M L Vision Network Services Wiki

Jump to: navigation, search

Contents

Slipstream OSX v1.0 README

A Mac OS X Install DVD conversion script

Written by Dense
Derived from the works of many others include BrazilMac

Contact: slipstreamosx@gmail.com

Introduction

The purpose of this script is to convert a retail Mac OS X Leopard DVD into a version bootable on standard PCs. However, this script does not try to make a DVD that is compatible on everyone's system. It is more of a distribution builder, following a set of rules to build a system that meets the users requirements. This means that each person that uses this script will have a different image created for their own system.

When I started writing this, I set myself some goals on the capabilities. These were:

  • Fully customisable. Nothing hard coded. Everything should be changeable.
  • Forward compatible. Should work with all future revisions of OS X with at most minor editing.
  • Dynamic. No original files should be harmed (only moved) and edits done dynamically (searching through the files for the right point to edit or insert data).
  • Error resistant. Heavy checking of data and fields and try to handle many different possible conditions.
  • Simplified. Just what is needed and nothing more. Too many old legacy files were being used in newer releases when no one knew why.

I feel the results meet these goals and while I have had to make some compromises due to scripting limitations and time constraints, I have managed to keep true to the ideals I initially set.

Features

There are a number of features that set this conversion script apart from others. It is a complete conversion process and it does everything needed to get the resulting system operational following the guidelines you choose.

  • Non destructive where all original files are renamed on both the bootable DVD and hard drive installation.
  • Easy installation of custom extensions and plugins.
  • Dynamically modifying plist entries for correct device identification based on a simple rule file.
  • Custom kernels using delta files for smaller distribution.
  • Official updates can be injected into the installer.
  • The bootable DVD uses the exact same extensions as the hard drive install. If you can get to the installer application you will have a working system when the installation process completes.
  • Choice of using EFI emulated boot loader for better kernel and extension compatibility.
  • Support for GPT (GUID Partition Table) partitions.
  • Correct installation of bootloader. No tricks, just done properly. Non destructive if another bootloader exists but does install as much as it can.
  • Building packages of all extra components and added to the Apple installer. No more post installation scripts.
  • Heavy error checking, it won't keep running if things aren't going smoothly and will advise what you need to do to fix the error.
  • Modern design. Installs what is needed and nothing more.
  • Future proof. Updated Mac OS X releases are likely to work with only minor changes.
  • Works with all types of Mac OS X Leopard including retail, restore discs and server editions.
  • Capability to use a hard drive for fast installs instead of burning to a DVD.

Requirements

Building the image has some basic requirements.

  • Mac OS X Leopard (preferable) or Tiger system on the Intel platform.
  • 20GB of free disk space.
  • Unmodified Mac OS X Leopard in disk image format.

Installing the converted image has requirements that are far beyond the scope of this document. Useful forums for assistance in working out if your system has the correct specifications:

However, there are a few basic requirements:

  • Intel CPU with at least SSE2 instruction set
  • 512M memory or greater

Installation

The script and its support files are distributed in a compressed tar format (.tar.bz2). If you are reading this you have obviously worked out how to extract it.

The core of the processis the script in the top level called slipstream. This is a UNIX shell script that can be opened in a text editor for editing. The top section contains the customisation options. If you don't know what you are doing it is recommended just to set one value.

dmg="MacOSX105.dmg"

Copy the disk image to the images directory and make sure the name matches.

Also you will need to elevate yourself to root privileges using the sudo command (sudo -s). Execute the script as follows:

./slipstream

This process may take up to 30 minutes depending on your hard drive speed. You will be left with a converted image in the images directory. This image can then be burned to a DVD using any disk burning software.

Customisation

There are a number of ways to customise the resulting image. Most users are going to need to add extra extensions or plugins. There will often also be a need to change the device identification within plist files. I have provided the capability to do these easily.

The file and directory structure of the package is as follows:

Root Subfolder (If Applicable) Description
files extensions Any extensions added to this directory will be added to the DVD. Permissions and ownership are not important as they will set correctly when they are copied.
extensions.disabled Any extensions you don't want included can be stored here. This is useful when experimenting.
plugins Any plugin added to this directory will be added to the DVD. Make sure it is a valid plugin (the plist shows you the dependency order and often the first entry in OSBundleLibraries is the actual owning extensions).
plugins.disabled Any plugins you don't want included can be stored here. This is useful when experimenting.
deviceid Any extension or plugin that needs a PCI device id added to it needs a manifest file. There are 2 examples in the directory to help you create these. There are 4 variables that define how to edit the plist.


kext="<extension directory name>"
plugin="<plugin directory name>"
originalid="<original PCI device ID to search for>"
replacementid="<replacement PCI device ID>"

The replacementid can contain multiple devices. They should be separated with spaces but as long as the format is the same as a normal plist, there won't be any problems (this means masking can also be used). Make sure that the manifest files do not overlap in what they do. If two manifests with different names but work on the same extensions, only the manifest that is first loaded will be followed correctly.

devideid.disabled Any manifest files you don't want included can be stored here. This is useful when experimenting
updates Any Mac OS X update file (in DMG format) placed here will be added to the installer. There is appoximately 200MB of free space for updates so be careful not to exceed this or you will need to build an image with dual layer support. Multiple updates should be support but it is a better choice to use a single combo updater (Intel preferable for size reasons)
updates.disabled Any update file you don't want included can be stored here. This is useful when experimenting
kernel Custom kernels are stored here. They are delta files built with xdelta and only contain the differences between the stock kernel and the custom kernel. The version string in the main script controls which file is used
boot Boot files are stored here. The only file that might need to be changed is boot.pcefi (which is the EFI boot loader) and as new versions are released can be overwritten
tools Supporting tools are stored here. There should be no need to make changes to this directory
images The original DMG must be copied here for the script to run. The resulting ISO file will also be copied here. Intermediary images will also exist here but can be deleted if space is a premium
slipstream The core script file

Variables

Variable Arguments (default underlined) Description
dmg MacOSX105.dmg The original DMG file.
version 10.5.0_sleep Kernel xdelta to use.
useefi Yes No Setting to control the use of the EFI bootloader for both the DVD and HD installation.
usevanillakernel No Partial Yes This setting controls the installation of a custom kernel. When enabled ("Yes" or "Partial" are set), the kernel package will not be selected in the installer and the vanilla kernel will be used. It is recommended that this be set to "Partial". This will make the DVD use a custom kernel but the final install will be the vanilla kernel. Packages listed in "exclusions" will be unselected in the installer if "Yes" or "Partial" are selected.
optimise No Yes Removes PPC code from binaries on the install DVD. This frees up approximately 700MB space. Not recommended unless the Apple update is greater than 180MB and a single layer DVD is needed.
removexcode No Yes Keep Xcode on the final image. For single layer images this needs to be set to no. Xcode cannot be retained when creating an image using 10.4 due to resizing issues.
removeextensions AppleHWSensor AppleIntelCPUPowerManagement Controls which extensions are deleted from the image. This is important when needing to delete an extension but there is no actual replacement listed in the extensions directory.
excludepackages Kernel AppleACPIPlatform.kext Controls which exclusions are not selected by the installer. The packages are still created and if doing a custom install can be selected and installed. This is extremely useful for EFI installs where some stock files can be used.
removeprinters Brother Canon Epson FujiXerox Gutenprint HewlettPackard Lexmark Ricoh Samsung Xerox Removes printer packages
removelanguages BrazilianPortuguese Danish Dutch Finnish French German Italian Japanese Korean Norwegian Polish Portuguese Russian SimplifiedChinese Spanish Swedish TraditionalChinese DeTier Removes language packages
removeextras HP Guten lang.da lang.de lang.es lang.fi lang.fr lang.it lang.ja lang.ko lang.nl lang.no lang.pl lang.pt lang.pt_PT lang.ru lang.sv lang.zh_CN lang.zh_TW PrinterDriversGroup LanguageTranslations Removes extra sections that are linked to the printers and languages variable.
bootoptionsdvdkernelflags -v
bootoptionsdvdextra <key>Timeout</key>
<string>5</string>
bootoptionshdkernelflags
bootoptionshdextra <key>Timeout</key>
<string>5</string>
restorepoint
restorepointname
/dev/disk9s9
Image
These 2 variables are mostly used for internal testing but do serve a useful purpose for more advanced users. This allows you to install the DVD image to a hard drive so you don't need to burn a DVD. This allows for much quicker installs. Please be careful though, the device specified will be wiped. In the interests of preserving system integrity, I do not update the MBR micro code (so boot systems such as Grub and Acronis are not disabled) and I do not flag the partition active. If you are using this option you will understand what is necessary to complete the process.
convert Yes No Converts the original disk image to an editable image.
buildimage Yes No Builds the custom image.
generateiso Yes No Generates the bootable image.
deploy Yes No Deploys the image to a restore point partition. Do not use this unless you know what you are doing.

Files

During the process of creating this script, I spent much time investigating the extensions that were used in many other distributions. Most systems cannot operate with just the default Mac OS X Leopard files. Below are the files I changed. As I learn more about the reasons for certain files and their origins I will update this list. Any assistance would also be appreciated.

Extensions


PlugIns


Device Identification


Boot


Tips

Kernel

  • When using the vanilla kernel, you will need to make sure No-Execute bit (or Execute Disabled) is enabled in the BIOS otherwise you will get a system reboot.

Build Image

  • Make sure the Mac OS X DVD is not in the DVD drive when starting the script.

Installation

  • When installing to an external USB drive make sure you set the disk to use Master Boot Record or GUID Partition Table style partitions. The default (Apple Partiton Map) is not compatible with PCs and will cause the system to fail on boot.

Boot Tips

Technical

Boot

Disk microcode

MD5 Description
db9df97967ee20ac990929ba775a4875 boot0
ae394653198f34337407cf7862be5c8d boot0.debug
2afa3efccab9dd179f169db619d0abba
63fcfb7bffca10c1455d4c75896caf4b
boot0.gpt
66007bb3b9642cfadc36129c79be68ba boot0.gpt.debug

Note: Each installation using Grub in the MBR will provide a different MD5 as it also contains offsets to stage 1.5 or stage 2.

Partition bootloader

MD5 Description
e075260d8d053324c9165fba006ca8ef boot1h
91ac5e55048486f9062c761e9f081761 boot1h.debug
7a8311133d2aca1c8dc2b82c85e5125b boot1h.gpt
aa17b4305de57063e828b2963466023e boot1h.gpt.debug

HFS Startup File

MD5 Size Description
186d53192a694510cba353459ce2f517
63d97ec360e89a17a31446ced5b4de80
boot
02759100976007f60e16831722ee0f6f boot.pcefi (pc_efi v3)
7d784aa80195112dbea0c972c1e32cef boot.pcefi (pc_efi v4)
143e0eb95613afd95202b08446127549 boot.pcefi (pc_efi v5)
e23ff12be114ca39a294f8fb029ca083 boot.pcefi (pc_efi v7)
c68cf761cadcfa0e34e81739af3c3dda boot.pcefi (pc_efi v8)
3bce80abec869ebe09d42e86f45762dd boot.pcefi (unknown)

Caches

Type Path Filename
Mkext Cache /System/Library Extensions.mkext
Kext Repository Cache /System/Library/Extensions/Caches com.apple.kext.info
Kernel Cache /System/Library/Caches/com.apple.kernelcaches kernelcache

Kernel

Kernel MD5

MD5 Creator Version Type
128803a7ea87afbdbae3c613ca58fc30 Apple 10.5.2 Vanilla (Update)
b66e1db473a615dcbc394882cf17fcf2 Apple 10.5.2 Vanilla (MacBook Restore Disc)
2b357f5b6e44ab8e02c9e380f511f7cd Apple 10.5.1 Vanilla (Update)
423bf4861112c84cdc0437a7894a8f2b Apple 10.5.1 Vanilla (Mac Pro Restore Disc)
71ebf886c1b025483dc29365a90c35e6 Apple 10.5.0 Vanilla (Retail Disc)
647476c9d1ac9779104874c5dcd1c9cd ToH 10.5.1 Sleep
f968d175ab09022693c7b97cac3b7cca ToH 10.5.2 Sleep

Future Development

I plan to continue development and make the process more compatible with a greater range of hardware. I will try to make it version independent so future versions of Mac OS X Leopard are easily supported (the foundations are there for this but until I get hold of newer Leopard installation discs it is still untested). I am also always trying to improve the methods used in the script to make them more efficient as well as simpler in design.

I need the user communities help to find compatible extensions as well as to provide manifest files that allow for further device support. I will add any manifest that will add a reasonable range of hardware support without compromising the stability of other already working devices.

Feel free to use this script (or portions of it) with your own projects but don't forget to give credit for the parts you use. If you do make changes it would be appreciated if you could send them to me. I'll happily incorporate them into future versions if they improve any aspect of it.

Changes

1.0 - We aren't ready to release just yet.

Thanks

  • BrazilMac for inspiring me to create this script. Without his initial work I don't think I would have made the effort to do this.
  • SMF for his extensive testing especially of GPT.
  • Blackchungo for his information on how to convert a Mac OS X disk.
  • EpaL for his advice and motivation to SHIP IT!
  • Gotoh for the use of NVinject.
  • NetKas for the use of PC_EFI.
  • iGuru for continually testing the limits and finding all the bugs I would never have found otherwise.
  • CyRus, Aila, Onetrack, Stellarolla, Cryo and bastix for their testing.
  • All those who BrazilMac derived his script from. There aren't any names to thank directly but you know who you are.
Personal tools