diamondsw
Dec 17, 2001, 02:18 AM
After many days of customizing, fiddling, troubleshooting, and burning, I give you instructions on how to create a custom OS X install CD, *and* upgrade the OS that the CD boots off of. (Here's hoping I can post this much!) None of this information should ruffle Apple Legal, but if for some reason it does, please contact me politely, and I'll be glad to pull this post. Just be nice, okay?
Creating a Custom Mac OS X 10.1.1 Install CD
Introduction
Over the past few weeks, it has been discovered that one can very easily create a full install CD from the "Mac OS X 10.1 Update" CD's that Apple gave out some months ago. However, it is posisble to do much more than just convert an update CD to a full install CD. With a little bit of work, you can install any extra package you want as part of that single seamless installer. If you've been frustrated by the bugs in 10.1 regarding Oxford-911 firewire drives (as I have been), you can upgrade the OS on the CD, and allow installations onto these drives. Want to know more? Read on...
(*) Note - I have created all of these instructions from memory (I have checked the pathnames provided, however), so if you do encounter any problems with the instructions, please let me know. Thanks!
Part 1 - Converting the 10.1 Update CD to a full Install CD
This hack has been well documented on the internet, much to Apple's chagrin. I expect that Appe will plug these holes in future updates. So, you may want to get familiar with these steps, as it may not be the last time you create a custom install CD from the original 10.1 update CD.
All of this was made possible by the extensive changes made between version 10.0 and version 10.1 of Mac OS X. Thanks to this, we all recieved complimentary update CD's (or paid $20 for "shipping and handling"), which are now proving to be very useful. These CD's contained the entire 10.1 operating system (which could be verified by erasing the installation volume before setting up 10.1), protected by what turned out to be a very easily defeatable check.
First, some background on installation packages. Mac OS X, unlike the classic Mac OS, includes a built-in Installer program that makes it very easy to perform simple and complex installations, including that of the OS itself. An installation package contains several pieces of information:
a) The name of the package
b) The files to be installed
c) The conditions by which to allow installation
d) Various attributes, including requiring restart, asking for admin privileges, etc.
< Since Apple has been very upset that people are publicizing its gaffe, and since this information is readily available elsewhere, I have not included the exact details here. >
(*) Burning the CD itself can be the most difficult part of this process; at least it was for me. Using a QPS 12/10/32 FireWire burner (Plextor mechanism), I had numerous failures and problems. Some tips in case you run into trouble:
1) Don't verify - the burner frequently stopped responding, eventually producing either a failure to shut down properly or a kernel panic is I unplugged and replugged the drive
2) Manually set the burn speed to the rating of your CD's. Using "maximum possible" ignores the rated speed of the CD media, and burns at whatever your drive is capable of, usually with bad results
3) Use CDRW's if at all possible - you very well may have some coasters, and they might as well be reusable. If they do fail, use Disk Utility to erase them, and use a full erase if quick erase fails to result in a "0.00 byte" CDRW
Part 2 - Adding new packages to the CD
Now that you have a bootable installation CD (or rather, a writable image of one), you can customize it in many ways, but first, you need space. Navigate to "/Volumes/Mac OS X Install CD/System/Installation/Packages/". Your requirements may vary, but I removed all languages and the Additional Printer Drivers. I also removed all extra languages from "/Volumes/Mac OS X Install CD/Welcome to Mac OS X/". This freed up a couple hundred megabytes of space to use for other items.
Adding a package to the OS X Install CD involves three basic steps:
1) Add the package to "/Volumes/Mac OS X Install CD/System/Installation/Packages/"
2) Possibly remove any "InstallationCheck" or "VolumeCheck" files hidden in "Contents/Resources" in the new packages
3) Modify the "OSInstall.list" file inside "OSInstall.mpkg/Contents/Resources"
Steps 1 is easy. Download or copy into place the packages you want installed as part of the CD (or if you want even more, make your own - an exercise for the reader who has developer tools installed).
As far as removing the "InstallationCheck" and "VolumeCheck" files, be very careful. Packages generally have these there for a reason, and it's not impossible for them to actually perform a critical step necessary to install the package (although highly unlikely, since when these scripts are run the Installer does not know whether or not you will proceed with installing the package). However, they can get in the way of a perfectly good install CD. For instance, my goal was to install all updates to OS X that have come out since 10.1. Many of these updates (such as the 10.1.1 Update) check for the existance of 10.1 before they will install. Since this is a fresh install CD, there will be no existing installation, so these checks will fail and give a useless (or misleading) error message. Be careful, and make sure you know what order to install packages in, and what checks to remove. If it helps any, I removed all checks on my CD, and was very careful about installation order. Which brings us to step 3.
The "OSInstall.list" file inside of "OSInstall.mpkg" is what determines what packages are installed, which are default, and which are required. The stock file on the 10.1 Update CD looks like this:
Essentials.pkg:required
BSD.pkg
AdditionalPrinterDrivers.pkg
Japanese.pkg
German.pkg
French.pkg
Spanish.pkg
Italian.pkg
Dutch.pkg
This is a list of all packages to install (the mpkg is defined elsewhere to only look in the same directory it is in, but that's not important here). There are two options that can be added after a package name ":required" or ":unselected". Required packages are always installed, and cannot be skipped in a custom install. Unselected packages are not part of an "Easy Install", and are unselected by default in a custom install. Any package listed without either one is an optional package, but installed by default (as are all of the other packages above).
A critical thing to note is that the order of the packages in this list is the order in which they will install. If you want to install the 10.1.1 Update, for instance, you'll need to place it after Essentials, BSD, Security Update, and Installer Update. This is why I said earlier you can remove the "check" files, as long as you are very careful about the installation order.
For reference, here is the final list on my own personal install CD:
Essentials.pkg:required
BSD.pkg
Japanese.pkg
SecurityUpdate10-19-01.pkg
InstallerUpdate1.0.pkg
MacOSXUpdate10.1.1.pkg
IEUpdate.pkg
iTunes2.pkg
DVDPlayerUpdate.pkg
DevTools.pkg:unselected
Dec2001DevToolsExtras.pkg:unselected
DevSDK.pkg:unselected
DevExamples.pkg:unselected
By default, this will install 10.1, Japanese, the Security Update and Installer Update required by 10.1.1, the 10.1.1 Update, IE 5.1.3 Update, iTunes 2.0.3, and DVD Player 3.0.1 (*). It is able to install (but only via a custom install) the December 2001 Developer Tools. Quite a potent CD!
(*) I have not included the Airport 2.0 Update, since I'm not entirely sure how it deals with the "System/Installation" directory. I'll do further research, or the forthcoming 10.1.2 update may make all of this moot.
Part 3 - Upgrading the CD's boot OS to 10.1.1 (ADVANCED)
I did run into one very infuriating problem, however. The point of this for me was to create a bootable partition on my new FireWire backup drive. Why worry about getting the Finder to work on a CD if you can have an emergency boot parition elsewhere with all of your troubleshooting tools? However, this was a nice new Oxford-911 based drive. The most alert troubleshooters out there already have alarms going off in their heads - Mac OS X 10.1 was partially incompatible with the Oxford-911 chipset. Sure enough, the Install CD, while installing 10.1.1, is booting from 10.1, and my new drive wouldn't show up in the list of available drives to install on. On a whim, I decided to try to upgrade the OS on the CD image. What followed was very interesting and enlightening.
The installation was straightforward enough:
1) Mount the disk image.
2) Open the Security Update package, install on the image.
3) Open the Installer Update package, install on the image.
4) Open the 10.1.1 Update package, install on the image. (*)
(*) Before installing this package, you may want to open its contents and edit "Contents/Resources/English.lproj/MacOSXUpdate10.1.1.info" (assuming English) and change the package flag "RequiresReboot" to "NO". After all, why reboot if you're installing onto a disk image (as opposed to your active hard drive)?
On attempting to boot from this CD, I noticed two oddities immediately:
1) During boot, I saw a "broken system folder" icon after the Happy Mac
2) The mouse wouldn't work. At all. ADB, USB, trackpad, nothing.
3) You *need* the mouse. You can use "Full Keyboard Access" (see the Keyboard preference panel) to get through most of it, but once you try to select your installation disk, you're stuck.
However, my firewire drive was now showing up! So at least that much had worked.
After doing some internet research (Google is a lifesaver), I discovered from "Unsupported Utility X" that these problems were linked to the OS CD only loading the kernel extension (what we used to call drivers) located inside the "/System/Library/Extensions.mkext" file. Apparently, on a normal CD, this includes mouse drivers. The 10.1.1 Update, however, installs new drivers (like the updated FireWire driver) and rebuilds this file without the mouse driver. Conundrum - I couldn't use the "Extensions.mkext" I had (no mouse), but I couldn't use the 10.1 version (no Oxford-911 support). Hmmm...
One attempt (that may or may not have had an ultimate effect - I include it here in case it's useful) was based on the Darwin source code. To generate a fresh "Extensions.mkext" (assuming your image is mounted and has not been renamed), run this command at the command line (without the double quotes):
"/usr/sbin/mkextcache -l -t `arch` -o /Volumes/Mac\ OS\ X\ Install\ CD/System/Library/Extensions.mkext -d /Volumes/Mac\ OS\ X\ Install\ CD/System/Library/Extensions"
By itself, this still did not work. Apparently, the system does not feel a mouse driver should be in this cache. The "Unsupported Utility X" page did mention that the CD boot process differed from the normal process in that it did not check any extensions in the "/System/Library/Extensions" folder, since Apple had included everything needed in the "Extensions.mkext" file (except a working FireWire driver).
The boot process is controlled by various files, but at its most basic it's directed by the various "rc" files in the "/etc" directory. I compared several of these files, and discovered that when "/etc/rc.cdrom" executed "kextd" to load the kernel extensions, it was passing a "-j" argument that other files did not. While I had no idea what the "-j" argument did, I removed it on a hunch that it was causing the CD boot process to not check beyond "Extensions.mkext".
Lo, and behold, when I finished these edits, burned a CD and booted from it, after much CD churning the installer came up. The mouse worked, and with a couple of clicks, I installed a completely up-to-date 10.1.1 system onto my firewire backup drive. Not bad!
Conclusion
So what can you do with all of this? Plenty! You now can create an OS CD that boots with any OS updates applied that you may need (such as future hardware revisions). You can customize the install process to add any components you want, and force installation of them. You can even make your own installation packages for any corporate or third party software you want as part of a basic install. You can probably even delete the "Essentials.pkg" and "BSD.pkg" and install only extra software (such as a standard build of corporate or university applications). When third party disk recovery software comes out, this is a good starting point for creating customized boot CD's.
Tell me what you come up with! Have fun!
[ 12-17-2001: Message edited by: diamondsw ]
Creating a Custom Mac OS X 10.1.1 Install CD
Introduction
Over the past few weeks, it has been discovered that one can very easily create a full install CD from the "Mac OS X 10.1 Update" CD's that Apple gave out some months ago. However, it is posisble to do much more than just convert an update CD to a full install CD. With a little bit of work, you can install any extra package you want as part of that single seamless installer. If you've been frustrated by the bugs in 10.1 regarding Oxford-911 firewire drives (as I have been), you can upgrade the OS on the CD, and allow installations onto these drives. Want to know more? Read on...
(*) Note - I have created all of these instructions from memory (I have checked the pathnames provided, however), so if you do encounter any problems with the instructions, please let me know. Thanks!
Part 1 - Converting the 10.1 Update CD to a full Install CD
This hack has been well documented on the internet, much to Apple's chagrin. I expect that Appe will plug these holes in future updates. So, you may want to get familiar with these steps, as it may not be the last time you create a custom install CD from the original 10.1 update CD.
All of this was made possible by the extensive changes made between version 10.0 and version 10.1 of Mac OS X. Thanks to this, we all recieved complimentary update CD's (or paid $20 for "shipping and handling"), which are now proving to be very useful. These CD's contained the entire 10.1 operating system (which could be verified by erasing the installation volume before setting up 10.1), protected by what turned out to be a very easily defeatable check.
First, some background on installation packages. Mac OS X, unlike the classic Mac OS, includes a built-in Installer program that makes it very easy to perform simple and complex installations, including that of the OS itself. An installation package contains several pieces of information:
a) The name of the package
b) The files to be installed
c) The conditions by which to allow installation
d) Various attributes, including requiring restart, asking for admin privileges, etc.
< Since Apple has been very upset that people are publicizing its gaffe, and since this information is readily available elsewhere, I have not included the exact details here. >
(*) Burning the CD itself can be the most difficult part of this process; at least it was for me. Using a QPS 12/10/32 FireWire burner (Plextor mechanism), I had numerous failures and problems. Some tips in case you run into trouble:
1) Don't verify - the burner frequently stopped responding, eventually producing either a failure to shut down properly or a kernel panic is I unplugged and replugged the drive
2) Manually set the burn speed to the rating of your CD's. Using "maximum possible" ignores the rated speed of the CD media, and burns at whatever your drive is capable of, usually with bad results
3) Use CDRW's if at all possible - you very well may have some coasters, and they might as well be reusable. If they do fail, use Disk Utility to erase them, and use a full erase if quick erase fails to result in a "0.00 byte" CDRW
Part 2 - Adding new packages to the CD
Now that you have a bootable installation CD (or rather, a writable image of one), you can customize it in many ways, but first, you need space. Navigate to "/Volumes/Mac OS X Install CD/System/Installation/Packages/". Your requirements may vary, but I removed all languages and the Additional Printer Drivers. I also removed all extra languages from "/Volumes/Mac OS X Install CD/Welcome to Mac OS X/". This freed up a couple hundred megabytes of space to use for other items.
Adding a package to the OS X Install CD involves three basic steps:
1) Add the package to "/Volumes/Mac OS X Install CD/System/Installation/Packages/"
2) Possibly remove any "InstallationCheck" or "VolumeCheck" files hidden in "Contents/Resources" in the new packages
3) Modify the "OSInstall.list" file inside "OSInstall.mpkg/Contents/Resources"
Steps 1 is easy. Download or copy into place the packages you want installed as part of the CD (or if you want even more, make your own - an exercise for the reader who has developer tools installed).
As far as removing the "InstallationCheck" and "VolumeCheck" files, be very careful. Packages generally have these there for a reason, and it's not impossible for them to actually perform a critical step necessary to install the package (although highly unlikely, since when these scripts are run the Installer does not know whether or not you will proceed with installing the package). However, they can get in the way of a perfectly good install CD. For instance, my goal was to install all updates to OS X that have come out since 10.1. Many of these updates (such as the 10.1.1 Update) check for the existance of 10.1 before they will install. Since this is a fresh install CD, there will be no existing installation, so these checks will fail and give a useless (or misleading) error message. Be careful, and make sure you know what order to install packages in, and what checks to remove. If it helps any, I removed all checks on my CD, and was very careful about installation order. Which brings us to step 3.
The "OSInstall.list" file inside of "OSInstall.mpkg" is what determines what packages are installed, which are default, and which are required. The stock file on the 10.1 Update CD looks like this:
Essentials.pkg:required
BSD.pkg
AdditionalPrinterDrivers.pkg
Japanese.pkg
German.pkg
French.pkg
Spanish.pkg
Italian.pkg
Dutch.pkg
This is a list of all packages to install (the mpkg is defined elsewhere to only look in the same directory it is in, but that's not important here). There are two options that can be added after a package name ":required" or ":unselected". Required packages are always installed, and cannot be skipped in a custom install. Unselected packages are not part of an "Easy Install", and are unselected by default in a custom install. Any package listed without either one is an optional package, but installed by default (as are all of the other packages above).
A critical thing to note is that the order of the packages in this list is the order in which they will install. If you want to install the 10.1.1 Update, for instance, you'll need to place it after Essentials, BSD, Security Update, and Installer Update. This is why I said earlier you can remove the "check" files, as long as you are very careful about the installation order.
For reference, here is the final list on my own personal install CD:
Essentials.pkg:required
BSD.pkg
Japanese.pkg
SecurityUpdate10-19-01.pkg
InstallerUpdate1.0.pkg
MacOSXUpdate10.1.1.pkg
IEUpdate.pkg
iTunes2.pkg
DVDPlayerUpdate.pkg
DevTools.pkg:unselected
Dec2001DevToolsExtras.pkg:unselected
DevSDK.pkg:unselected
DevExamples.pkg:unselected
By default, this will install 10.1, Japanese, the Security Update and Installer Update required by 10.1.1, the 10.1.1 Update, IE 5.1.3 Update, iTunes 2.0.3, and DVD Player 3.0.1 (*). It is able to install (but only via a custom install) the December 2001 Developer Tools. Quite a potent CD!
(*) I have not included the Airport 2.0 Update, since I'm not entirely sure how it deals with the "System/Installation" directory. I'll do further research, or the forthcoming 10.1.2 update may make all of this moot.
Part 3 - Upgrading the CD's boot OS to 10.1.1 (ADVANCED)
I did run into one very infuriating problem, however. The point of this for me was to create a bootable partition on my new FireWire backup drive. Why worry about getting the Finder to work on a CD if you can have an emergency boot parition elsewhere with all of your troubleshooting tools? However, this was a nice new Oxford-911 based drive. The most alert troubleshooters out there already have alarms going off in their heads - Mac OS X 10.1 was partially incompatible with the Oxford-911 chipset. Sure enough, the Install CD, while installing 10.1.1, is booting from 10.1, and my new drive wouldn't show up in the list of available drives to install on. On a whim, I decided to try to upgrade the OS on the CD image. What followed was very interesting and enlightening.
The installation was straightforward enough:
1) Mount the disk image.
2) Open the Security Update package, install on the image.
3) Open the Installer Update package, install on the image.
4) Open the 10.1.1 Update package, install on the image. (*)
(*) Before installing this package, you may want to open its contents and edit "Contents/Resources/English.lproj/MacOSXUpdate10.1.1.info" (assuming English) and change the package flag "RequiresReboot" to "NO". After all, why reboot if you're installing onto a disk image (as opposed to your active hard drive)?
On attempting to boot from this CD, I noticed two oddities immediately:
1) During boot, I saw a "broken system folder" icon after the Happy Mac
2) The mouse wouldn't work. At all. ADB, USB, trackpad, nothing.
3) You *need* the mouse. You can use "Full Keyboard Access" (see the Keyboard preference panel) to get through most of it, but once you try to select your installation disk, you're stuck.
However, my firewire drive was now showing up! So at least that much had worked.
After doing some internet research (Google is a lifesaver), I discovered from "Unsupported Utility X" that these problems were linked to the OS CD only loading the kernel extension (what we used to call drivers) located inside the "/System/Library/Extensions.mkext" file. Apparently, on a normal CD, this includes mouse drivers. The 10.1.1 Update, however, installs new drivers (like the updated FireWire driver) and rebuilds this file without the mouse driver. Conundrum - I couldn't use the "Extensions.mkext" I had (no mouse), but I couldn't use the 10.1 version (no Oxford-911 support). Hmmm...
One attempt (that may or may not have had an ultimate effect - I include it here in case it's useful) was based on the Darwin source code. To generate a fresh "Extensions.mkext" (assuming your image is mounted and has not been renamed), run this command at the command line (without the double quotes):
"/usr/sbin/mkextcache -l -t `arch` -o /Volumes/Mac\ OS\ X\ Install\ CD/System/Library/Extensions.mkext -d /Volumes/Mac\ OS\ X\ Install\ CD/System/Library/Extensions"
By itself, this still did not work. Apparently, the system does not feel a mouse driver should be in this cache. The "Unsupported Utility X" page did mention that the CD boot process differed from the normal process in that it did not check any extensions in the "/System/Library/Extensions" folder, since Apple had included everything needed in the "Extensions.mkext" file (except a working FireWire driver).
The boot process is controlled by various files, but at its most basic it's directed by the various "rc" files in the "/etc" directory. I compared several of these files, and discovered that when "/etc/rc.cdrom" executed "kextd" to load the kernel extensions, it was passing a "-j" argument that other files did not. While I had no idea what the "-j" argument did, I removed it on a hunch that it was causing the CD boot process to not check beyond "Extensions.mkext".
Lo, and behold, when I finished these edits, burned a CD and booted from it, after much CD churning the installer came up. The mouse worked, and with a couple of clicks, I installed a completely up-to-date 10.1.1 system onto my firewire backup drive. Not bad!
Conclusion
So what can you do with all of this? Plenty! You now can create an OS CD that boots with any OS updates applied that you may need (such as future hardware revisions). You can customize the install process to add any components you want, and force installation of them. You can even make your own installation packages for any corporate or third party software you want as part of a basic install. You can probably even delete the "Essentials.pkg" and "BSD.pkg" and install only extra software (such as a standard build of corporate or university applications). When third party disk recovery software comes out, this is a good starting point for creating customized boot CD's.
Tell me what you come up with! Have fun!
[ 12-17-2001: Message edited by: diamondsw ]