Create Patchstick in Leopard

From AwkwardTV
Revision as of 05:41, 18 November 2007 by Maraklov (talk | contribs) (attempts to build patchstick under leopard)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Currently, there is no way to build a patchstick under Mac OS X 10.5 Leopard because the system extensions (and possibly other tools) of 10.5 are incompatible with the system extensions needed by the ATV (10.4.7ish).

So far I've tested with using extensions, bsd tools and lib files from the 10.4.9 Combo update as it most closely matches the ATV and a somewhat typical build environment of the patchstick up until Leopard. There are still a few missing .kext files from the update that are on a stock 10.4 Intel installation.

From 10.4.9 Combo Update - /System/Library/Extensions:

AppleACPIPlatform.kext
AppleAPIC.kext
AppleEFIRuntime.kext
AppleFileSystemDriver.kext
AppleHDA.kext
AppleHPET.kext
AppleIRController.kext
AppleRTC.kext
AppleSMBIOS.kext
AppleSMC.kext
BootCache.kext
GeForce.kext
IO80211Family.kext
IOATAFamily.kext
IOAudioFamily.kext
IOGraphicsFamily.kext
IOHIDFamily.kext
IONDRVSupport.kext
IONetworkingFamily.kext
IOPCIFamily.kext
IOPlatformPluginFamily.kext
IOSCSIArchitectureModelFamily.kext
IOStorageFamily.kext
IOUSBFamily.kext
IOUSBMassStorageClass.kext
NVDANV40Hal.kext
NVDAResman.kext
System.kext
AppleIntelCPUPowerManagement.kext

Missing:

AppleFlashNVRAM.kext
AudioIPCDriver.kext
IOACPIFamily.kext
OSvKernDSPLib.kext


These are the most pressing omissions, as the ATV won't boot beyond the extensions being loaded and without them I can't test whether the other tools will work. One possible solution would be to get the files from a 10.4 Intel install disc, however it makes it impossible for someone to create a patchstick legitimately without a copy of the disc.


Below is my attempt to modify the createPatchstick script to use the extracted 10.4.9 combo update files and whatever was missing was installed from the Leopard installation. The patchstick halted on the IOACPIFamily.kext.

copy_system() {
	echo "Copying System Extentions..."

	#these kexts are from 10.4.9
	cp -R 10.4.9 Combo Update/System/Library/Extensions/{AppleACPIPlatform,AppleAPIC,AppleEFIRuntime,AppleFileSystemDriver,AppleHDA,AppleHPET,AppleIRController,AppleRTC,AppleSMBIOS,AppleSMC,BootCache,GeForce,IO80211Family,IOATAFamily,IOAudioFamily,IOGraphicsFamily,IOHIDFamily,IONDRVSupport,IONetworkingFamily,IOPCIFamily,IOPlatformPluginFamily,IOSCSIArchitectureModelFamily,IOStorageFamily,IOUSBFamily,IOUSBMassStorageClass,NVDANV40Hal,NVDAResman,System,AppleIntelCPUPowerManagement}.kext /Volumes/Patchstick-root/System/Library/Extensions/

	#these leopard kexts do not appear to work
	cp -R /System/Library/Extensions/{AppleFlashNVRAM,AudioIPCDriver,IOACPIFamily,OSvKernDSPLib}.kext /Volumes/Patchstick-root/System/Library/Extensions/

	#all frameworks from 10.4.9
	cp -R 10.4.9 Combo Update/System/Library/Frameworks/{CoreFoundation,IOKit}.framework /Volumes/Patchstick-root/System/Library/Frameworks

	#only tool i could find on 10.4.9
	cp 10.4.9 Combo Update/bin/bash 10.4.9 Combo Update/usr/sbin/bless 10.4.9 Combo Update/bin/cp /Volumes/Patchstick-root/sbin/
	#leopard tools (not sure if they will work, did not get far enough on boot)
	cp /bin/chmod /usr/sbin/chown /sbin/mount /sbin/mount_hfs /sbin/mount_devfs /bin/sleep /sbin/umount /bin/sync /bin/sh /bin/ls /sbin/reboot /Volumes/Patchstick-root/sbin/

	#10.4.9 lib files
	cp 10.4.9 Combo Update/usr/lib/dyld 10.4.9 Combo Update/usr/lib/libSystem.B.dylib 10.4.9 Combo Update/usr/lib/libgcc_s.1.dylib /Volumes/Patchstick-root/usr/lib/
	#leopard lib files, not sure if it's compatible
	cp /usr/lib/libncurses.5.4.dylib /Volumes/Patchstick-root/usr/lib/

	#another lib file from 10.4.9
	cp 10.4.9 Combo Update/usr/lib/systemm/libmathCommon.A.dylib /Volumes/Patchstick-root/usr/lib/system/
}

And also, since we're going for compatibility and it was available with the 10.4.9 Combo update I grabbed the Kerberos.framework for the "Adding Kerberos..." section below that.

	echo "Adding Kerberos..."
	cp -p -R 10.4.9 Combo Update/System/Library/Frameworks/Kerberos.framework /Volumes/Patchstick-root/System/Library/Frameworks/OSXFrames/

Maraklov 13:41, 18 November 2007 (CET)