View Single Post
 
Old 08-16-2009, 09:47 PM
lanceomni's Avatar
lanceomni lanceomni is offline
 
Join Date: Nov 2008
Location: Florida, US
Posts: 521
Don't let the length of this post get you down as its not as bad as it seems. I have added explinations to each step so that others may better understand them and why they were used. Also keep in mind that the commands we are using will need to be entered correctly as missing a / here or there can cause havac on your machine and make the problem worse.

Things you will need:
1. Usb thumbdrive
2. The proper kexts ( Check your PM inbox you have a new msg)

The process:
1. Format the thumb drive
2. Copy the proper kexts to the thum drive
3. Start the computer up into Single User Mode
4. Mount the file system
5. Backup the existing files
6. Mount the usb thumb drive
7. Copy over the new files
8. Set permissions and users
9. Restart


Instructions:

1. Format the thumb drive
Make sure its formatted FAT32 or HFS and remember which one it was.

2. Copy the proper kexts to the thumb drive

3. Start the computer up into Single User Mode (Without the USB thumb drive plugged in)
We will restart the computer in Single User Mode by using the boot-flag -s this will give us a comand line and the ability to modifiy the files. Im not 100% sure if you need it but lets toss cpus=1 in addition to -s
Code:
cpus=1 -s
4. Mount the file system
Code:
/sbin/mount -uw /
5. Backup the existing files
Even though the system does not boot we should backup the existing files before we do any modifications. You should not need to in single user mode but just in case you get a p
1. Make a new directory called "Backup"
Code:
mkdir /backup
2. Copy the Extensions folder and its contents to this new folder
Code:
cp -r /System/Library/Extensions /Backup/Extensions
3. Make a backup copy of your kernel.
Code:
cp -r /mach_kernel /mach_kernel.backup
If for some reason you want to boot this backup all you have to do is use the boot-flag mach_kernel.backup at startup. The vanila kernel will also require the cpus=1 boot flag on this machine.
6. Mount the usb thumb drive

Boot into Single User Mode without the USB thumb drive plugged in.
1. Make a directory in Volumes to mount your usb thumb drive to. We will call it "myusb" by typing:
Code:
mkdir /Volumes/myusb
2. Before we plug it in we need to make reference to what other drives we see in /dev by typing (You might want to write them down):
Code:
ls /dev/disk*
3. Now plug in the usb thumb drive, wait a second then look for a new addition by typing:
Code:
ls /dev/disk*
4. Now lets mount it. Lets say you there are two new additions disk1 & disk1s1. Type the following (replace msdos with hfs depending on how the usb thumb drive is formatted. If you use it on a PC too then its msdos):
Code:
mount -t msdos /dev/disk1s1 /Volumes/myusb
Then you can access your usb thumb drive at /Volumes/myusb
5. Lets give that a try and see if we can show a list of the files using the following two commands. Press enter after each line.
Code:
cd /Volumes/myusb
Code:
ls
7. Copy over the new files
This part is easy as long as your formatted the usb drive and the files I provided are the only ones on the disk. If there are other files on the drive DO NOT run the following commands.
We should still be in the myusb directory so lets copy the files. Remember press enter after each line.
Code:
cp *.kext /System/Library/Extensions
Code:
cp *.plugin /System/Library/Extensions
Code:
cp *.bundle /System/Library/Extensions
Code:
cp mach_kernel /mach_kernel

8. Set permissions and users
1. Correct ownership for all kernels
Code:
chown root:wheel /mach_kernel*
2. Correct permissions for all kernels
Code:
chmod 644 /mach_kernel*
3. Lets move over to a closer directory to shorten up the following commands.
Code:
cd /System/Library
4. Set the proper permissions
Code:
chmod -R 755 Extensions/
5. Set the proper user and group
Code:
chown -R root:wheel Extensions/
6. Touch the extensions folder
Code:
touch Extensions/
7. Remove the extensions cache to force OSX to rebuild it with our new kext.
Code:
rm -rf Extensions.mkext
9. Restart
Reboot using the boot-flags -v -f
-v Verbose Mode displays useful information during the boot process.
-f Forces OSX to load kexts from the extensions folder instead of the cache file. We did delete the cache file so this is just a precaution.

Let me know how it goes. When you get into OSX I would also repair permissions by typing the following in Terminal
Code:
diskutil repairpermissions /

MOBO: Z77MX-QUO-AOS CPU: Core i7 3770K GPU: MSI N760 TF 2GD5/OC Case: Modded MacPro2,1
Memory: 32GB Corsair Vengeance (CMY32GX3M4A1600C9) Wifi: Airport Extreme bcm94321MCA BIOS: HermitCrab Labs H3A.816M
Monitor: AOC Q2963Pm 29" WFHD 2560x1080 21:9
Interests: KDE on Apple Darwin, Keeping it real with the command line, Helping those that help themselves
Reply With Quote