Subscribe to our RSS news feed
AAPL 196.39 (1.17)

[HOW TO] Seamless upgrade from 10.4.x to 10.4.11 + Security Patches, Two easy-to-use scripts to streamline the upgrade process
*
  • Group: Members
  • Posts: 38
  • Joined: 16-May 08
  • Member No.: 231,324
Updated 2008/6/28. There have been a few incidents where systems have been unusable after performing an upgrade even when using the Restore script properly, and it has been tracked down to kexts which have previously been removed by the user but which the new upgrade or security patch has re-installed. The Restore script now takes this into account and disables those re-installed kexts automatically, so following this procedure should now result in a working upgrade in every situation.

There are lots of threads asking about how to safely upgrade, and there are lots of posts giving instructions that work for some people but not others. This is intended to be a "once and for all" solution, both for major upgrades and for security patches. Several posts describe security patches as safe to apply, but many people still report problems. The procedure described below will make sure your system still works. It's not necessary when installing regular program updates, like Safari 3.1.1, only system updates and security patches. I have successfully installed the 10.4.11 update from a 10.4.8 system, and security patches 2008-02 and 2008-03, using this procedure. And I now have a 100% working up-to-date system.

There are two shell scripts that need to be created, "backup.sh" and "restore.sh" which, as the names imply, backup critical system components on your current installation and then restore those components after an upgrade.

ONE-TIME SETUP
First, you need to create a backup directory and put the backup and restore scripts in that directory. This only needs to be done once. Thereafter, installing an update is as simple as running two scripts. A good place for the backup directory is in your home directory, so open a terminal and do the following:
CODE
cd ~
sudo -s
{enter password}
mkdir sys_backup
cd sys_backup


You can, of course, use a different directory name and location (the scripts only operate within the directory in which they are executed). Still in the terminal window, type:
CODE
nano backup.sh


Now, copy the following code and paste it into the nano editor (to paste within nano, right-click and select Paste):
backup.sh:
CODE
#!/bin/sh

# --------
echo Backing up kernel ...
cp -p /mach_kernel ./

# --------
echo Backing up kernel extensions, bundles, plugins ...
if [ ! -d system.library.extensions ]
then
echo Creating backup system.library.extensions directory ...
mkdir system.library.extensions
fi
cp -Rp /System/Library/Extensions/* system.library.extensions/

# --------
echo Backing up loginwindow.app ...
if [ ! -d system.library.coreservices ]
then
echo Creating backup system.library.coreservices directory ...
mkdir system.library.coreservices
fi
cp -Rp /System/Library/CoreServices/loginwindow.app system.library.coreservices/

# --------
echo Backing up profiler reporters ...
if [ ! -d system.library.systemprofiler ]
then
echo Creating backup system.library.systemprofiler directory ...
mkdir system.library.systemprofiler
fi
cp -Rp /System/Library/SystemProfiler/* system.library.systemprofiler/

# --------
echo Backing up configuration bundles ...
if [ ! -d system.library.systemconfiguration ]
then
echo Creating backup system.library.systemconfiguration directory ...
mkdir system.library.systemconfiguration
fi
cp -Rp /System/Library/SystemConfiguration/* system.library.systemconfiguration/

echo All done!


CTRL+O will save the file and CTRL+X will exit nano. To make sure the script is executable (or else you won't be able to run it) type this command:
CODE
chmod +x backup.sh


Now we need the restore script.
UPDATED 2008/6/28. Now disables kexts that may have previously been removed by the user, but have been re-installed by the upgrade/patch.

CODE
nano restore.sh


Copy the following code and paste it into the nano editor:
restore.sh:
CODE
#!/bin/sh

# --------
echo Restoring kernel ...
if [ ! -f ./mach_kernel ]
then
echo Backup of mach_kernel does not exist. Execute backup.sh first. You are probably screwed.
exit
fi
cp -p ./mach_kernel /

# --------
echo Restoring kernel extensions, bundles, plugins ...
curr_dir=$PWD/system.library.extensions
cd /System/Library/Extensions
for file in *
do
if [ -e "$curr_dir/$file" ]
then cp -Rp "$curr_dir/$file" /System/Library/Extensions/
else
echo Disabling "$file"...
mv "$file" "$curr_dir/$file_disabled"
fi
done
cd $curr_dir/..


# --------
echo Restoring loginwindow.app ...
cp -Rp system.library.coreservices/* /System/Library/CoreServices/

# --------
echo Restoring configuration bundles ...
cp -Rp system.library.systemconfiguration/* /System/Library/SystemConfiguration/

# --------
echo Restoring profiler reporters ...
cp -Rp system.library.systemprofiler/* /System/Library/SystemProfiler/

# --------
echo Cleaning kernel extensions cache ...
rm /System/Library/Extensions.mkext
rm /System/Library/Extensions.kextcache

# --------
echo Repairing disk permissions ...
diskutil repairPermissions /

echo All done!


CTRL+O to save, CTRL+X to exit. Again make sure the script is executable:
CODE
chmod +x restore.sh


You now have everything in place to perform all updates in the future.

BACKING UP YOUR SYSTEM
Before you upgrade or apply a security patch, run the backup script. NOTE: You must "sudo -s" before running the scripts since the files involved are owned by root:wheel. I was tempted to put the sudo command in the script itself, but I decided it was better to sudo manually so that you know you're about to change system files. Open a terminal, sudo, cd to your sys_backup directory, and run backup.sh:
CODE
sudo -s
{enter password}
cd ~/sys_backup
./backup.sh


The script will display the steps it is performing while backing up the critical components. IF YOU SEE AN ERROR MESSAGE, DO NOT CONTINUE UNTIL YOU'VE RESOLVED THE PROBLEM. Most likely you didn't copy/paste the scripts properly, or if you input them by hand there's a typo. If you've followed the one-time setup procedure exactly, you should not get any errors, so double-check that you've done everything right before you post problems in this thread.

When the script completes, you now have all your system critical components backed up and are ready to upgrade. You may want to copy your sys_backup folder to a memory stick or external drive, just to be on the safe side. It's called a Hackintosh for a reason. wink.gif

UPDATE PROCEDURE
Leave the Terminal window open, start the Software Update tool and click "Check Now". At this point, you want to update the system, not individual programs, so uncheck everything except the update you're installing. Let the system perform the upgrade, but DO NOT CLICK THE RESTART BUTTON. This is very important (which is why it's bold, CAPITALIZED, and red). You do not want the system to reboot into an upgraded kernel, because that will mean certain death 99% of the time. Leave that window as it is, waiting for you to click Restart, and go back to the terminal to run the restore script:
CODE
./restore.sh


This script restores your critical components, clears the kext cache, and repairs disk permissions. It will display the steps as it goes, and when disk permissions are being repaired you may get a whole slew of output. This is normal and means that some permissions were repaired. When the script is done, go back to the Software Update window and click Restart.

This backup/update/restore procedure can be followed for the security patches as well. As I said, some people have reported no problems installing a security patch without doing anything fancy, but I got a Gray Screen Of Death several times trying to install the 2008-02 security update before I settled on this procedure.

CONCLUSION
Once you have done your one-time setup, upgrading (or installing a security patch) is as simple as:
1) sudo -s, then run backup.sh
2) Install the upgrade/patch but DO NOT RESTART yet
3) run restore.sh, then Restart

Technically, you should only have to run the backup script once, so the process boils down to just the last two steps. However, I recommend running the backup script every time, since it is possible that your backup files may have accidentally been deleted or altered in some way during your day-to-day work (though not likely).

Some people may note that the backup script backs up more files than are really necessary; however, I found out the hard way that it is difficult to determine in advance which files you really need to back up for a particular update. Better safe than sorry, as they say.
PM Profile Card
Go to the top of the page
+ Quote Post

Posts in this topic
- obijohn   [HOW TO] Seamless upgrade from 10.4.x to 10.4.11 + Security Patches   May 30 2008, 07:23 PM
- - Tails92   I did it the hard way a month ago, updating XxX 1...   May 30 2008, 08:44 PM
|- - obijohn   QUOTE (Tails92 @ May 30 2008, 03:44 PM) I...   May 30 2008, 09:18 PM
- - grunerd   Trying this with uphuck 10.4.9 1.4a on AMD Athlon ...   May 31 2008, 08:01 AM
- - Tails92   Ok, then. It's just that I haven't seen an...   May 31 2008, 04:00 PM
- - Sevan   I'm downloading and installing the 10.4.11 upd...   Jun 5 2008, 10:58 PM
- - fyrekrig   Thanks very much for the guide. Worked perfectly f...   Jun 6 2008, 01:15 AM
|- - obijohn   QUOTE (fyrekrig @ Jun 5 2008, 08:15 PM) T...   Jun 8 2008, 12:18 PM
- - berchielli   Works just fine with me, 10.4.8 => 10.4.11 Tks   Jun 6 2008, 04:30 PM
- - αвѕтn   hmmm i did exactly as ur guide said i get a kerne...   Jun 11 2008, 10:49 AM
- - obijohn   Sorry you're having a problem, I suspect you d...   Jun 11 2008, 01:22 PM
- - fyrekrig   Have now tried the script for a Leopard 10.5.2 to ...   Jun 12 2008, 01:10 AM
|- - obijohn   QUOTE (fyrekrig @ Jun 11 2008, 08:10 PM) ...   Jun 12 2008, 01:53 PM
- - αвѕтn   obijohn, i did as u said and booted in the instal...   Jun 12 2008, 07:46 AM
|- - obijohn   QUOTE (αвѕтn @ Jun 12 ...   Jun 12 2008, 02:42 PM
|- - αвѕтn   QUOTE (obijohn @ Jun 12 2008, 02:42 PM) Y...   Jun 13 2008, 12:00 PM
- - fyrekrig   QUOTE If the update installation only starts AFTER...   Jun 12 2008, 11:27 PM
- - Buzz99   Works magic on system updates. But, do I have to d...   Jun 13 2008, 01:39 AM
|- - obijohn   QUOTE (Buzz99 @ Jun 12 2008, 08:39 PM) Wo...   Jun 13 2008, 01:34 PM
- - sleeper42   This worked great for me. I used the JaS 10.4.8 i...   Jun 16 2008, 05:59 PM
|- - obijohn   QUOTE (sleeper42 @ Jun 16 2008, 12:59 PM)...   Jun 16 2008, 06:37 PM
|- - sleeper42   Thanks ObiJohn for your suggestions... but I found...   Jun 17 2008, 05:24 PM
- - obijohn   The few people who've had problems after upgra...   Jun 27 2008, 06:24 PM
- - skynet-It   hi all, is this thread still active? I mean, will...   Aug 1 2008, 04:39 PM
- - fyrekrig   After initially thinking my upgrade from 10.4.8 to...   Aug 2 2008, 10:37 AM
- - Marino77   Thanks a lot for the guide! just updated 10.4....   Aug 6 2008, 10:32 PM
- - poopmonkey   great tutorial thanx.   Aug 20 2008, 05:03 AM
- - poopmonkey   Works Great! Really deserves a sticky!   Aug 30 2008, 08:44 PM
- - CptDodge   Backup went ok without any problems. Updated to 10...   Sep 4 2008, 08:41 PM
- - CptDodge   QUOTE (CptDodge @ Sep 4 2008, 09:41 PM) B...   Sep 6 2008, 06:09 PM
|- - dSense36   QUOTE (CptDodge @ Sep 6 2008, 08:09 PM) I...   Oct 16 2008, 06:42 PM
- - mykl   Hi gyus, if anybody cares, 006-2008 security updat...   Sep 19 2008, 02:14 PM
- - alexy   Thanks for the the info, worked almost perfectly o...   Sep 19 2008, 04:29 PM
- - Meowy   Updated to 10.4.11 and everything else successfull...   Sep 28 2008, 03:46 PM
- - entranced boy   Tried using this with the SambaFix_for_10.4.6.pkg....   Oct 10 2008, 02:58 AM
- - remz13   i am having a problem upgrading. I did all the st...   Oct 29 2008, 11:32 AM
- - NightFlyer   okay I have kinda a weird problem....everything go...   Nov 7 2008, 06:21 AM
|- - riws   QUOTE (NightFlyer @ Nov 7 2008, 08:21 AM)...   Nov 7 2008, 08:03 AM
|- - Onur Bozkurt   QUOTE (riws @ Nov 7 2008, 08:03 AM) Yes, ...   Dec 27 2009, 04:44 PM
- - the.delro   Your solution works elegantly on a virtual machine...   Nov 30 2008, 10:53 PM
- - soyobaby   Thank you very much obijohn! I just did update...   Dec 22 2008, 08:25 AM
- - L_B   my update wend fine too buti havnt install the the...   Dec 29 2008, 01:03 AM
- - Sir Sam   thanks! This worked for my dell inspiron 1100   Dec 30 2008, 07:10 PM
- - jamesmunnelly   Thanks for this. Just updated JaS 10.4.8 to 10.4.1...   Jan 1 2009, 11:42 PM
- - L_B   can any1 tell me whats the difference between mac ...   Jan 3 2009, 07:25 AM
- - eyemac   Will your scripts work for Leopard upgrades on a G...   Jan 4 2009, 02:08 AM
- - crolly88   Hi, tried your method following your guide step by...   Jan 5 2009, 01:25 AM
- - eyemac   Works like a charm in Tiger to update to 10.4.11...   Jan 11 2009, 11:14 PM
- - dornkaat   hey .... ive done it and it works great !...   Jan 19 2009, 08:45 PM
- - eli_xXx   Works just fine with me, JaS 10.4.8 => 10.4.11...   Jan 22 2009, 09:02 AM
- - Anonymous_   Thank you REALLY much! This helped me so much...   Mar 5 2009, 08:02 PM
- - polobreaka   does this work if you mess up on a kernel update t...   Apr 12 2009, 11:11 PM
- - xiozio   i get "permission denied" message after ...   May 9 2009, 04:25 PM
- - wbt   I did update to 10.4.11 from 10.4.8 on my Thinkpad...   Jun 7 2009, 10:37 PM
- - mikeh420   just tried on a Dell Dimension 2350 with 10.4.6, b...   Jun 18 2009, 03:02 AM
- - Fairlyodd   Okay this is not working..period. I have loaded Ja...   Jul 11 2009, 06:50 PM

Reply to this topic Start new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 9th February 2010 - 02:30 PM